> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enfuce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate retail offline pin auth request template



## OpenAPI

````yaml test post /v1/authorization-templates/request/retail-offline-pin
openapi: 3.0.3
info:
  version: '1'
  title: Test API
  description: >
    This API is only available in DEMO environment and intended solely for
    testing purposes.


    The API has two categories of endpoints:

    - **Endpoints for generating authorization message bodies from templates**
    (e.g. /v1/authorization-templates/request/retail-offline-pin,
    /v1/authorization-templates/request/retail-ecommerce)

      Calls to these endpoints DO NOT simulate sending of authorization messages. They only generate the correct message for endpoints of the second type based on a small number of Request parameters. The generated Response message should then be supplied into the next type of endpoints (described below) to actually simulate sending an authorization.

    - **Endpoints for sending authorization messages** (e.g.
    /v1/authorizations/request, /v1/authorizations/reversal)

      Calling these endpoints simulates an authorization coming from a payment scheme to Enfuce. These endpoints are characterized by a bigger number of Request parameters. For the Request Body, you can use the Response generated by the first type of endpoints.
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: https://integration-api-cat2.demo.ext.test.cia.enfuce.com/test-api
security: []
paths:
  /v1/authorization-templates/request/retail-offline-pin:
    post:
      tags:
        - test-auth-request-templates
      summary: Generate retail offline pin auth request template
      operationId: postRetailOfflinePinAuthTemplate
      parameters:
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/retailOfflinePinTemplateRequest'
      responses:
        '200':
          description: Retail offline pin request successfully generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/authRequest'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          description: API is having problems
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
components:
  requestBodies:
    retailOfflinePinTemplateRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/retailTemplateRequest'
  schemas:
    authRequest:
      description: >-
        Request for generating ISO-8583 message and sending it immediately to
        processing system of Enfuce.
      type: object
      required:
        - card
        - transactionData
        - merchantData
      properties:
        card:
          $ref: '#/components/schemas/card'
        transactionData:
          $ref: '#/components/schemas/transactionData'
        threeDsData:
          $ref: '#/components/schemas/threeDsData'
        merchantData:
          $ref: '#/components/schemas/merchantData'
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    retailTemplateRequest:
      type: object
      description: Request to generate retail ecommerce auth request
      required:
        - card
        - transactionData
      properties:
        card:
          $ref: '#/components/schemas/card'
        transactionData:
          type: object
          required:
            - transactionAmount
          properties:
            transactionAmount:
              $ref: '#/components/schemas/money'
            settlementAmount:
              $ref: '#/components/schemas/money'
    card:
      description: |
        Data of the card with which the transaction is done with.
      type: object
      required:
        - cardId
      properties:
        cardId:
          $ref: '#/components/schemas/cardId'
        applicationSelection:
          $ref: '#/components/schemas/applicationSelection'
    transactionData:
      type: object
      required:
        - transactionAmount
        - transactionType
        - cardEntryMode
      properties:
        transactionAmount:
          $ref: '#/components/schemas/money'
        settlementAmount:
          $ref: '#/components/schemas/money'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        cardEntryMode:
          $ref: '#/components/schemas/cardEntryMode'
    threeDsData:
      type: object
      properties:
        authenticationValue:
          type: string
          description: >-
            The cryptographic authentication value returned from 3DS
            authentication.
        eci:
          type: string
          description: >-
            E-Commerce indicator representing the level of security and
            authentication achieved during the cardholder verification process
        dsTransactionId:
          type: string
          description: Directory Server Transaction Id
        protocolVersion:
          type: string
          description: 3DS protocol version
          enum:
            - 2.1.0
            - 2.2.0
    merchantData:
      type: object
      required:
        - merchantId
        - merchantName
        - merchantCity
        - merchantCountry
        - merchantCategoryCode
        - acquirerId
        - acquirerCountry
        - terminalId
        - partialApprovalCapable
      properties:
        merchantId:
          $ref: '#/components/schemas/merchantId'
        subMerchantId:
          $ref: '#/components/schemas/subMerchantId'
        merchantName:
          $ref: '#/components/schemas/merchantName'
        merchantCity:
          $ref: '#/components/schemas/merchantCity'
        merchantCountry:
          $ref: '#/components/schemas/country'
          description: >-
            The country where the transaction or withdrawal occurs as a
            ISO-3166-1 alpha-3 country code.
        merchantCategoryCode:
          $ref: '#/components/schemas/merchantCategoryCode'
        acquirerId:
          $ref: '#/components/schemas/acquirerId'
        acquirerCountry:
          $ref: '#/components/schemas/country'
          description: >
            The country of the merchants acquirer as a ISO-3166-1 alpha-3
            country code. This can be used to identify if transaction is in
            scope of PSD2 regulation.
        terminalId:
          $ref: '#/components/schemas/terminalId'
        partialApprovalCapable:
          $ref: '#/components/schemas/partialApprovalCapable'
    money:
      description: Amount including currency.
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          example: 3.14
          minimum: 0
        currency:
          type: string
          format: iso4217-currencycode
          description: A valid ISO 4217 currency code
          example: EUR
    cardId:
      description: Unique ID of the card.
      type: string
      maxLength: 39
    applicationSelection:
      description: >
        Describes what card application type was selected for the transaction
        (for combo cards). Possible values:
          * `credit` - the credit card must be used.
          * `debit` - the debit card must be used.
      type: string
      enum:
        - credit
        - debit
      x-enum-varnames:
        - credit
        - debit
    transactionType:
      description: >
        The transaction type. The only fully supported type is RETAIL. 

        Other transaction types may be used, but no guarantees are made about
        their behaviour.

        Some transaction types have specific limitations:
          * `ATM` - In order to create ATM transactions, `merchantData.merchantCategoryCode` must be `6011`. This behaviour is downstream from the VISA and MC authorization systems. If a different code is used, transactions will be treated as `CASH`
      type: string
      enum:
        - RETAIL
        - CASH
        - ATM
        - CREDIT
        - UNIQUE
        - P2P_CREDIT
        - P2P_DEBIT
        - BALANCE_INQUIRY
        - CASH_DISBURSEMENT
    cardEntryMode:
      description: |
        Describes how the card credentials were captured. Possible values:
          * `MANUAL_ENTRY` - the card credentials were manually entered by the merchant.
          * `MAGNETIC_STRIPE_READ` - the magnetic stripe of the card was read by a terminal.
          * `CHIP_READ` - the EMV chip of the card was read by a terminal
          * `CONTACTLESS` - contactless transactions, i.e. the card credentials were read with near field communication (NFC) either from chip or digital wallet.
          * `ELECTRONIC_COMMERCE` - the cardholder entered the card credentials as an e-com merchant.
      type: string
      enum:
        - MANUAL_ENTRY
        - MAGNETIC_STRIPE_READ
        - CHIP_READ
        - CONTACTLESS
        - ELECTRONIC_COMMERCE
    merchantId:
      description: >
        A code that uniquely identifies a particular card acceptor, i.e. a
        merchant or a bank.
      type: string
      maxLength: 15
    subMerchantId:
      description: >
        A code that, when combined with the merchant and acquirer ids, uniquely
        identifies a particular card acceptor, i.e. a merchant or a bank.
      type: string
      maxLength: 15
    merchantName:
      description: Merchant name.
      type: string
      maxLength: 25
    merchantCity:
      description: The city where the transaction or withdrawal occurs.
      type: string
      maxLength: 13
    country:
      type: string
      format: iso3166-1-countrycode
      description: A valid ISO-3166-1 alpha-3 country code.
      example: FIN
    merchantCategoryCode:
      description: >
        Merchant category code as per card scheme classification. Merchants
        classification is done based on the type of business or service they
        sell.
      type: string
      maxLength: 4
      example: '5734'
    acquirerId:
      description: >
        This code identifies the financial institution acting as the acquirer
        for the merchant.
      type: string
      maxLength: 11
    terminalId:
      description: |
        A code that uniquely identifies a particular terminal at the merchant.
      type: string
      maxLength: 8
    partialApprovalCapable:
      description: >
        Indicates if merchant will accept partial approval of amount.

        E.g. at a fuel pump the initial authorisation might be a predefined flat
        amount to which the issuer can respond an available amount smaller than
        the actual authorisation request.

        Note that this functionality is only available when card account balance
        resides at issuer.
      type: boolean

````