swagger: '2.0'
info:
  description: Gemalto TSH Transit API - TSH to TES
  termsOfService: Copyright (c) 2018 GEMALTO. All Rights Reserved
  title: Gemalto TSH Transit API - TSH to TES
  version: 1.0.20
schemes:
  - http
  - https
basePath: /tes/transitapi/1/0
consumes:
  - application/json
produces:
  - application/json
parameters:
  actorHeader:
    description: HTTP header identifying the actor initiating the request.
    in: header
    name: x-actor-id
    type: string
    required: true
    maxLength: 32
paths:
  /createCardAccount:
    post:
      summary: Request to create a digital card account
      description: 'This method is used by TSH to request the creation of a digital card account to the TES.</br> This request can come with a payment order which comprises a payment instrument and either the identifier of wallet card used or the wallet account used for the payment</br> In this case, the TES is responsible for returning an order confirmation in the form of a purchase identifier in all cases where the user may be deducted money.</br> The TES shall also create a new card account associated to a unique identifier. In case of stored value account, the card account identifier shall be the card iedntifier.'
      operationId: createCardAccount
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/actorHeader'
        - name: body
          in: body
          description: createCardAccount request payload
          required: true
          schema:
            $ref: '#/definitions/createCardAccountReq'
      responses:
        '200':
          description: createCardAccount response payload
          schema:
            $ref: '#/definitions/createCardAccountRes'
        '500':
          description: Internal Server Error
  /checkCardAccount:
    post:
      summary: Request to check digital card account eligibility
      description: This method is used by TSH to check that a card account is eligible for provisioning.
      operationId: checkCardAccount
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/actorHeader'
        - name: body
          in: body
          description: checkCardAccount request payload
          required: true
          schema:
            $ref: '#/definitions/checkCardAccountReq'
      responses:
        '200':
          description: checkCardAccount response payload
          schema:
            $ref: '#/definitions/checkCardAccountRes'
        '500':
          description: Internal Server Error
  /provisionCard:
    post:
      summary: Request to provision a digital card
      description: This method is used by TSH to provision a digital card to user's device.
      operationId: provisionCard
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/actorHeader'
        - name: body
          in: body
          description: provisionCard request payload
          required: true
          schema:
            $ref: '#/definitions/provisionCardReq'
      responses:
        '200':
          description: provisionCard response payload
          schema:
            $ref: '#/definitions/provisionCardRes'
        '500':
          description: Internal Server Error
  /notifyOperationResult:
    post:
      summary: Operation result notification.
      description: This method is used by TSH to notify the result of an operation identified by a sessionId.</br> It can be the result of a provisioning or a state update.
      operationId: notifyOperationResult
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/actorHeader'
        - name: body
          in: body
          description: notifyOperationResult request payload
          required: true
          schema:
            $ref: '#/definitions/notifyOperationResultReq'
      responses:
        '200':
          description: notifyOperationResult response payload
          schema:
            $ref: '#/definitions/notifyOperationResultRes'
        '500':
          description: Internal Server Error
  /topUpCardAccount:
    post:
      summary: Request to top up a digital card account
      description: 'This method is used by TSH to request the top up of a card account to the TES.</br> This request can come with a payment order which comprises a payment instrument.</br> It is initiated from OEM Wallet.</br> In this case, the TES is responsible for returning an order confirmation in the form of a purchase identifier in all cases where the user may be deducted money.'
      operationId: topUpCardAccount
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/actorHeader'
        - name: body
          in: body
          description: topUpCardAccount request payload
          required: true
          schema:
            $ref: '#/definitions/topUpCardAccountReq'
      responses:
        '200':
          description: topUpCardAccount response payload
          schema:
            $ref: '#/definitions/topUpCardAccountRes'
        '500':
          description: Internal Server Error
  /updateCardState:
    post:
      summary: Request to update digital card state
      description: This method is used by TSH to indicate the update of a digital card to the TES.</br>         It is usually initiated from OEM Wallet.
      operationId: updateCardState
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/actorHeader'
        - name: body
          in: body
          description: updateCardState request payload
          required: true
          schema:
            $ref: '#/definitions/updateCardStateReq'
      responses:
        '200':
          description: updateCardState response payload
          schema:
            $ref: '#/definitions/updateCardStateRes'
        '500':
          description: Internal Server Error
  /getCardAccountsMetadata:
    post:
      summary: Request to get the metadata of card accounts for the given list of card account IDs
      description: This method is used by TSH to request TES to return the metadata of card accounts for the given list of card account IDs.
      operationId: getCards
      produces:
        - application/json
      parameters:
        - name: body
          in: body
          description: getCardAccountsMetadata request payload
          required: true
          schema:
            $ref: '#/definitions/getCardAccountsMetadataReq'
      responses:
        '200':
          description: getCardAccountsMetadata response payload
          schema:
            $ref: '#/definitions/getCardAccountsMetadataRes'
        '500':
          description: Internal Server Error
  /getCardActions:
    post:
      summary: Request to get the list of available actions for the given card
      description: This method is used by TSH to request TES to return the list of available actions for a given card.
      operationId: getCardActions
      produces:
        - application/json
      parameters:
        - name: body
          in: body
          description: getCardActions request payload
          required: true
          schema:
            $ref: '#/definitions/getCardActionsReq'
      responses:
        '200':
          description: getCardActions response payload
          schema:
            $ref: '#/definitions/getCardActionsRes'
        '500':
          description: Internal Server Error
  /getAsset:
    post:
      summary: Request to get asset from TES
      description: This method is used by TSH to request asset to TES
      operationId: getAsset
      produces:
        - application/json
      parameters:
        - name: body
          in: body
          description: getAsset request payload
          required: true
          schema:
            $ref: '#/definitions/getAssetReq'
      responses:
        '200':
          description: getAsset response payload
          schema:
            $ref: '#/definitions/getAssetRes'
        '500':
          description: Internal Server Error
