openapi: 3.1.0
info:
  title: Tokenization Service
  description: >-
    This service is used to tokenize securely converts sensitive payment
    information (such as credit card numbers, bank account 

    details, or mobile wallet identifiers) into unique, non-sensitive tokens.
  version: 0.0.8
externalDocs:
  description: Github Documentation
  url: https://github.com/paymentspring/tokenization-service
servers:
  - url: http://localhost:8080/tokenization-service
    description: LOCAL
  - url: https://localhost:16778/tokenization-service
    description: DEV
  - url: https://localhost:16779/tokenization-service
    description: SIT
  - url: https://localhost:16780/tokenization-service
    description: QA
  - url: https://localhost:16781/tokenization-service
    description: UAT
security:
  - bearerAuth: []
tags:
  - name: Tokenize API
    description: >-
      This endpoint allows authorized clients to securely retrieve the original
      payment data associated with a specific token.
  - name: Tokenize API
    description: >-
      Tokenization offers a set of RESTful APIs for token management, including
      creation, update, retrieval, and deletion of tokens. The APIs enable
      secure tokenization of the various payment account data like ACH Bank
      Account, Credit Card, and Apple Pay.
  - name: Decrypt Token API
    description: >-
      This endpoint allows authorized clients to securely retrieve the original
      payment data associated with a specific token.