definitions:
  createCardAccountReq:
    type: object
    required:
      - requestHeader
      - issuerId
      - walletProviderId
      - productId
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      walletProviderId:
        $ref: '#/definitions/walletProviderId'
      productId:
        $ref: '#/definitions/productId'
      order:
        $ref: '#/definitions/order'
      opaqueServiceProviderData:
        $ref: '#/definitions/opaqueServiceProviderData'
  createCardAccountRes:
    type: object
    required:
      - responseHeader
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      cardAccountId:
        $ref: '#/definitions/cardAccountId'
      purchaseId:
        $ref: '#/definitions/purchaseId'
      signature:
        $ref: '#/definitions/signature'
  checkCardAccountReq:
    type: object
    required:
      - requestHeader
      - issuerId
      - cardAccountId
      - walletProviderId
      - device
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      cardAccountId:
        $ref: '#/definitions/cardAccountId'
      walletProviderId:
        $ref: '#/definitions/walletProviderId'
      device:
        $ref: '#/definitions/device'
      cardSource:
        $ref: '#/definitions/cardSource'
  checkCardAccountRes:
    type: object
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      productId:
        $ref: '#/definitions/productId'
      cardArtManifest:
        $ref: '#/definitions/cardArtManifest'
      mobileApplicationInfo:
        type: object
        description: |-
          Mobile application details to be used for the 'cardAccountId'

          If this parameter is not specified, TSH will pick default mobile application details linked to issuerId.
        properties:
          associatedApplicationIdentifiers:
            type: array
            description: |-
              List of mobile applications that can have access to the card provisioned.

              First item of the list will be the one displayed in the card metadata.
            items:
              type: string
            minItems: 1
          appLaunchURL:
            type: string
            description: URL to be passed to the associated app when launching it from the linked app section.
        required:
          - associatedApplicationIdentifiers
    required:
      - responseHeader
  provisionCardReq:
    type: object
    required:
      - requestHeader
      - issuerId
      - cardAccountId
      - walletCardId
      - walletCardAccountId
      - walletAccountId
      - device
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      cardAccountId:
        $ref: '#/definitions/cardAccountId'
      walletCardId:
        $ref: '#/definitions/walletCardId'
      walletCardAccountId:
        $ref: '#/definitions/walletCardAccountId'
      walletAccountId:
        $ref: '#/definitions/walletAccountId'
      device:
        $ref: '#/definitions/device'
      walletScoring:
        $ref: '#/definitions/walletScoring'
      customerData:
        $ref: '#/definitions/customerData'
      cardLastDigits:
        $ref: '#/definitions/cardLastDigits'
  provisionCardRes:
    type: object
    required:
      - responseHeader
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      cardId:
        $ref: '#/definitions/cardId'
      displayCardNumber:
        $ref: '#/definitions/displayCardNumber'
      cardholderName:
        $ref: '#/definitions/cardholderName'
      cardData:
        $ref: '#/definitions/cardData'
      cardArtManifest:
        $ref: '#/definitions/cardArtManifest'
  notifyOperationResultReq:
    type: object
    required:
      - requestHeader
      - isProvisioning
      - issuerId
      - statusCode
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      purchaseId:
        $ref: '#/definitions/purchaseId'
      cardAccountId:
        $ref: '#/definitions/cardAccountId'
      cardId:
        $ref: '#/definitions/cardId'
      isProvisioning:
        type: boolean
        description: Flag indicating whether this notification is about provisioning or not.
      resultData:
        $ref: '#/definitions/resultData'
      statusCode:
        type: number
        description: The status code.
      statusMsg:
        type: string
        description: Optional additional status message
  notifyOperationResultRes:
    type: object
    required:
      - responseHeader
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
  topUpCardAccountReq:
    type: object
    required:
      - requestHeader
      - issuerId
      - cardAccountId
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      cardAccountId:
        $ref: '#/definitions/cardAccountId'
      order:
        $ref: '#/definitions/order'
      opaqueServiceProviderData:
        $ref: '#/definitions/opaqueServiceProviderData'
  topUpCardAccountRes:
    type: object
    required:
      - responseHeader
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      purchaseId:
        $ref: '#/definitions/purchaseId'
      signature:
        $ref: '#/definitions/signature'
  updateCardStateReq:
    type: object
    required:
      - requestHeader
      - issuerId
      - cardId
      - newState
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      cardId:
        $ref: '#/definitions/cardId'
      newState:
        $ref: '#/definitions/newState'
  updateCardStateRes:
    type: object
    required:
      - responseHeader
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
  getCardAccountsMetadataReq:
    type: object
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      cardAccountIds:
        type: array
        description: The list of card account identifiers
        items:
          $ref: '#/definitions/cardAccountId'
    required:
      - requestHeader
      - issuerId
      - cardAccountIds
  getCardAccountsMetadataRes:
    type: object
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      cardAccounts:
        type: array
        items:
          type: object
          properties:
            cardAccountId:
              $ref: '#/definitions/cardAccountId'
            cardAccountState:
              type: string
              maxLength: 32
              description: |
                The current card account state.<br/>Possible values are:
                |state|description|
                |---|---|
                |ACTIVE|Valid card account, can be recovered|
                |CANCELLED|Card account is disabled/refunded|
                |UNKNOWN|Card account is temporarily unavailable. For example park is in progress|
            productsList:
              description: List of products of the card account
              type: array
              items:
                type: object
                properties:
                  identifier:
                    description: Unique product identifier
                    type: string
                    maxLength: 512
                  value:
                    type: number
                    description: 'Last known numeric value of the product, if any'
                  lastUpdatedDate:
                    type: string
                    description: If applicable the date the value was last updated in ISO 8601 date time format.
                    format: date-time
                  validFromDate:
                    type: string
                    description: 'If applicable the date the product use is valid from (inclusive), in ISO 8601 date time format.'
                    format: date-time
                  validUntilDate:
                    type: string
                    description: 'If applicable the date the product use is valid until (inclusive), in ISO 8601 date time format.'
                    format: date-time
                required:
                  - identifier
          required:
            - cardAccountId
            - cardAccountState
    required:
      - responseHeader
  getCardActionsReq:
    type: object
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      issuerId:
        $ref: '#/definitions/issuerId'
      cardId:
        $ref: '#/definitions/cardId'
      appletData:
        type: string
        maxLength: 8192
        description: 'Data from device representing card image, for filtering allowed actions.<br/>Base64 encoded string.'
        minLength: 1
      associatedPlanIdentifier:
        type: string
        description: 'Identifier for the plan to retrieve actions for.<br/>If not present, all valid actions shall be returned.'
        maxLength: 64
        minLength: 1
    required:
      - requestHeader
      - issuerId
      - cardId
  getCardActionsRes:
    type: object
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      cardActions:
        type: array
        items:
          type: object
          properties:
            identifier:
              description: A unique identifier of the purchase action
              type: string
              maxLength: 512
            planIdentifier:
              description: A unique identifier of the commute plan
              type: string
              maxLength: 512
            title:
              type: array
              description: 'array of objects containing language and label and/or value (at least one of the two shall be provided).<br/>If provided, label and/or value will replace the predefined values statically configured in the platform.<br/>Each item shall be provided with a different language for localization'
              maxItems: 10
              items:
                type: object
                required:
                  - language
                properties:
                  label:
                    description: 'Commute plan title label.</br> Examples:<li>Golden Weekly Pass'
                    type: string
                    minLength: 1
                    maxLength: 64
                  value:
                    description: 'Commute plan extra details.</br> Examples:<li>Activate after tap'
                    type: string
                    minLength: 1
                    maxLength: 64
                  language:
                    type: string
                    description: 'Text language as defined by BCP 47 standard.</br> Examples:<li>en-US<li>zh-CN'
                    maxLength: 16
                    minLength: 1
            amount:
              description: purchase amount
              type: number
              format: double
            currency:
              $ref: '#/definitions/currency'
            startDate:
              description: 'Start date of the plan.<br/>RFC3339 format. Example 2018-12-24T17:32:28Z'
              type: string
              format: date-time
            expirationDate:
              description: 'Expiration date of the plan.<br/>RFC3339 format. Example 2018-12-24T17:32:28Z'
              type: string
              format: date-time
          required:
            - identifier
            - planIdentifier
            - amount
            - currency
      validUntil:
        description: 'Configuration valid until the specified time.<br/>RFC3339 format. Example 2018-12-24T17:32:28Z'
        type: string
        format: date-time
    required:
      - responseHeader
      - cardActions
  getAssetReq:
    type: object
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      assetId:
        type: string
        maxLength: 64
        description: Unique identifier of the asset
    required:
      - requestHeader
      - assetId
  getAssetRes:
    type: object
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      contentType:
        type: string
        maxLength: 32
        description: 'The asset type.<br/>Possible values are:<li>icon<li>cardBackgroundCombined'
      content:
        type: array
        description: 'The asset''s data.<br />For PNG images, this list can contain several resolutions for the same asset.'
        items:
          type: object
          required:
            - mimeType
            - encodedData
          properties:
            mimeType:
              type: string
              maxLength: 32
              description: 'File type of encoded image.<br/>Possible values are:<li>image/pdf<li>image/png<li>image/svg'
            encodedData:
              type: string
              description: Base64 encoded asset data
            width:
              type: number
              description: Width of the asset. Required for PNG images.
            height:
              type: number
              description: Height of the asset. Required for PNG images.
    required:
      - responseHeader
      - contentType
      - content
  cardId:
    maxLength: 48
    minLength: 1
    type: string
    description: The Card Identifier. Unique for each card.
  cardLastDigits:
    maxLength: 5
    minLength: 4
    type: string
    description: The Card last 4 or 5 digits.
  customerData:
    type: object
    properties:
      dateOfBirth:
        description: Customer date of birth.</br> Date provided in 'YYYY-MM-DD' format as specified in RFC 3339
        type: string
        format: date
      customerId:
        description: Customer identifier
        type: string
        minLength: 1
        maxLength: 32
  displayCardNumber:
    minLength: 1
    maxLength: 16
    type: string
    description: 'The card number to be displayed on the wallet.<br/>If it''s not provided, the last 16 characters of cardAccountId will be used.'
  cardholderName:
    type: array
    maxItems: 10
    items:
      type: object
      required:
        - value
        - language
      properties:
        value:
          description: The card holder to be displayed on the wallet.
          minLength: 1
          maxLength: 128
          type: string
        language:
          type: string
          description: 'Text language as defined by BCP 47 standard.</br> Examples:<li>en-US<li>zh-CN'
          maxLength: 16
          minLength: 1
  signature:
    type: string
    minLength: 1
    maxLength: 1024
    description: Signature covering the concatenation of the UTF-8 encoded bytes of orderId followed by purchaseId.</br> It is a ECDSA signature in PKCS7 format.
  walletCardId:
    maxLength: 64
    minLength: 1
    type: string
    description: The Wallet Card Identifier. Unique for each wallet card.
  cardAccountId:
    maxLength: 48
    minLength: 1
    type: string
    description: The Card Account Identifier. Unique for each card account.
  walletCardAccountId:
    maxLength: 64
    minLength: 1
    type: string
    description: The Wallet Card Account Identifier. Unique for each wallet card account.
  walletAccountId:
    maxLength: 128
    minLength: 1
    type: string
    description: The Wallet Account Identifier. Unique for each wallet account.
  productId:
    maxLength: 16
    minLength: 1
    type: string
    description: The Product Identifier. Unique for each product.</br> It is used by TSH to find the right metadata (e.g. card arts) associated to the product.
  cardArtManifest:
    type: array
    description: |-
      Array of asset identifiers required to build
      card arts.
      Both cardBackground and icon asset identifiers shall be provided.

      Asset identifier can be up to 64 characters.

      If this parameter is not specified, TSH will pick default assets linked to productId.<br/>
      Otherwise the specified assets will be retrieved using the getAsset API
    items:
      type: string
    minItems: 2
  device:
    type: object
    required:
      - deviceId
      - deviceType
      - language
    properties:
      deviceId:
        $ref: '#/definitions/deviceId'
      deviceType:
        $ref: '#/definitions/deviceType'
      language:
        $ref: '#/definitions/language'
      phoneNumberLastDigits:
        $ref: '#/definitions/phoneNumberLastDigits'
      deviceName:
        $ref: '#/definitions/deviceName'
  walletScoring:
    type: object
    required:
      - color
    properties:
      color:
        type: string
        enum:
          - GREEN
          - YELLOW
          - ORANGE
      deviceScore:
        type: number
        minimum: 1
        maximum: 5
        description: |
          |Score|Description|
          |-------|-------|
          |5|Long history of activity; No suspicious activity|
          |4|Short history of activity; No suspicious activity|
          |3|Little or No history|
          |2|Irregular activity noted|
          |1|Improper activity noted|
      accountScore:
        type: number
        minimum: 1
        maximum: 5
        description: |
          |Score|Description|
          |-------|-------|
          |5|Long history of activity; No suspicious activity|
          |4|Short history of activity; No suspicious activity|
          |3|Little or No history|
          |2|Irregular activity noted|
          |1|Improper activity noted|
      phoneNumberScore:
        type: number
        minimum: 1
        maximum: 5
        description: |
          |Score|Description|
          |-------|-------|
          |5|Long history of activity; No suspicious activity|
          |4|Short history of activity; No suspicious activity|
          |3|Little or No history|
          |2|Irregular activity noted|
          |1|Improper activity noted|
      reasonCodes:
        type: array
        maxItems: 100
        description: List of reasons
        items:
          type: string
          minLength: 2
          maxLength: 2
          description: |
            |reasonCode|Description|
            |-------|-------|
            |01|User Wallet Account ID too new relative to launch|
            |02|User Wallet Account ID too new relative to provisioning request|
            |03|User Wallet Account ID/Card Pair is newer than date threshold|
            |04|Changes made to account data within date threshold|
            |05|Suspicious transactions linked to this account.|
            |06|The Account has not had activity in the last year.|
            |07|Suspended cards in the secure element|
            |08|The device was put in lost mode in the last 7 days for longer than the duration threshold|
            |09|The number of provisioning attempts on this device in 72 hours exceeds the threshold|
            |0A|There have been more than the threshold number of different cards attempted at provisioning to this phone in 24 hours.|
            |0B|The card provisioning request contains a distinct name in excess of the permitted threshold|
            |0C|Device Score is less than 3|
            |0D|Device Score is less than 4|
            |0E|Device provisioning location outside of OEM marketplace store home country|
            |0F|Model rules not available at this time (in cases where back end systems time out).|
            |0G|Orange path flag|
            |0H|Phone Number Score is less than 3|
  cardSource:
    type: string
    enum:
      - ON-FILE
      - CLIENT-SDK
      - USER-INPUT
      - READER-MODE
      - UNKNOWN
  deviceId:
    maxLength: 48
    minLength: 1
    type: string
    description: Device unique identifier
  deviceType:
    type: string
    enum:
      - PHONE
      - TABLET
      - WATCH
      - UNKNOWN
  language:
    type: string
    minLength: 3
    maxLength: 3
    description: ISO 639-3 three-letter language codes
  cardData:
    type: object
    properties:
      balanceAmount:
        $ref: '#/definitions/balanceAmount'
  balanceAmount:
    type: number
    format: double
    description: The current balance amount of the card
  deviceName:
    type: string
    minLength: 1
    maxLength: 128
    description: Device name that the device owner may use to identify it
  phoneNumberLastDigits:
    type: string
    minLength: 1
    maxLength: 5
    description: Last digit of the phone number (usually 4 or 5)
  order:
    type: object
    required:
      - orderId
      - amount
      - currency
      - paymentInstrument
    properties:
      orderId:
        $ref: '#/definitions/orderId'
      amount:
        $ref: '#/definitions/amount'
      currency:
        $ref: '#/definitions/currency'
      paymentInstrument:
        $ref: '#/definitions/paymentInstrument'
  resultData:
    type: object
    description: "This object gives additional information about the operation result.</br> For Calypso, the following will be provided:\n```\n\"resultData\": {\n\t\"csn\" : \"1122334455667788\"        \n}\n```\nFor EMV, the following will be provided:\n```\n\"resultData\": {\n\t\"pan\" : \"$encrypted_value\"        \n}\n```"
  opaqueServiceProviderData:
    type: object
    description: This object gives additional service provider data captured by the wallet provider during a payment.</br>The structure of this object is opaque to TSH.
  purchaseId:
    maxLength: 64
    minLength: 1
    type: string
    description: ''
  orderId:
    maxLength: 64
    minLength: 1
    type: string
    description: The Order Identifier. Unique for each order.</br> It is generated by the wallet SDK provider.
  amount:
    type: number
    format: float
    description: The amount of the purchase order.
  currency:
    type: string
    maxLength: 3
    minLength: 3
    description: The currency specified as 3 letters code (ISO4217)
  paymentInstrument:
    type: object
    description: payment instrument
    required:
      - paymentData
      - type
      - version
      - signature
      - header
    properties:
      paymentData:
        type: string
        maxLength: 8192
        minLength: 1
        description: 'The payment instrument parameter contains the base64 representation of the payment instrument/crendial to be used by the PSP to authorize the payment.</br> The base64 format is specific to the type of payment instrument (e.g. Apple Pay In-App cryptogram).</br> The Apple Pay in-app cryptogram can be found in : https://developer.apple.com/library/archive/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.html'
      type:
        type: string
        enum:
          - IN-APP_CRYPTO
        description: The type of payment instrument used for the purchase order.</br> Only IN-APP_CRYPTO is supported in this version.
      version:
        type: string
        description: 'Version information about the payment token.</br> The token uses EC_v1 for ECC-encrypted data, and RSA_v1 for RSA-encrypted data.'
        enum:
          - EC_v1
          - RSA_v1
      signature:
        type: string
        description: 'detached PKCS7 signature, Base64 encoded as string.</br> The signature includes the signing certificate, its intermediate CA certificate, and information about the signing algorithm.'
        maxLength: 8192
        minLength: 1
      header:
        type: object
        description: 'Contains the ephemeralPublicKey/wrappedKey, transactionId, and publicKeyHash.</br> These values are required in order to locate the right Private Key in order to decrypt the payment data'
        required:
          - transactionId
          - publicKeyHash
        properties:
          ephemeralPublicKey:
            type: string
            description: ephemeral public key used for EC_v1 only
            maxLength: 1536
            minLength: 1
          wrappedKey:
            type: string
            description: encrypted symmetric key used for RSA_v1 only
            maxLength: 1536
            minLength: 1
          transactionId:
            type: string
            maxLength: 128
            minLength: 1
          publicKeyHash:
            type: string
            maxLength: 512
            minLength: 1
  walletProviderId:
    type: string
    description: 'The Wallet Provider Identifier.<br/>For example:<li>APPLE_PAY<li>HUAWEI_PAY<li>XIAOMI_PAY'
  newState:
    type: string
    description: The new state to apply on the card
    enum:
      - DELETED
      - SUSPENDED_WALLET
      - SUSPENDED_ISSUER
      - ACTIVE
      - UNLINKED
  issuerId:
    maxLength: 16
    minLength: 1
    type: string
    description: The Card Issuer Identifier. Unique for each card issuer.
  requestId:
    description: Unique request identifier
    maxLength: 48
    minLength: 1
    type: string
  responseId:
    description: Unique response identifier
    maxLength: 48
    minLength: 1
    type: string
  sessionId:
    description: Unique session identifier used to trace the calls across systems during a use case.
    maxLength: 48
    minLength: 1
    type: string
  generationDateTime:
    description: 'Date time representing when the request or response has been generated.<br/>RFC3339 format.<br/> Examples:<li>"2018-12-24T17:32:28Z"<li>"2019-10-02T10:00:00-05:00"'
    type: string
    format: date-time
  requestHeader:
    type: object
    required:
      - requestId
      - sessionId
    properties:
      requestId:
        $ref: '#/definitions/requestId'
      sessionId:
        $ref: '#/definitions/sessionId'
      generationDateTime:
        $ref: '#/definitions/generationDateTime'
  responseHeader:
    type: object
    required:
      - responseId
      - sessionId
      - statusCode
    properties:
      responseId:
        $ref: '#/definitions/responseId'
      sessionId:
        $ref: '#/definitions/sessionId'
      generationDateTime:
        $ref: '#/definitions/generationDateTime'
      statusCode:
        type: number
        description: |
          Status code to the request
          |Status code | Description|
          |-------|-------|
          |0|OK|
          |111|Missing mandatory parameter|
          |112|Bad parameter format|
          |113|Unknown issuer|
          |116|Unknown card account|
          |117|Unknown device|
          |118|Unknown session|
          |119|Unknown virtual card|          
          |120|Unknown purchase|  
          |159|Card is blacklisted|
          |160|Card is deleted|          
          |162|Card has unsufficient balance|
          |163|Card product not eligible|    
          |164|Provisioning count exceeded|    
          |166|Invalid card information|
          |167|Card is already provisioned|
          |169|Purchase order declined|
          |170|Provisioning request declined|
          |171|Wallet account mismatch.<br/>The wallet account is already associated<br/>with a card under different customer name|          
          |221|Device or wallet server not accessible|
          |231|Device unexpected error|
          |232|Device out of memory error|
          |321|Operation already on-going for this device|
          |322|Time to live of the operation expired|                               
          |419|PIN required|   
          |420|PIN incorrect|   
          |421|PIN locked|   
          |431|Invalid perso data|
          |432|Operation is not allowed with current card state|  
          |911|Operation failed|          
          |921|Unexpected server error|
      statusMessage:
        type: string
        description: Textual status message