paths:
  /token-service/tokens:
    post:
      tags:
        - Tokenize API
      summary: Tokenize a Payment Account Data
      description: >-
        Creates a secure token for various payment data account including ACH
        Bank Account, Credit Card, and Apple Pay.
      operationId: tokenizePayment
      requestBody:
        description: Payment account data to tokenize.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenizationRequest'
            examples:
              ACH:
                summary: ACH Request
                description: ACH
                value:
                  paymentType:
                    ach:
                      bankAccount:
                        accountNumber: '4111111111111111'
                        routingNumber: '021000031'
                        accountType: Savings
                        tenderType: Consumer
                  tokenGroup: COMPANYTG
              Credit Card:
                summary: Credit Card Request
                description: Credit Card
                value:
                  paymentType:
                    creditCard:
                      card:
                        cardNumber: '4111111111111111'
                        expiration: '0329'
                        cardVerificationValue: '123'
                  tokenGroup: COMPANYTG
              Apple Pay:
                summary: Apple Pay Request
                description: Apple Pay
                value:
                  paymentType:
                    applePay:
                      encryptedData:
                        data: >-
                          6b2xlM8Lh/dSF+9jBqel7A6sdh6B2NJjp6wLbt/EIijjkKAh+9ynMlS4=
                        ephemeralPublicKey: MFkwEwYHKoZIzj0CGRNcOcPdTxd4GKiSMvyngGf31Hx3V
                        publicKeyHash: lRY9u8sMTf5Ezb4LoqSV6+70Q2fxbLZjFhJ/Lk+PgWI=
                        transactionId: dbb972ab5b3eab30072d886b1ef415f92a814204
                        signature: >-
                          MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhk
                        version: EC_v1
                  tokenGroup: COMPANYTG
        required: true
      responses:
        '200':
          description: Successful tokenization or error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostTokenizationResponse'
              examples:
                ACH Response:
                  summary: Success ACH Tokenization
                  description: ACH Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Created
                    token: 13634e83-5ad1-4814-afde-c6e2e0f32bbe
                    formatPreservedToken: '2848580716091111'
                    tokenGroupName: DEVTESTTG
                Credit Card Response:
                  summary: Success Credit Card Tokenization
                  description: Credit Card Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Created
                    token: 5293e9cd-1cde-4c94-a01f-c7c8b2ab289a
                    formatPreservedToken: '4111111453411111'
                    bin: '402123'
                    binLevel: Platinum
                    category: CREDIT
                    lastFour: '1111'
                    binLength: 6
                    network: VISA
                    isoCountry: UNITED STATES OF AMERICA (THE)
                    isoCountryCode: '840'
                    isInternational: false
                    tokenGroupName: DEVTESTTG
                InternalServerError:
                  summary: Internal Server Error
                  description: InternalServerError
                  value:
                    responseCode: '02500'
                    responseMessage: >-
                      An unexpected system error occurred. Please check with
                      support.
      security:
        - bearerAuth: []
    delete:
      tags:
        - Tokenize API
      summary: Delete Specific Token
      operationId: deleteToken
      requestBody:
        description: Token that would be deleted.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecryptTokenRequest'
            examples:
              Delete Token:
                summary: Delete Token Request
                description: Delete Token
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
        required: true
      responses:
        '200':
          description: Successful deletion of token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
              examples:
                Delete Token Response:
                  summary: Successful Delete Token Response
                  description: Delete Token Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Deleted
                NoRecordFound:
                  summary: No Record Found
                  description: NoRecordFound
                  value:
                    responseCode: '02400'
                    responseMessage: The server cannot find the requested resource.
                InternalServerError:
                  summary: Internal Server Error
                  description: InternalServerError
                  value:
                    responseCode: '02500'
                    responseMessage: >-
                      An unexpected system error occurred. Please check with
                      support.
      security:
        - bearerAuth: []
  /token-service/tokens/sensitive-data:
    post:
      tags:
        - Decrypt Token API
      summary: Decrypt a Token
      description: >-
        Retrieve the original payment data associated with a specific token.
        This endpoint requires authentication and is intended for use by
        authorized clients only.
      operationId: decryptToken
      requestBody:
        description: Token and Type for decryption.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecryptTokenRequest'
            examples:
              Decrypt ACH:
                summary: Decrypt ACH Request
                description: Decrypt ACH
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
                  types:
                    - ACH
              Decrypt Credit Card:
                summary: Decrypt Credit Card Request
                description: Decrypt Credit Card
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
                  types:
                    - PAN
        required: true
      responses:
        '200':
          description: 'Successful token decryption or error response. '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecryptTokenResponse'
              examples:
                ACH Response:
                  summary: Success Decryption for ACH
                  description: ACH Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Decrypted
                    token: 07ba706d-dcfc-4bfc-b161-4469a2633862
                    formatPreservedToken: '6558766560401113'
                    cryptcard: 4TestYx9OuN8145
                    bankAccount:
                      accountNumber: '4111111111111113'
                      routingNumber: '021000031'
                      accountType: Savings
                      tenderType: Consumer
                Credit Card Response:
                  summary: Success Decryption for Credit Card
                  description: Credit Card Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Decrypted
                    token: df482289-f841-4b1e-91a6-23be8a3e8a02
                    formatPreservedToken: '5111114152411215'
                    cryptcard: 4TestYx9OuN8145
                    creditCard:
                      cardNumber: '5111111111111121'
                      expiration: '1231'
                      bin: '402123'
                      binLevel: Platinum
                      category: CREDIT
                      lastFour: '1121'
                      binLength: 6
                      network: MASTERCARD
                      isoCountry: UNITED STATES OF AMERICA (THE)
                      isoCountryCode: '840'
                      isInternational: false
      security:
        - bearerAuth: []
  /token:
    patch:
      tags:
        - Tokenize API
      summary: Update Token
      description: >-
        Updates an existing token for various payment methods including credit
        cards, ACH bank accounts, and Apple Pay
      operationId: updateToken
      requestBody:
        description: Payment method details to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenizationRequest'
            examples:
              ACH:
                summary: ACH Request
                description: ACH
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
                  paymentType:
                    ach:
                      bankAccount:
                        accountNumber: '4111111111111111'
                        routingNumber: '021000031'
                        accountType: Savings
                        tenderType: Consumer
                  tokenGroup: COMPANYTG
              Credit Card:
                summary: Credit Card Request
                description: Credit Card
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
                  paymentType:
                    creditCard:
                      card:
                        cardNumber: '4111111111111111'
                        expiration: '0329'
                        cardVerificationValue: '123'
                  tokenGroup: COMPANYTG
        required: true
      responses:
        '200':
          description: Successful token update or error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
              examples:
                ACH Response:
                  summary: Success Token Update for ACH
                  description: ACH Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Updated
                Credit Card Response:
                  summary: Success Token Update for Credit Card
                  description: Credit Card Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Updated
                TokenNotFound:
                  summary: Token Not Found
                  description: TokenNotFound
                  value:
                    responseCode: '02400'
                    responseMessage: The server cannot find the requested resource.
                InternalServerError:
                  summary: Internal Server Error
                  description: InternalServerError
                  value:
                    responseCode: '02500'
                    responseMessage: >-
                      An unexpected system error occurred. Please check with
                      support.
      security:
        - bearerAuth: []
  /token-service/tokens/metadata:
    get:
      tags:
        - Tokenize API
      summary: Get Payment Data By Token
      description: >-
        Retrieve the a payment data associated with a specific token. This will
        return meta data about the payment data but not the sensitive payment
        data.
      operationId: getTokenDetails
      requestBody:
        description: Token and Type parameters for retrieving payment account data.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecryptTokenRequest'
            examples:
              Get ACH Payment Account Data:
                summary: Get ACH Payment Account Data Request
                description: Get ACH Payment Account Data
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
                  types:
                    - ACH
              Get Credit Card Payment Account Data:
                summary: Get Credit Card Payment Account Data Request
                description: Get Credit Card Payment Account Data
                value:
                  token: 9c5a8d98-ccd3-452b-be55-e66ad2132e98
                  types:
                    - PAN
        required: true
      responses:
        '200':
          description: Successful retrieval of token details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTokenizationResponse'
              examples:
                ACH Response:
                  summary: Success Retrieval of Payment Data for ACH
                  description: ACH Response
                  value:
                    responseCode: '0'
                    responseMessage: Payment Data Retrieved
                    token: 07ba706d-dcfc-4bfc-b161-4469a2633862
                    formatPreservedToken: '6558766560401113'
                    bankAccount:
                      routingNumber: '021000032'
                      accountType: Savings
                      tenderType: Consumer
                Credit Card Response:
                  summary: Success Retrieval of Payment Data for Credit Card
                  description: Credit Card Response
                  value:
                    responseCode: '0'
                    responseMessage: Token Decrypted
                    token: df482289-f841-4b1e-91a6-23be8a3e8a02
                    formatPreservedToken: '5111114152411215'
                    creditCard:
                      expiration: '1230'
                      bin: '402123'
                      binLevel: Platinum
                      category: CREDIT
                      binLength: 6
                      network: MASTERCARD
                      isoCountry: UNITED STATES OF AMERICA (THE)
                      isoCountryCode: '840'
                      isInternational: false
                NoRecordFound:
                  summary: No Record Found
                  description: NoRecordFound
                  value:
                    responseCode: '02400'
                    messages:
                      - The server cannot find the requested resource.
                InternalServerError:
                  summary: Internal Server Error
                  description: InternalServerError
                  value:
                    responseCode: '02500'
                    messages:
                      - >-
                        An unexpected system error occurred. Please check with
                        support.
      security:
        - bearerAuth: []
components:
  schemas:
    AchPayment:
      type: object
      description: ACH payment details
      properties:
        bankAccount:
          $ref: '#/components/schemas/BankAccount'
          description: Bank account details
      required:
        - bankAccount
    Applepay:
      type: object
      properties:
        encryptedPaymentData:
          $ref: '#/components/schemas/EncryptedPaymentData'
    BankAccount:
      type: object
      description: Bank account details
      properties:
        accountNumber:
          type: string
          description: The bank account number.
          example: 459887746321Z
        routingNumber:
          type: string
          description: The bank routing number.
          example: '123456789'
        accountType:
          type: string
          description: The type of bank account.
          enum:
            - Savings
            - Checking
          example: Savings
        tenderType:
          type: string
          description: The bank tender type.
          enum:
            - Consumer
            - Commercial
          example: Consumer
      required:
        - accountNumber
        - accountType
        - routingNumber
    Card:
      type: object
      description: Credit card details
      properties:
        cardNumber:
          type: string
          description: The credit card number.
          example: '4111111111111122'
        expiration:
          type: string
          description: The card expiration date with a two-digit month and two-digit year.
          example: '0329'
        cardVerificationValue:
          type: string
          description: The three- or four-digit security code printed on the credit card.
          example: '123'
          maxLength: 4
      required:
        - cardNumber
        - expiration
    CreditCardPayment:
      type: object
      description: Credit card payment details
      properties:
        card:
          $ref: '#/components/schemas/Card'
          description: The credit card information.
      required:
        - card
    EncryptedPaymentData:
      type: object
      description: Encrypted payment data fields returned by Apple
      properties:
        data:
          type: string
          description: Encrypted payment data
          example: 6b2xlM8Lh/dSF+9jBqel7A6sdh6B2NJjp6wLbt/EIijjkKAh+9ynMlS4=
        ephemeralPublicKey:
          type: string
          description: Ephermal public key bytes
          example: >-
            MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcHx3LJUWiPhwscjvmoJ694bSNITEwGBtVWdzcuwVnMURCgGhVWFyFCnmE4oiHKLdPKfsFE1MSlS6b50jqnnatA==
        publicKeyHash:
          type: string
          description: >-
            Hash of the X.509 encoded publick key bytes of the merchant's
            certificate
          example: pGfiHRVxjhNOYgELoULbS0ay6m56j1+tPI96p74gLpg=
        transactionId:
          type: string
          description: Transaction Identifier generated on the device
          example: 13baacb6feb4d9b86bcddd786ecc701a6d76158f3d04ca3dd7b020489db3cb49
        signature:
          type: string
          description: >-
            Signature of the payment and header data. The signature includes the
            signing certificate, its intermediate CA certificate, and
            information about the signing algorithm
          example: MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhk
        version:
          type: string
          description: >-
            Version information about the payment token. The token uses EC_v1
            for ECC-encrypted data and RSA_v1 for RSA-encrypted data
          enum:
            - EC_v1
            - RSA_v1
          example: EC_v1
      required:
        - data
        - ephemeralPublicKey
        - publicKeyHash
        - signature
        - transactionId
        - version
    PaymentType:
      type: object
      description: Payment account type.
      properties:
        ach:
          $ref: '#/components/schemas/AchPayment'
          description: ACH payment account details.
        creditCard:
          $ref: '#/components/schemas/CreditCardPayment'
          description: Credit card payment account details.
        applePay:
          $ref: '#/components/schemas/Applepay'
          description: Apple Pay payment account details.
    TokenizationRequest:
      type: object
      description: Tokenization request parameter
      properties:
        paymentType:
          $ref: '#/components/schemas/PaymentType'
          description: Payment account type.
        tokenGroup:
          type: string
          description: Token group name.
          example: COMPANYTG
      required:
        - paymentType
    PostTokenizationResponse:
      type: object
      description: Response for POST tokenization operation
      properties:
        responseCode:
          type: string
          description: A code that represents the outcome of the transaction
          example: '0'
        responseMessage:
          type: string
          description: >-
            A list of brief descriptions about the error encountered. If
            multiple messages need to be returned, it will be separated with ';'
            character
          example: An unexpected system error occurred. Please check with support.
        token:
          type: string
          description: Token in UUID format
          example: 85ce5afd-31b2-4612-a6ef-c1e2aba3ca71
        formatPreservedToken:
          type: string
          description: Format preserved token
          example: 3464594731bvtegfdstgv463
        bin:
          type: string
          description: Bank Identification Number
          example: '40212300'
        binLevel:
          type: string
          description: 'Only present for CC: card level like classic, platinum etc.'
          example: Classic
        category:
          type: string
          description: 'Only present for CC: credit card, debit card, cash card'
          example: Credit Card
        lastFour:
          type: string
          description: 'Only present for CC: last 4 of card number'
          example: '4444'
        binLength:
          type: integer
          format: int32
          description: 'Only present for CC: BIN length'
          example: 8
        network:
          type: string
          description: 'Only present for CC: card brand like Visa'
          example: VISA
        isoCountry:
          type: string
          description: >-
            Country code representing the country associated with the payment
            account
          example: UNITED STATES OF AMERICA (THE)
        isoCountryCode:
          type: string
          description: >-
            Country code indicating the country where the payment account's
            issuing institution is located
          example: '840'
        isInternational:
          type: boolean
          description: >-
            Flag indicating whether the payment account is considered
            international
          example: false
        tokenGroupName:
          type: string
          description: Name of the token group
          example: Credit Card Tokens
      required:
        - responseCode
    DecryptTokenRequest:
      type: object
      description: Decrypt Token Request
      properties:
        token:
          type: string
          description: Token that would be decrypted.
          example: e4eaaaf2-d142-11e1-b3e4-080027620cdd
        types:
          type: array
          description: Type of decrypted details that would be returned.
          example:
            - ACH
            - PAN
          items:
            type: string
            description: Type of decrypted details that would be returned.
            example: '["ACH","PAN"]'
      required:
        - token
    Ach:
      type: object
      description: Object for ACH (Automated Clearing House) details
      properties:
        accountNumber:
          type: string
          description: The bank account number.
          example: 459887746321Z
        routingNumber:
          type: string
          description: The bank routing number.
          example: '123456789012'
        accountType:
          type: string
          description: The type of bank account.
          enum:
            - Savings
            - Checking
          example: Savings
        tenderType:
          type: string
          description: The bank tender type.
          enum:
            - Consumer
            - Commercial
          example: Consumer
      required:
        - accountNumber
        - accountType
        - routingNumber
    AuthenticationResponse:
      type: object
      properties:
        merchantIdentifier:
          type: string
        authenticationData:
          type: string
        transactionAmount:
          type: string
    CardMetadata:
      type: object
      properties:
        longDescription:
          type: string
        cardCountry:
          type: string
        shortDescription:
          type: string
        fpanSuffix:
          type: string
    DecryptTokenResponse:
      type: object
      description: Response DTO for returning decrypted token data.
      properties:
        responseCode:
          type: string
          description: A code that represents the outcome of the transaction
          example: '0'
        responseMessage:
          type: string
          description: >-
            A list of brief descriptions about the error encountered. If
            multiple messages need to be returned, it will be separated with ';'
            character
          example: An unexpected system error occurred. Please check with support.
        token:
          type: string
          description: Token in UUID format
          example: 85ce5afd-31b2-4612-a6ef-c1e2aba3ca71
        formatPreservedToken:
          type: string
          description: Format preserved token
          example: '4927384619273842'
        cryptcard:
          type: string
          description: Direct token
          example: 4TestYx9OuN8145
        bankAccount:
          $ref: '#/components/schemas/Ach'
          description: Bank account information for ACH tokens
        creditCard:
          $ref: '#/components/schemas/Pan'
          description: Credit card information for PAN tokens
        dpan:
          $ref: '#/components/schemas/Dpan'
          description: Digital Primary Account Number (DPAN) information
        mpan:
          $ref: '#/components/schemas/Mpan'
          description: Mobile Primary Account Number (MPAN) information
        networkToken:
          $ref: '#/components/schemas/NetworkToken'
          description: Network token information
      required:
        - responseCode
    Dpan:
      type: object
      description: DPAN Response Model
      properties:
        applicationPrimaryAccountNumber:
          type: string
          description: Application Primary Account Number (DPAN)
          example: '4111111111111111'
        applicationExpirationDate:
          type: string
          description: Application expiration date
          example: '2025-12-01T00:00:00Z'
        currencyCode:
          type: string
          description: Currency code
          example: '840'
        transactionAmount:
          type: number
          description: Transaction amount
          example: 2089
        cardholderName:
          type: string
          description: Cardholder name
          example: John Doe
        deviceManufacturerIdentifier:
          type: string
          description: Device manufacturer identifier
          example: '040010030273'
        paymentDataType:
          type: string
          description: Payment data type
          example: 3DSecure
        onlinePaymentCryptogram:
          type: string
          description: Online payment cryptogram
          example: AgAAAAAAAIR8CQrXcIIBAAA=
        eciIndicator:
          type: string
          description: ECI indicator
          example: '05'
        authenticationResponses:
          type: array
          description: Authentication responses
          example:
            - merchantIdentifier: ...
              authenticationData: ...
              transactionAmount: '2000'
          items:
            $ref: '#/components/schemas/AuthenticationResponse'
        expiration:
          type: string
          description: Expiration date of the DPAN data
          example: '2025-12-01T00:00:00Z'
        digitalWallet:
          type: string
          description: Type of digital wallet
          examples:
            - ApplePay
            - GooglePay
    MerchantTokenMetadata:
      type: object
      properties:
        cardMetadata:
          $ref: '#/components/schemas/CardMetadata'
    Mpan:
      type: object
      description: MPAN Response Model
      properties:
        applicationPrimaryAccountNumber:
          type: string
          description: Application Primary Account Number (DPAN)
          example: '4111111111111111'
        applicationExpirationDate:
          type: string
          description: Application expiration date
          example: '2025-12-01T00:00:00Z'
        currencyCode:
          type: string
          description: Currency code
          example: '840'
        transactionAmount:
          type: number
          description: Transaction amount
          example: 2089
        cardholderName:
          type: string
          description: Cardholder name
          example: John Doe
        deviceManufacturerIdentifier:
          type: string
          description: Device manufacturer identifier
          example: '040010030273'
        paymentDataType:
          type: string
          description: Payment data type
          example: 3DSecure
        onlinePaymentCryptogram:
          type: string
          description: Online payment cryptogram
          example: AgAAAAAAAIR8CQrXcIIBAAA=
        eciIndicator:
          type: string
          description: ECI indicator
          example: '05'
        authenticationResponses:
          type: array
          description: Authentication responses
          example:
            - merchantIdentifier: ...
              authenticationData: ...
              transactionAmount: '2000'
          items:
            $ref: '#/components/schemas/AuthenticationResponse'
        merchantTokenIdentifier:
          type: string
          description: Merchant token identifier
          example: DNITHE302483952
        merchantTokenMetadata:
          $ref: '#/components/schemas/MerchantTokenMetadata'
          description: Merchant token metadata (JSON string)
          example:
            merchantId: '123456'
            tokenRequestorId: '40010030273'
        expiration:
          type: string
          description: Expire date of the MPAN data
          example: '0728'
        digitalWallet:
          type: string
          description: Type of digital wallet
          examples:
            - ApplePay
            - GooglePay
    NetworkToken:
      type: object
      description: Network Token Response Model
      properties:
        expiration:
          type: string
          description: Expiration date of the Network Token data
          example: '1230'
        correlationId:
          type: string
          description: >-
            A unique identifier used to correlate the tokenization request and
            response.
          example: abc123xyz-4567-8901-defg-2345hijk
        eci:
          type: string
          description: >-
            Electronic Commerce Indicator (ECI) value indicating the security
            level of the transaction.
          example: '05'
        cryptogram:
          type: string
          description: >-
            A cryptographic value generated for the transaction, used for
            authentication.
          example: AfQ1FAAAAAAAABYcV2V4AAAAAAA=
        tokenProviderId:
          type: string
          description: Identifier of the token provider that issued the network token.
          example: VISA
        networkToken:
          type: string
          description: A network token with the same length as the card number it masks
          example: '4222222222222222'
    Pan:
      type: object
      description: Response object for PAN (Primary Account Number) information
      properties:
        cardNumber:
          type: string
          description: The credit card number.
          example: '4111111111111111'
        expiration:
          type: string
          description: Expiration date of the card
          example: '1230'
        bin:
          type: string
          description: Bank Identification Number
          example: '40212300'
        category:
          type: string
          description: 'Only present for CC: credit card, debit card, cash card'
          example: Credit Card
        lastFour:
          type: string
          description: 'Only present for CC: last 4 of card number'
          example: '4444'
        binLevel:
          type: string
          description: Hierarchical level or classification of the card
          example: Platinum
        binLength:
          type: integer
          format: int32
          description: 'Only present for CC: BIN length'
          example: 8
        network:
          type: string
          description: 'Only present for CC: card brand like Visa'
          example: VISA
        isoCountry:
          type: string
          description: >-
            Country code representing the country associated with the payment
            account
          example: UNITED STATES OF AMERICA (THE)
        isoCountryCode:
          type: string
          description: >-
            Country code indicating the country where the payment account's
            issuing institution is located
          example: '840'
        isInternational:
          type: boolean
          description: >-
            Flag indicating whether the payment account is considered
            international
          example: false
      required:
        - cardNumber
    TokenResponse:
      type: object
      description: Base response for token operations
      properties:
        responseCode:
          type: string
          description: A code that represents the outcome of the transaction
          example: '0'
        responseMessage:
          type: string
          description: >-
            A list of brief descriptions about the error encountered. If
            multiple messages need to be returned, it will be separated with ';'
            character
          example: An unexpected system error occurred. Please check with support.
      required:
        - responseCode
    AchResponse:
      type: object
      description: Object for ACH (Automated Clearing House) details
      properties:
        accountNumber:
          type: string
          description: The bank account number.
          example: 459887746321Z
        routingNumber:
          type: string
          description: The bank routing number.
          example: '123456789012'
        accountType:
          type: string
          description: The type of bank account.
          enum:
            - Savings
            - Checking
          example: Savings
        tenderType:
          type: string
          description: The bank tender type.
          enum:
            - Consumer
            - Commercial
          example: Consumer
    GetTokenizationResponse:
      type: object
      description: Response object for tokenization process
      properties:
        responseCode:
          type: string
          description: A code that represents the outcome of the transaction
          example: '0'
        type:
          type: string
          description: Type of token
          examples:
            - ACH
            - PAN
            - DPAN
            - MPAN
            - NETWORK_TOKEN
        token:
          type: string
          description: Token in UUID format
          example: 85ce5afd-31b2-4612-a6ef-c1e2aba3ca71
        formatPreservedToken:
          type: string
          description: Format preserved token
        creditCard:
          $ref: '#/components/schemas/PanResponse'
          description: PAN details
        bankAccount:
          $ref: '#/components/schemas/AchResponse'
          description: ACH details
        dpan:
          $ref: '#/components/schemas/Dpan'
          description: DPAN details
        mpan:
          $ref: '#/components/schemas/Mpan'
          description: MPAN details
        responseMessage:
          type: string
          description: >-
            A list of brief descriptions about the error encountered. If
            multiple messages need to be returned, it will be separated with ';'
            character
          example: An unexpected system error occurred. Please check with support.
      required:
        - responseCode
    PanResponse:
      type: object
      description: Response object for PAN (Primary Account Number) information
      properties:
        cardNumber:
          type: string
          description: The credit card number.
          example: '4111111111111111'
        expiration:
          type: string
          description: Expiration date of the card
          example: '1230'
        bin:
          type: string
          description: Bank Identification Number
          example: '40212300'
        category:
          type: string
          description: 'Only present for CC: credit card, debit card, cash card'
          example: Credit Card
        lastFour:
          type: string
          description: 'Only present for CC: last 4 of card number'
          example: '4444'
        binLevel:
          type: string
          description: Hierarchical level or classification of the card
          example: Platinum
        binLength:
          type: integer
          format: int32
          description: 'Only present for CC: BIN length'
          example: 8
        network:
          type: string
          description: 'Only present for CC: card brand like Visa'
          example: VISA
        isoCountry:
          type: string
          description: >-
            Country code representing the country associated with the payment
            account
          example: UNITED STATES OF AMERICA (THE)
        isoCountryCode:
          type: string
          description: >-
            Country code indicating the country where the payment account's
            issuing institution is located
          example: '840'
        isInternational:
          type: boolean
          description: >-
            Flag indicating whether the payment account is considered
            international
          example: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
