info:
  contact:
    name: vincent.lemonnier@thalesgroup.com
  description: |
    Outgoing requests to TSP

    Copyright (c) 2020 Thales. All Rights Reserved
  title: TSH Token Requestor Outgoing API
  version: 2.2.2
  x-gitbook-description-document:
    object: document
    data:
      schemaVersion: 9
    nodes:
      - object: block
        type: paragraph
        isVoid: false
        data: {}
        nodes:
          - object: text
            leaves:
              - object: leaf
                text: Outgoing requests to TSP
                marks: []
            key: NS5UATp48qWu
        key: yN6BobJjrma0
      - object: block
        type: paragraph
        isVoid: false
        data: {}
        nodes:
          - object: text
            leaves:
              - object: leaf
                text: Copyright (c) 2020 Thales. All Rights Reserved
                marks: []
            key: SxBicGLFVtRt
        key: 5IzvMpyC8JOg
    key: ShXEHsxAxuSL
  x-gitbook-description-html: >-
    <p>Outgoing requests to TSP</p><p>Copyright (c) 2020 Thales. All Rights
    Reserved</p>
schemes:
  - https
paths:
  /tokens:
    post:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: POST /tokens
      description: This method is used by TSH to request the creation of a new token.
      operationId: createToken
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
      responses:
        '200':
          description: createToken response payload
          examples:
            application/json:
              tokenId: 8ec6d4eada0c
              tokenInfo:
                exp: '1220'
                last4: '1234'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createTokenRes'
          x-gitbook-description-html: <p>createToken response payload</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            115, 163, 164, 166, 167, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            115, 163, 164, 166, 167, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Create Token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createTokenReq'
        description: createToken request payload
        required: true
        x-gitbook-description-html: <p>createToken request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to request the creation of a
                      new token.
                    marks: []
                key: IDy6p38EGk8F
            key: H7DRIynLRWYp
        key: jzwsmLJW0iLW
      x-gitbook-description-html: >-
        <p>This method is used by TSH to request the creation of a new
        token.</p>
  /tokens/{tokenId}/cardInfo:
    put:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: PUT /tokens/{tokenId}/cardInfo
      description: >-
        This method is used by TSH to request the update of funding pan
        information of the token
      operationId: updateToken
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            119, 163, 166, 432, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            119, 163, 166, 432, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Update Card Data
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateTokenReq'
        description: updateToken request payload
        required: true
        x-gitbook-description-html: <p>updateToken request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to request the update of
                      funding pan information of the token
                    marks: []
                key: km7TbRvhzD6G
            key: uls8ZY4X7kYP
        key: oiEzGCQlPIyu
      x-gitbook-description-html: >-
        <p>This method is used by TSH to request the update of funding pan
        information of the token</p>
  /tokens/{tokenId}/state:
    put:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: PUT /tokens/{tokenId}/state
      description: This method is used by TSH to request the update of token state
      operationId: updateTokenState
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            119, 432, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            119, 432, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Update Token State
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateTokenStateReq'
        description: updateTokenState request payload
        required: true
        x-gitbook-description-html: <p>updateTokenState request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to request the update of token
                      state
                    marks: []
                key: LtjGX0VUHewM
            key: BqqndDjwrHOj
        key: snZsB5xFS49a
      x-gitbook-description-html: <p>This method is used by TSH to request the update of token state</p>
  /tokens/{tokenId}/replenishment:
    post:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: POST /tokens/{tokenId}/replenishment
      description: >-
        This method is used by TSH, in case of HCE, to request replenishment of
        payment credentials in the mobile wallet.<br/>

        This API only applies to TSH Pay solution (Issuer HCE wallet).
      operationId: requestReplenishment
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      responses:
        '200':
          description: requestReplenishment response payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/requestReplenishmentRes'
          x-gitbook-description-html: <p>requestReplenishment response payload</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 119,
            432, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 119,
            432, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Request Replenishment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestReplenishmentReq'
        description: requestReplenishment request payload
        required: true
        x-gitbook-description-html: <p>requestReplenishment request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH, in case of HCE, to request
                      replenishment of payment credentials in the mobile wallet.

                      This API only applies to TSH Pay solution (Issuer HCE
                      wallet).
                    marks: []
                key: Irs0SvsDmvT0
            key: YVqiTBxwNnb8
        key: ZeSatybzwKfk
      x-gitbook-description-html: >-
        <p>This method is used by TSH, in case of HCE, to request replenishment
        of payment credentials in the mobile wallet.<br>This API only applies to
        TSH Pay solution (Issuer HCE wallet).</p>
  /tokens/{tokenId}/replenishment/status:
    put:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: PUT /tokens/{tokenId}/replenishment/status
      description: >
        This method is used by TSH, in case of HCE, to notify the TSP the
        replenishment of payment credentials has been completed in the mobile
        wallet.<br/>

        This API only applies to TSH Pay solution (Issuer HCE wallet).
      operationId: replenishmentDone
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 119,
            432, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 119,
            432, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Notify Replenishment Result
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/replenishmentDoneReq'
        description: replenishmentDone request payload
        required: true
        x-gitbook-description-html: <p>replenishmentDone request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH, in case of HCE, to notify the
                      TSP the replenishment of payment credentials has been
                      completed in the mobile wallet.

                      This API only applies to TSH Pay solution (Issuer HCE
                      wallet).
                    marks: []
                key: 6rlcSaWvB4el
            key: TEYZ0F4R9AcG
        key: WngG01l6cW2Q
      x-gitbook-description-html: >-
        <p>This method is used by TSH, in case of HCE, to notify the TSP the
        replenishment of payment credentials has been completed in the mobile
        wallet.<br>This API only applies to TSH Pay solution (Issuer HCE
        wallet).</p>
  /tokens/{tokenId}/newData/status:
    put:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: PUT /tokens/{tokenId}/newData/status
      description: >
        This method is used by TSH to inform the TSP about the token
        re-personalization result in case of token renewal.
      operationId: submitNewTokenDataStatus
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            119, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            119, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Notify Token Reperso Result
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/submitNewTokenDataStatus'
        description: submitNewTokenDataStatus request payload
        required: true
        x-gitbook-description-html: <p>submitNewTokenDataStatus request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to inform the TSP about the
                      token re-personalization result in case of token renewal.
                    marks: []
                key: ynG5ARnoeDQC
            key: deBgGoPVJ6mF
        key: PWms2esGeDCe
      x-gitbook-description-html: >-
        <p>This method is used by TSH to inform the TSP about the token
        re-personalization result in case of token renewal.</p>
  /healthCheck:
    get:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: GET /healthCheck
      description: >-
        This method is used by TSH to monitor TSP health. It should be used
        every 30 seconds in production environment.
      operationId: healthCheck
      parameters:
        - $ref: '#/components/parameters/x-request-id-header'
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 911,
            921
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 911,
            921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Healthcheck
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to monitor TSP health. It
                      should be used every 30 seconds in production environment.
                    marks: []
                key: uyDBP8pMXxiM
            key: SGpKsNAQCxDA
        key: 0dAeViRgLINf
      x-gitbook-description-html: >-
        <p>This method is used by TSH to monitor TSP health. It should be used
        every 30 seconds in production environment.</p>
  /tokens/{tokenId}/reperso:
    post:
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            119, 321, 432, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            119, 321, 432, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      description: >-
        This request is triggered when TSH has to repersonalize a token and
        requires all the data elements associated.


        After this request, TSP shall recover all the existing elements and
        submit it to the TSH through [Submit New Token
        Data](https://next.stoplight.io/gdigital/tsh-token-requestor-tsp-api/version%2F1.0/tsh-tr-tsp-api-incoming.oas2.yml?view=%2Fsubmit-new-token-data%2Fsubmitnewtokendata).


        TSH will callback TSP through the [Notify Token Reperso
        Result](https://next.stoplight.io/gdigital/tsh-token-requestor-tsp-api/version%2F1.0/tsh-tr-tsp-api-outgoing.oas2.yml?view=%2Fnotify-token-reperso-result%2Fsubmitnewtokendatastatus)
        to notify the profile has been pushed to the device with success. At
        this moment, TSP shall set the ATC to zero to sync with the ATC
        personalized in the device.
      summary: POST /tokens/{tokenId}/reperso
      operationId: repersoToken
      tags:
        - Reperso Token
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/repersoTokenReq'
        description: repersoToken body request
        x-gitbook-description-html: <p>repersoToken body request</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This request is triggered when TSH has to repersonalize a
                      token and requires all the data elements associated.
                    marks: []
                key: K8mWmrbRBnTm
            key: ygDvAvY3Chog
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      After this request, TSP shall recover all the existing
                      elements and submit it to the TSH through 
                    marks: []
                key: SvnrKKIi2jNt
              - object: inline
                type: link
                isVoid: false
                data:
                  ref:
                    kind: url
                    url: >-
                      https://next.stoplight.io/gdigital/tsh-token-requestor-tsp-api/version%2F1.0/tsh-tr-tsp-api-incoming.oas2.yml?view=%2Fsubmit-new-token-data%2Fsubmitnewtokendata
                nodes:
                  - object: text
                    leaves:
                      - object: leaf
                        text: Submit New Token Data
                        marks: []
                    key: prGmkegp2Aad
                key: HsSL1gwoF81j
              - object: text
                leaves:
                  - object: leaf
                    text: .
                    marks: []
                key: 8mEfjQEczlXl
            key: qWjbAc4No5to
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: 'TSH will callback TSP through the '
                    marks: []
                key: aP51csowY340
              - object: inline
                type: link
                isVoid: false
                data:
                  ref:
                    kind: url
                    url: >-
                      https://next.stoplight.io/gdigital/tsh-token-requestor-tsp-api/version%2F1.0/tsh-tr-tsp-api-outgoing.oas2.yml?view=%2Fnotify-token-reperso-result%2Fsubmitnewtokendatastatus
                nodes:
                  - object: text
                    leaves:
                      - object: leaf
                        text: Notify Token Reperso Result
                        marks: []
                    key: jU6IPBvZDq23
                key: 4TjTZC9MujZB
              - object: text
                leaves:
                  - object: leaf
                    text: ' to notify the profile has been pushed to the device with success. At this moment, TSP shall set the ATC to zero to sync with the ATC personalized in the device.'
                    marks: []
                key: 1w9q5YNesQ17
            key: bfLlTVlzqAJP
        key: pwwAhXEcnenm
      x-gitbook-description-html: >-
        <p>This request is triggered when TSH has to repersonalize a token and
        requires all the data elements associated.</p><p>After this request, TSP
        shall recover all the existing elements and submit it to the TSH through
        <a
        href="https://next.stoplight.io/gdigital/tsh-token-requestor-tsp-api/version%2F1.0/tsh-tr-tsp-api-incoming.oas2.yml?view=%2Fsubmit-new-token-data%2Fsubmitnewtokendata">Submit
        New Token Data</a>.</p><p>TSH will callback TSP through the <a
        href="https://next.stoplight.io/gdigital/tsh-token-requestor-tsp-api/version%2F1.0/tsh-tr-tsp-api-outgoing.oas2.yml?view=%2Fnotify-token-reperso-result%2Fsubmitnewtokendatastatus">Notify
        Token Reperso Result</a> to notify the profile has been pushed to the
        device with success. At this moment, TSP shall set the ATC to zero to
        sync with the ATC personalized in the device.</p>
  /tokens/{tokenId}/appletUpdate:
    post:
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 119,
            911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 119,
            911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      description: >-
        For ApplePay only. This notification informs the TSP that the applet
        version was updated by Apple.
      summary: POST /tokens/{tokenId}/appletUpdate
      operationId: notifyAppletUpdate
      tags:
        - Notify Applet Update
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/notifyAppletUpdateReq'
        description: notifyAppletUpdateReq body request
        x-gitbook-description-html: <p>notifyAppletUpdateReq body request</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      For ApplePay only. This notification informs the TSP that
                      the applet version was updated by Apple.
                    marks: []
                key: QJUos6ae9BEP
            key: e0SZiSkClA2v
        key: MVZHMvIOFFtO
      x-gitbook-description-html: >-
        <p>For ApplePay only. This notification informs the TSP that the applet
        version was updated by Apple.</p>
  /listTokens:
    post:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: POST /listTokens
      description: >
        This method is used by TSH to request the list of tokens associated to
        either a funding PAN, a card reference ID or a token PAN.

        In case of a search by token PAN, the list returned by TSP shall contain
        1 element at most.
      operationId: listTokens
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
      responses:
        '200':
          description: listTokens response payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listTokensRes'
          x-gitbook-description-html: <p>listTokens response payload</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            166, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            166, 911, 921</p>
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
      tags:
        - List Tokens
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/listTokensReq'
        description: listTokens request payload
        required: true
        x-gitbook-description-html: <p>listTokens request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to request the list of tokens
                      associated to either a funding PAN, a card reference ID or
                      a token PAN. In case of a search by token PAN, the list
                      returned by TSP shall contain 1 element at most.
                    marks: []
                key: N25OSG2iUWDV
            key: QRW9AXc1bwxW
        key: wFehBY1SxdAs
      x-gitbook-description-html: >-
        <p>This method is used by TSH to request the list of tokens associated
        to either a funding PAN, a card reference ID or a token PAN. In case of
        a search by token PAN, the list returned by TSP shall contain 1 element
        at most.</p>
  /tokens/{tokenId}/replenish:
    post:
      responses:
        '200':
          description: replenishToken response payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/replenishTokenRes'
          x-gitbook-description-html: <p>replenishToken response payload</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            119, 321, 432, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            119, 321, 432, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      description: |-
        This request is triggered when TSH has to replenish a token.<br/>
        This API only applies to Google Pay solution.
      summary: POST /tokens/{tokenId}/replenish
      operationId: replenishToken
      tags:
        - Replenish Token
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/replenishTokenReq'
        description: replenishToken body request
        x-gitbook-description-html: <p>replenishToken body request</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This request is triggered when TSH has to replenish a
                      token.

                      This API only applies to Google Pay solution.
                    marks: []
                key: l40nTXqJLdev
            key: j64WWak53S3R
        key: CJwXoGKtWWfC
      x-gitbook-description-html: >-
        <p>This request is triggered when TSH has to replenish a token.<br>This
        API only applies to Google Pay solution.</p>
  /tokens/{tokenId}/replenish/done:
    put:
      x-swagger-router-controller: tokenRequestorDispatcher
      summary: PUT /tokens/{tokenId}/replenish/done
      description: >-
        This method is used by TSH to inform the TSP that the token
        replenishment has been done.<br/>

        This API only applies to Google Pay solution.
      operationId: notifyReplenishTokenDone
      parameters:
        - $ref: '#/components/parameters/x-correlation-id-header'
        - $ref: '#/components/parameters/tokenIdPath'
      responses:
        '204':
          description: successful
          x-gitbook-description-html: <p>successful</p>
        '400':
          description: >-
            Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br/> Possible error codes are 111, 112, 113,
            119, 911, 921
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorRes'
          x-gitbook-description-html: >-
            <p>Bad Request, Invalid request URI or header, or unsupported
            nonstandard parameter.<br> Possible error codes are 111, 112, 113,
            119, 911, 921</p>
        '500':
          $ref: '#/responses/500'
        '503':
          $ref: '#/responses/503'
      tags:
        - Notify Token Replenish Done
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/notifyReplenishTokenDone'
        description: notifyReplenishTokenDone request payload
        required: true
        x-gitbook-description-html: <p>notifyReplenishTokenDone request payload</p>
      x-gitbook-description-document:
        object: document
        data:
          schemaVersion: 9
        nodes:
          - object: block
            type: paragraph
            isVoid: false
            data: {}
            nodes:
              - object: text
                leaves:
                  - object: leaf
                    text: >-
                      This method is used by TSH to inform the TSP that the
                      token replenishment has been done.

                      This API only applies to Google Pay solution.
                    marks: []
                key: RfnBl7XgiCNR
            key: 60fipgGRLSZq
        key: NpMQIIpgCEh3
      x-gitbook-description-html: >-
        <p>This method is used by TSH to inform the TSP that the token
        replenishment has been done.<br>This API only applies to Google Pay
        solution.</p>
responses:
  '500':
    description: |
      Internal Server Error
      Retry possible
    x-gitbook-description-html: |-
      <p>Internal Server Error
      Retry possible</p>
  '503':
    description: |
      Service Unavailable
      Retry possible
    x-gitbook-description-html: |-
      <p>Service Unavailable
      Retry possible</p>
tags:
  - name: TSH To TSP
  - name: Operations
  - name: Healthcheck
  - name: Create Token
  - name: Update Card Data
  - name: Notify Token Reperso Result
  - name: Request Replenishment
  - name: Notify Replenishment Result
  - name: Update Token State
  - name: List Tokens
  - name: Reperso Token
  - name: Notify Applet Update
  - name: Replenish Token
  - name: Notify Token Replenish Done
openapi: 3.1.1
servers:
  - url: /tsp/trapi/v2.0
components:
  schemas:
    submitNewTokenDataStatus:
      type: object
      required:
        - issuerId
        - status
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        status:
          type: string
          enum:
            - SUCCESS
            - FAILED
            - EXPIRED
        error:
          type: object
          description: Present in case the status is FAILED
          required:
            - responseCode
          properties:
            responseCode:
              type: number
              description: |
                |Error code | Description|
                |-------|-------|
                |911|Operation failed|
                |321|Operation on token already on-going|
                |921|Unexpected server error|
              x-gitbook-description-html: >-





















                <table><thead><tr><th>Error
                code</th><th>Description</th></tr></thead><tbody><tr><td>911</td><td>Operation
                failed</td></tr><tr><td>321</td><td>Operation on token already
                on-going</td></tr><tr><td>921</td><td>Unexpected server
                error</td></tr></tbody></table>
            errorMessage:
              type: string
              description: Textual error message
              x-gitbook-description-html: <p>Textual error message</p>
          x-gitbook-description-html: <p>Present in case the status is FAILED</p>
      examples:
        - issuerId: ISSUER0123
          status: SUCCESS
    replenishmentDoneReq:
      type: object
      required:
        - issuerId
        - repCounter
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        repCounter:
          $ref: '#/components/schemas/repCounter'
        usageLimits:
          $ref: '#/components/schemas/usageLimits'
        diversifiers:
          type: array
          items:
            $ref: '#/components/schemas/diversifier'
      examples:
        - issuerId: ISSUER0123
          repCounter: '33'
          diversifiers:
            - '0025'
            - '0026'
            - '0027'
            - '0028'
    requestReplenishmentReq:
      type: object
      required:
        - issuerId
        - atc
        - usageLimitsStatus
        - paymentCredsStatus
        - lastRepCounter
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        atc:
          $ref: '#/components/schemas/atc'
        usageLimitsStatus:
          $ref: '#/components/schemas/usageLimitsStatus'
        paymentCredsStatus:
          $ref: '#/components/schemas/paymentCredsStatus'
        lastRepCounter:
          $ref: '#/components/schemas/repCounter'
        schemeTranRecords:
          $ref: '#/components/schemas/schemeTranRecords'
        schemeTranRecSig:
          $ref: '#/components/schemas/schemeTranRecSig'
    requestReplenishmentRes:
      type: object
      required:
        - repCounter
        - paymentCredsData
      properties:
        repCounter:
          $ref: '#/components/schemas/repCounter'
        usageLimits:
          $ref: '#/components/schemas/usageLimits'
        paymentCredsData:
          $ref: '#/components/schemas/paymentCredsData'
    paymentCredsData:
      type: array
      items:
        type: object
        required:
          - encPaymentCredData
          - paymentCredAttr
          - diversifiers
        properties:
          encPaymentCredData:
            type: object
            description: >-
              Encrypted data containing the concatened payment credentials
              values.
            required:
              - encType
              - encData
            properties:
              encData:
                type: string
                maxLength: 8096
                description: Encrypted data in base64
                x-gitbook-description-html: <p>Encrypted data in base64</p>
              encType:
                type: string
                enum:
                  - RAW
                  - JWE
                description: >
                  Encryption Type:

                  RAW: encryption of raw binary data. Encrypted data are encoded
                  in base 64.

                  JWE: JWE encryption with JWS signature. Signed and Encrypted
                  data are encoded in compact serialization format.
                x-gitbook-description-html: >-
                  <p>Encryption Type:

                  RAW: encryption of raw binary data. Encrypted data are encoded
                  in base 64.

                  JWE: JWE encryption with JWS signature. Signed and Encrypted
                  data are encoded in compact serialization format.</p>
              rawEncParams:
                $ref: '#/components/schemas/rawEncParams'
            x-gitbook-description-html: >-
              <p>Encrypted data containing the concatened payment credentials
              values.</p>
          paymentCredAttr:
            $ref: '#/components/schemas/paymentCredAttr'
          diversifiers:
            type: array
            items:
              $ref: '#/components/schemas/diversifier'
    rawEncParams:
      type: object
      description: Raw information related to the encryption type
      required:
        - algo
        - mode
      properties:
        algo:
          type: string
          enum:
            - 3DES
            - AES
        mode:
          type: string
          enum:
            - ECB
            - CBC
            - CCM
            - GCM
        padding:
          type: string
          enum:
            - ISO_7816
          description: Present when there is mandatory padding on data.
          x-gitbook-description-html: <p>Present when there is mandatory padding on data.</p>
        iv:
          type: string
          maxLength: 32
          description: Initialization vector encoded in base 64.
          x-gitbook-description-html: <p>Initialization vector encoded in base 64.</p>
        aeadNonce:
          type: string
          maxLength: 128
          description: >-
            Nonce value encoded in base 64 for AEAD modes of encryption (CCM or
            GCM)
          x-gitbook-description-html: >-
            <p>Nonce value encoded in base 64 for AEAD modes of encryption (CCM
            or GCM)</p>
        aeadMac:
          type: string
          maxLength: 128
          description: >-
            MAC value encoded in base 64 for AEAD modes of encryption (CCM or
            GCM)
          x-gitbook-description-html: >-
            <p>MAC value encoded in base 64 for AEAD modes of encryption (CCM or
            GCM)</p>
        keyId:
          type: string
          maxLength: 32
          description: Encryption key identifier
          x-gitbook-description-html: <p>Encryption key identifier</p>
      x-gitbook-description-html: <p>Raw information related to the encryption type</p>
    createTokenReq:
      type: object
      required:
        - issuerId
        - walletCardRefId
        - tokenRequestorId
        - tokenStorageId
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        issuerCardRefId:
          $ref: '#/components/schemas/issuerCardRefId'
        walletCardRefId:
          $ref: '#/components/schemas/walletCardRefId'
        cipheredCardInfo:
          $ref: '#/components/schemas/cipheredCardInfo'
        publicKeyIdentifier:
          type: string
          minLength: 1
          maxLength: 32
          description: >-
            Identifier of the key used to encrypt cipheredCardInfo.<br/>Provided
            by TSP to Thales during onboarding.
          x-gitbook-description-html: >-
            <p>Identifier of the key used to encrypt
            cipheredCardInfo.<br>Provided by TSP to Thales during
            onboarding.</p>
        tokenProductId:
          $ref: '#/components/schemas/tokenProductId'
        tokenRequestorId:
          $ref: '#/components/schemas/tokenRequestorId'
        tokenStorageId:
          $ref: '#/components/schemas/tokenStorageId'
        deviceInfo:
          $ref: '#/components/schemas/deviceInfo'
        reusedTokenId:
          $ref: '#/components/schemas/reusedTokenId'
        initialState:
          $ref: '#/components/schemas/initialState'
    createTokenRes:
      type: object
      required:
        - tokenId
        - tokenInfo
      properties:
        tokenId:
          $ref: '#/components/schemas/tokenId'
        tokenInfo:
          $ref: '#/components/schemas/tokenInfo'
    listTokensReq:
      type: object
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        cipheredCardInfo:
          $ref: '#/components/schemas/cciCipheredCardInfo'
        cipheredTokenInfo:
          $ref: '#/components/schemas/cciCipheredTokenInfo'
        issuerCardRefId:
          $ref: '#/components/schemas/issuerCardRefId'
        publicKeyIdentifier:
          type: string
          minLength: 1
          maxLength: 32
          description: >-
            Identifier of the key used to encrypt cipheredCardInfo.<br/>Provided
            by TSP to Thales during onboarding.
          x-gitbook-description-html: >-
            <p>Identifier of the key used to encrypt
            cipheredCardInfo.<br>Provided by TSP to Thales during
            onboarding.</p>
      required:
        - issuerId
    listTokensRes:
      type: object
      properties:
        tokenList:
          description: list of tokens associated to the funding PAN
          type: array
          items:
            type: object
            properties:
              tokenId:
                $ref: '#/components/schemas/tokenId'
              exp:
                $ref: '#/components/schemas/exp'
              last4:
                $ref: '#/components/schemas/last4'
              state:
                $ref: '#/components/schemas/cciState'
              tokenStorageId:
                $ref: '#/components/schemas/tokenStorageId'
              tokenRequestorId:
                $ref: '#/components/schemas/tokenRequestorId'
              deviceInfo:
                $ref: '#/components/schemas/deviceInfo'
              creationDate:
                type: string
                x-stoplight:
                  id: qgvtoiykjk054
                format: date-time
                description: >-
                  Token creation date.<br/>ISO 8601 format:
                  YYYY-MM-DDThh:mm:ssTZD
                x-gitbook-description-html: >-
                  <p>Token creation date.<br>ISO 8601 format:
                  YYYY-MM-DDThh:mm:ssTZD</p>
            required:
              - tokenId
              - exp
              - last4
              - state
              - tokenStorageId
              - tokenRequestorId
              - walletProviderId
          x-gitbook-description-html: <p>list of tokens associated to the funding PAN</p>
    updateTokenReq:
      type: object
      required:
        - newCipheredCardInfo
        - issuerId
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        newCipheredCardInfo:
          $ref: '#/components/schemas/newCipheredCardInfo'
        publicKeyIdentifier:
          type: string
          minLength: 1
          maxLength: 32
          description: >-
            Identifier of the key used to encrypt
            newCipheredCardInfo.<br/>Provided by TSP to Thales during
            onboarding.
          x-gitbook-description-html: >-
            <p>Identifier of the key used to encrypt
            newCipheredCardInfo.<br>Provided by TSP to Thales during
            onboarding.</p>
        newIssuerCardRefId:
          $ref: '#/components/schemas/newIssuerCardRefId'
    updateTokenStateReq:
      type: object
      required:
        - newState
        - issuerId
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        newState:
          $ref: '#/components/schemas/state'
        reason:
          $ref: '#/components/schemas/reason'
    issuerId:
      maxLength: 10
      minLength: 10
      type: string
      description: Unique Identifier of Issuer<br/>
      examples:
        - ISSUER1234
      x-gitbook-description-html: <p>Unique Identifier of Issuer<br></p>
    newIssuerCardRefId:
      maxLength: 64
      minLength: 1
      type: string
      description: >-
        New unique identifier of the issuer that aims to identify the funding
        card.
      x-gitbook-description-html: >-
        <p>New unique identifier of the issuer that aims to identify the funding
        card.</p>
    issuerCardRefId:
      maxLength: 64
      minLength: 1
      type: string
      description: >-
        A unique identifier of the issuer that aims to identify the funding
        card.<br/>This parameter is provided by the TSH unless it's not
        connected to Issuer.<br/>This identifier might be updated by Issuer on
        card replacement/renewal flows.
      x-gitbook-description-html: >-
        <p>A unique identifier of the issuer that aims to identify the funding
        card.<br>This parameter is provided by the TSH unless it's not connected
        to Issuer.<br>This identifier might be updated by Issuer on card
        replacement/renewal flows.</p>
    walletCardRefId:
      maxLength: 64
      minLength: 1
      type: string
      description: >-
        A unique identifier of the wallet provider that aims to identify the
        funding card.<br/>This parameter is provided by the TSH.<br/>For
        ApplePay, it corresponds to the FPANID.<br/>This identifier remains
        constant even on card replacement/renewal flows.
      x-gitbook-description-html: >-
        <p>A unique identifier of the wallet provider that aims to identify the
        funding card.<br>This parameter is provided by the TSH.<br>For ApplePay,
        it corresponds to the FPANID.<br>This identifier remains constant even
        on card replacement/renewal flows.</p>
    reason:
      maxLength: 16
      minLength: 1
      type: string
      description: |
        The reason of the state update

        Possible values are:

        |reason code|description|
        |-------|-------|
        |11001|Activation from user interaction|
        |21001|Activation initiated by the issuer|
        |21002|Deletion initiated by the issuer|      
        |11002|Deletion initiated by the user|
        |21003|Suspension initiated by the issuer|      
        |11003|Suspension initiated by the user|
        |21004|Resumption initiated by the issuer|      
        |11004|Resumption initiated by the user|
      x-gitbook-description-html: >-
        <p>The reason of the state update</p>

        <p>Possible values are:</p>










































        <table><thead><tr><th>reason
        code</th><th>description</th></tr></thead><tbody><tr><td>11001</td><td>Activation
        from user interaction</td></tr><tr><td>21001</td><td>Activation
        initiated by the issuer</td></tr><tr><td>21002</td><td>Deletion
        initiated by the issuer</td></tr><tr><td>11002</td><td>Deletion
        initiated by the user</td></tr><tr><td>21003</td><td>Suspension
        initiated by the issuer</td></tr><tr><td>11003</td><td>Suspension
        initiated by the user</td></tr><tr><td>21004</td><td>Resumption
        initiated by the issuer</td></tr><tr><td>11004</td><td>Resumption
        initiated by the user</td></tr></tbody></table>
    cipheredCardInfo:
      maxLength: 8196
      minLength: 1
      type: string
      description: >-
        TSH sends card information as JSON encrypted using the PKCS#7 encryption
        scheme defined in RFC 2315/5652 using following encryption
        parameters:<br/>

        * The content encryption algorithm used is AES256/CBC/PKCS7Padding using
        a randomly generated AES key.

        * The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br/>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br/>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.

        * The encryption result is then encoded using base64.<br/>

        * The public key length in the certificate can be 2048-bit or 4096-bit.


        Once deciphered, the card info contains the following information:<br/>


        |JSON field parameter name|description|MOC|Length|

        |-------|-------|-------|-------|

        |fpan|The funding pan to digitize|M|Up to 19|

        |exp|The expiry date in the format MMYY|O|4|

        |cvv|Depending of the OEM, this value is provided or not|O|3 or 4|

        |additionalCardInfos| Optional JSON Open format, in order to add
        additional card info - project dependent|O|Up to 8177|


        *Note: If  not provided, the TSP must rely on the walletCardRefId provided to
        find the funding card to digitize from its token vault.*

        <br/>
      x-examples:
        Example 1:
          fpan: '1234567891234567'
          exp: '1218'
        Example 2:
          fpan: '1234567891234567'
          exp: '1218'
          cvv: '765'
        Example 3:
          fpan: '1234567891234567'
          exp: '1218'
          cvv: '765'
          additionalCardInfos:
            archiveReference: '90217095220928'
      x-gitbook-description-html: >-
        <p>TSH sends card information as JSON encrypted using the PKCS#7
        encryption scheme defined in RFC 2315/5652 using following encryption
        parameters:<br></p>

        <ul>

        <li>The content encryption algorithm used is AES256/CBC/PKCS7Padding
        using a randomly generated AES key.</li>

        <li>The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.</li>

        <li>The encryption result is then encoded using base64.<br></li>

        <li>The public key length in the certificate can be 2048-bit or
        4096-bit.</li>

        </ul>

        <p>Once deciphered, the card info contains the following
        information:<br></p>




































        <table><thead><tr><th>JSON field parameter
        name</th><th>description</th><th>MOC</th><th>Length</th></tr></thead><tbody><tr><td>fpan</td><td>The
        funding pan to digitize</td><td>M</td><td>Up to
        19</td></tr><tr><td>exp</td><td>The expiry date in the format
        MMYY</td><td>O</td><td>4</td></tr><tr><td>cvv</td><td>Depending of the
        OEM, this value is provided or not</td><td>O</td><td>3 or
        4</td></tr><tr><td>additionalCardInfos</td><td>Optional JSON Open
        format, in order to add additional card info - project
        dependent</td><td>O</td><td>Up to 8177</td></tr></tbody></table>

        <p><em>Note: If  not provided, the TSP must rely on the walletCardRefId
        provided to find the funding card to digitize from its token vault.</em>

        <br></p>
    newCipheredCardInfo:
      maxLength: 8196
      minLength: 1
      type: string
      description: >-
        TSH sends new card information as JSON encrypted using the PKCS#7
        encryption scheme defined in RFC 2315/5652 using following encryption
        parameters:<br/>

        * The content encryption algorithm used is AES256/CBC/PKCS7Padding using
        a randomly generated AES key.

        * The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br/>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br/>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.

        * The encryption result is then encoded using base64.<br/>

        * The public key length in the certificate can be 2048-bit or 4096-bit.


        Once deciphered, the card info contains the following information:<br/>


        |JSON field parameter name|description|MOC|Length|

        |-------|-------|-------|-------|

        |newFpan|The new funding pan value to update|O|Up to 19|

        |newExp|The new expiry date in the format MMYY|O|4|

        |newAdditionalCardInfos| Optional JSON Open format, in order
        add/update/delete additional card info - project dependent|O|Up to 8177|


        *Note: At least one of the three JSON fields needs to be provided.*
      x-gitbook-description-html: >-
        <p>TSH sends new card information as JSON encrypted using the PKCS#7
        encryption scheme defined in RFC 2315/5652 using following encryption
        parameters:<br></p>

        <ul>

        <li>The content encryption algorithm used is AES256/CBC/PKCS7Padding
        using a randomly generated AES key.</li>

        <li>The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.</li>

        <li>The encryption result is then encoded using base64.<br></li>

        <li>The public key length in the certificate can be 2048-bit or
        4096-bit.</li>

        </ul>

        <p>Once deciphered, the card info contains the following
        information:<br></p>






























        <table><thead><tr><th>JSON field parameter
        name</th><th>description</th><th>MOC</th><th>Length</th></tr></thead><tbody><tr><td>newFpan</td><td>The
        new funding pan value to update</td><td>O</td><td>Up to
        19</td></tr><tr><td>newExp</td><td>The new expiry date in the format
        MMYY</td><td>O</td><td>4</td></tr><tr><td>newAdditionalCardInfos</td><td>Optional
        JSON Open format, in order add/update/delete additional card info -
        project dependent</td><td>O</td><td>Up to 8177</td></tr></tbody></table>

        <p><em>Note: At least one of the three JSON fields needs to be
        provided.</em></p>
    tokenRequestorId:
      maxLength: 48
      minLength: 1
      type: string
      description: ID of the token requestor in the format expected by the TSP
      x-gitbook-description-html: <p>ID of the token requestor in the format expected by the TSP</p>
    tokenProductId:
      maxLength: 48
      minLength: 1
      type: string
      description: >-
        ID of the token product (Identify token domain). 


        As the token products are mapped to Issuer card products, the values
        shall be defined at the begining of the project with the TSP.
      x-gitbook-description-html: >-
        <p>ID of the token product (Identify token domain).</p>

        <p>As the token products are mapped to Issuer card products, the values
        shall be defined at the begining of the project with the TSP.</p>
    reusedTokenId:
      maxLength: 48
      minLength: 1
      type: string
      description: >-
        The tokenId provided in case the Wallet Provider wants to re-use an
        existing token.<br/>This is applicable for Apple Pay only and needs to
        have an agreement on this process at the beginning of a project.
      x-gitbook-description-html: >-
        <p>The tokenId provided in case the Wallet Provider wants to re-use an
        existing token.<br>This is applicable for Apple Pay only and needs to
        have an agreement on this process at the beginning of a project.</p>
    initialState:
      type: string
      description: Initial state of the token when created.<br/>Default value is SUSPENDED
      enum:
        - ACTIVE
        - SUSPENDED
      examples:
        - SUSPENDED
      x-gitbook-description-html: >-
        <p>Initial state of the token when created.<br>Default value is
        SUSPENDED</p>
    tokenId:
      maxLength: 48
      minLength: 1
      type: string
      description: Unique Token Identifier
      x-gitbook-description-html: <p>Unique Token Identifier</p>
    tokenStorageId:
      maxLength: 64
      minLength: 1
      type: string
      description: >-
        Token storage unique identifier (also known as deviceId or
        applicationId).<br/>

        Indicates the storage in which the token has been digitized.<br/>

        For ApplePay, it corresponds to the device SEID.<br/>
      x-gitbook-description-html: >-
        <p>Token storage unique identifier (also known as deviceId or
        applicationId).<br>

        Indicates the storage in which the token has been digitized.<br>

        For ApplePay, it corresponds to the device SEID.<br></p>
    deviceInfo:
      type: object
      description: >-
        Device related information.  Provides information about the device in
        which token has been digitized.
      properties:
        deviceName:
          maxLength: 128
          minLength: 1
          type: string
          description: device name<br/> The name associated by the end user to the device.
          x-gitbook-description-html: >-
            <p>device name<br> The name associated by the end user to the
            device.</p>
        brand:
          maxLength: 16
          minLength: 1
          type: string
          description: device brand
          x-gitbook-description-html: <p>device brand</p>
        model:
          maxLength: 16
          minLength: 1
          type: string
          description: device model
          x-gitbook-description-html: <p>device model</p>
        type:
          minLength: 1
          maxLength: 16
          type: string
          description: >-
            device type<br/>Possible values
            are:<li>PHONE<li>TABLET<li>WATCH<li>COMPUTER<li>REALITY<li>UNKNOWN
          x-gitbook-description-html: >-
            <p>device type<br>Possible values
            are:</p><li>PHONE</li><li>TABLET</li><li>WATCH</li><li>COMPUTER</li><li>REALITY</li><li>UNKNOWN<p></p></li>
        language:
          maxLength: 3
          minLength: 1
          type: string
          description: Only for ApplePay. Device language in ISO 639-3 format.
          examples:
            - eng
          x-gitbook-description-html: <p>Only for ApplePay. Device language in ISO 639-3 format.</p>
        appletVersion:
          $ref: '#/components/schemas/appletVersion'
        ecommerceCertificate:
          type: object
          description: >-
            Only for ApplePay. The e-commerce certificate to personnalize into
            the profile.
          properties:
            keyIdentifier:
              maxLength: 32
              minLength: 1
              type: string
              description: >-
                The key identifier as provided by ApplePay in hexadecimal
                format.
              examples:
                - f479b621893ad8506107bb10b03f8630
              x-gitbook-description-html: >-
                <p>The key identifier as provided by ApplePay in hexadecimal
                format.</p>
            certificate:
              maxLength: 8196
              minLength: 1
              type: string
              description: >-
                The X509 certificate as provided by ApplePay in PEM encoded
                format.
              examples:
                - >-
                  -----BEGIN
                  CERTIFICATE-----nMIICtTCCAlugAwIBAgIINya88tUZW8swCgYIKoZIzj0EAwIwdTEvMC0GA1UEAwwmnVGVzdCBBcHBsZSBTeXN0ZW0gSW50ZWdyYXRpb24gQ0EgLSBFQ0MxIDAeBgNVB.....
              x-gitbook-description-html: >-
                <p>The X509 certificate as provided by ApplePay in PEM encoded
                format.</p>
          x-gitbook-description-html: >-
            <p>Only for ApplePay. The e-commerce certificate to personnalize
            into the profile.</p>
      x-gitbook-description-html: >-
        <p>Device related information.  Provides information about the device in
        which token has been digitized.</p>
    appletVersion:
      maxLength: 32
      minLength: 1
      type: string
      description: Only for ApplePay. Applet version as provided by the Wallet Provider.
      examples:
        - '1.22'
      x-gitbook-description-html: >-
        <p>Only for ApplePay. Applet version as provided by the Wallet
        Provider.</p>
    tokenInfo:
      type: object
      description: Token related information.
      properties:
        exp:
          type: string
          maxLength: 4
          minLength: 4
          description: Token expiry date in format MMYY to display in the wallet.
          examples:
            - '1220'
          x-gitbook-description-html: <p>Token expiry date in format MMYY to display in the wallet.</p>
        last4:
          type: string
          maxLength: 10
          minLength: 2
          description: Last digits of the token pan value to display in the wallet.
          examples:
            - '1234'
          x-gitbook-description-html: <p>Last digits of the token pan value to display in the wallet.</p>
      x-gitbook-description-html: <p>Token related information.</p>
    exp:
      type: string
      maxLength: 4
      minLength: 4
      description: Token expiry date in MMYY format
      examples:
        - '1220'
      x-gitbook-description-html: <p>Token expiry date in MMYY format</p>
    last4:
      type: string
      maxLength: 4
      minLength: 4
      description: Last digits of the token pan value
      examples:
        - '1234'
      x-gitbook-description-html: <p>Last digits of the token pan value</p>
    state:
      type: string
      description: state of the token
      enum:
        - SUSPENDED
        - DELETED
        - ACTIVE
        - ERASED
      x-gitbook-description-html: <p>state of the token</p>
    cciState:
      type: string
      description: state of the token
      enum:
        - SUSPENDED
        - DELETED
        - ACTIVE
        - INACTIVE
      x-gitbook-description-html: <p>state of the token</p>
    atc:
      type: string
      maxLength: 4
      minLength: 4
      description: >
        Value of the application transaction counter that will be used in the
        next payment transaction.

        The ATC is encoded as an hexa string on 4 digits.
      x-gitbook-description-html: >-
        <p>Value of the application transaction counter that will be used in the
        next payment transaction.

        The ATC is encoded as an hexa string on 4 digits.</p>
    usageLimits:
      type: object
      properties:
        maxPayments:
          type: number
          minimum: 0
          maximum: 999999
          description: |
            Max number of payments allowed with the payment credential.
            Apply to LUK payment credentials only.
          x-gitbook-description-html: |-
            <p>Max number of payments allowed with the payment credential.
            Apply to LUK payment credentials only.</p>
        expiryDate:
          type: string
          maxLength: 10
          minLength: 10
          description: Expiry date in ISO 8601 format YYYY-MM-DD
          x-gitbook-description-html: <p>Expiry date in ISO 8601 format YYYY-MM-DD</p>
    usageLimitsStatus:
      type: object
      properties:
        paymentCredRemaining:
          type: number
          minimum: 0
          maximum: 999999
          description: |
            Number of payment credentials remaining.
            Apply to SUK payment credentials only.
          x-gitbook-description-html: |-
            <p>Number of payment credentials remaining.
            Apply to SUK payment credentials only.</p>
        paymentRemaining:
          type: number
          minimum: 0
          maximum: 999999
          description: |
            Number of payments remaining.
            Apply to LUK payment credentials only.
          x-gitbook-description-html: |-
            <p>Number of payments remaining.
            Apply to LUK payment credentials only.</p>
        expiryDate:
          type: string
          maxLength: 10
          minLength: 10
          description: Expiry date in ISO 8601 format YYYY-MM-DD
          x-gitbook-description-html: <p>Expiry date in ISO 8601 format YYYY-MM-DD</p>
    paymentCredsStatus:
      type: array
      items:
        type: object
        required:
          - diversifier
          - timestamp
          - paymentCredAttr
        properties:
          sukStatus:
            type: string
            enum:
              - USED_FOR_CONTACTLESS
              - USED_FOR_REMOTE
              - UNUSED
              - DISCARDED
            description: |
              SUK Payment credential status
              Present when payment credential type is SUK.
              The status apply to all payment credentials variants.
            x-gitbook-description-html: |-
              <p>SUK Payment credential status
              Present when payment credential type is SUK.
              The status apply to all payment credentials variants.</p>
          diversifier:
            $ref: '#/components/schemas/diversifier'
          timestamp:
            type: string
            maxLength: 30
            description: >
              Timestamp in ISO 8601 format: YYYY-MM-DD'T'HH:MM:SS

              * LUK: Time of creation of the payment credentail status data.

              * SUK with status UNUSED or DISCARDED: Time of creation of the
              payment credentail status data.

              * SUK with status USED_FOR_CONTACTLESS or USED_FOR_REMOTE: Time
              the payment credential was used.
            x-gitbook-description-html: >-
              <p>Timestamp in ISO 8601 format: YYYY-MM-DD'T'HH:MM:SS</p>

              <ul>

              <li>LUK: Time of creation of the payment credentail status
              data.</li>

              <li>SUK with status UNUSED or DISCARDED: Time of creation of the
              payment credentail status data.</li>

              <li>SUK with status USED_FOR_CONTACTLESS or USED_FOR_REMOTE: Time
              the payment credential was used.</li>

              </ul>
          paymentCredAttr:
            $ref: '#/components/schemas/paymentCredAttr'
    diversifier:
      type: string
      maxLength: 7
      description: >
        Payment credential diversifier:

        * For an SUK, this is an ATC which is a string of 4 hexa digits.

        * For an LUK, this is an "YHHHHCC" Visa CBP diversifier which is a
        string of 7 digits.
      x-gitbook-description-html: >-
        <p>Payment credential diversifier:</p>

        <ul>

        <li>For an SUK, this is an ATC which is a string of 4 hexa digits.</li>

        <li>For an LUK, this is an "YHHHHCC" Visa CBP diversifier which is a
        string of 7 digits.</li>

        </ul>
    paymentCredAttr:
      type: object
      required:
        - type
      description: >-
        Since the status apply to all payment credentials variants and payment
        channels, the type is set but not the code nor the channel.
      properties:
        type:
          type: string
          description: Payment credential type
          enum:
            - SUK
            - LUK
          x-gitbook-description-html: <p>Payment credential type</p>
        code:
          type: string
          description: >
            Payment credential code to identify a variant of payment credential

            * SUK_IDN (Mastercard)

            * SUK_UMD (Mastercard)

            * SUK_MD (Mastercard)

            * SUK_AC (Pure)

            * SUK_LC (Pure)

            * SUK_CPIN (Pure)

            When present, it means the attributes apply to a specific variant.
            Otherwise, the attributes apply to all variants.
          enum:
            - SUK_IDN
            - SUK_UMD
            - SUK_MD
            - SUK_AC
            - SUK_LC
            - SUK_CPIN
          x-gitbook-description-html: >-
            <p>Payment credential code to identify a variant of payment
            credential</p>

            <ul>

            <li>SUK_IDN (Mastercard)</li>

            <li>SUK_UMD (Mastercard)</li>

            <li>SUK_MD (Mastercard)</li>

            <li>SUK_AC (Pure)</li>

            <li>SUK_LC (Pure)</li>

            <li>SUK_CPIN (Pure)

            When present, it means the attributes apply to a specific variant.
            Otherwise, the attributes apply to all variants.</li>

            </ul>
        channel:
          type: string
          enum:
            - CONTACTLESS
            - REMOTE
          description: >
            Payment channel

            When present, it means the attributes apply to a specific payment
            channel. Otherwise, the attributes apply to all channels.
          x-gitbook-description-html: >-
            <p>Payment channel

            When present, it means the attributes apply to a specific payment
            channel. Otherwise, the attributes apply to all channels.</p>
        dki:
          type: string
          maxLength: 2
          description: Derived key index.
          x-gitbook-description-html: <p>Derived key index.</p>
      x-gitbook-description-html: >-
        <p>Since the status apply to all payment credentials variants and
        payment channels, the type is set but not the code nor the channel.</p>
    repCounter:
      type: string
      maxLength: 5
      description: Value of the replenishment counter for the last replenishment.
      x-gitbook-description-html: <p>Value of the replenishment counter for the last replenishment.</p>
    schemeTranRecords:
      type: string
      maxLength: 2000
      description: >
        Transaction records for the last transactions as specified by the
        payment scheme.

        The transaction records data is encoded in base 64.
      x-gitbook-description-html: >-
        <p>Transaction records for the last transactions as specified by the
        payment scheme.

        The transaction records data is encoded in base 64.</p>
    schemeTranRecSig:
      type: string
      maxLength: 200
      description: >-
        Signature of the transaction records computed according to the scheme
        specifications and encoded in hexa.
      x-gitbook-description-html: >-
        <p>Signature of the transaction records computed according to the scheme
        specifications and encoded in hexa.</p>
    errorRes:
      type: object
      description: Error Information Response
      required:
        - responseCode
      properties:
        responseCode:
          type: number
          description: |
            Error Response code to the request
            |Error code | Description| Retryable|
            |-------|-------|-------|
            |111|Missing mandatory parameter|N|
            |112|Bad parameter format|N|
            |113|Unknown issuer|N|
            |115|Unknown product|N|
            |119|Unknown Token|N|
            |163|Product not supported for mobile payment|N|
            |164|FPAN Digitization Count Exceeded|N|
            |166|Invalid FPAN|N|
            |167|Card already enrolled|N|
            |321|Operation on token already on-going|N|
            |322|Time to live of the operation expired|N|
            |431|Invalid perso data|N|
            |432|Current token state does not allow this operation|N|
            |911|Operation failed|N|
            |921|Unexpected server error|Y|
          x-gitbook-description-html: >-
            <p>Error Response code to the request</p>






















































































            <table><thead><tr><th>Error
            code</th><th>Description</th><th>Retryable</th></tr></thead><tbody><tr><td>111</td><td>Missing
            mandatory parameter</td><td>N</td></tr><tr><td>112</td><td>Bad
            parameter format</td><td>N</td></tr><tr><td>113</td><td>Unknown
            issuer</td><td>N</td></tr><tr><td>115</td><td>Unknown
            product</td><td>N</td></tr><tr><td>119</td><td>Unknown
            Token</td><td>N</td></tr><tr><td>163</td><td>Product not supported
            for mobile payment</td><td>N</td></tr><tr><td>164</td><td>FPAN
            Digitization Count
            Exceeded</td><td>N</td></tr><tr><td>166</td><td>Invalid
            FPAN</td><td>N</td></tr><tr><td>167</td><td>Card already
            enrolled</td><td>N</td></tr><tr><td>321</td><td>Operation on token
            already on-going</td><td>N</td></tr><tr><td>322</td><td>Time to live
            of the operation
            expired</td><td>N</td></tr><tr><td>431</td><td>Invalid perso
            data</td><td>N</td></tr><tr><td>432</td><td>Current token state does
            not allow this
            operation</td><td>N</td></tr><tr><td>911</td><td>Operation
            failed</td><td>N</td></tr><tr><td>921</td><td>Unexpected server
            error</td><td>Y</td></tr></tbody></table>
        errorMessage:
          type: string
          description: Textual error message
          x-gitbook-description-html: <p>Textual error message</p>
      x-gitbook-description-html: <p>Error Information Response</p>
    repersoTokenReq:
      type: object
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
    notifyAppletUpdateReq:
      type: object
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
        appletVersion:
          $ref: '#/components/schemas/appletVersion'
      required:
        - issuerId
        - appletVersion
    replenishTokenReq:
      type: object
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
    replenishTokenRes:
      type: object
      properties:
        kekLabel:
          type: string
          description: Label of the key used to encrypt paymentKeys
          x-gitbook-description-html: <p>Label of the key used to encrypt paymentKeys</p>
        kekKcv:
          type: string
          description: KCV of the Key Encryption Key
          x-gitbook-description-html: <p>KCV of the Key Encryption Key</p>
        paymentKeys:
          type: string
          description: >-
            String representation of JSON array of objects containing payment
            keys<br/>as defined in Data Preparation section
          x-gitbook-description-html: >-
            <p>String representation of JSON array of objects containing payment
            keys<br>as defined in Data Preparation section</p>
    notifyReplenishTokenDone:
      type: object
      required:
        - issuerId
      properties:
        issuerId:
          $ref: '#/components/schemas/issuerId'
      examples:
        - issuerId: ISSUER0124
    cciCipheredTokenInfo:
      maxLength: 8196
      minLength: 1
      type: string
      description: >-
        TSH sends token information as JSON encrypted using the PKCS#7
        encryption scheme defined in RFC 2315/5652 using following encryption
        parameters:<br/>

        * The content encryption algorithm used is AES256/CBC/PKCS7Padding using
        a randomly generated AES key.

        * The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br/>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br/>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.

        * The encryption result is then encoded using base64.<br/>

        * The public key length in the certificate can be 2048-bit or 4096-bit.


        Once deciphered, the card info contains the following information:<br/>


        |JSON field parameter name|description|MOC|Length|

        |-------|-------|-------|-------|

        |dpan|The token PAN|M|Up to 19|
      x-gitbook-description-html: >-
        <p>TSH sends token information as JSON encrypted using the PKCS#7
        encryption scheme defined in RFC 2315/5652 using following encryption
        parameters:<br></p>

        <ul>

        <li>The content encryption algorithm used is AES256/CBC/PKCS7Padding
        using a randomly generated AES key.</li>

        <li>The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.</li>

        <li>The encryption result is then encoded using base64.<br></li>

        <li>The public key length in the certificate can be 2048-bit or
        4096-bit.</li>

        </ul>

        <p>Once deciphered, the card info contains the following
        information:<br></p>


















        <table><thead><tr><th>JSON field parameter
        name</th><th>description</th><th>MOC</th><th>Length</th></tr></thead><tbody><tr><td>dpan</td><td>The
        token PAN</td><td>M</td><td>Up to 19</td></tr></tbody></table>
    cciCipheredCardInfo:
      maxLength: 8196
      minLength: 1
      type: string
      description: >-
        TSH sends card information as JSON encrypted using the PKCS#7 encryption
        scheme defined in RFC 2315/5652 using following encryption
        parameters:<br/>

        * The content encryption algorithm used is AES256/CBC/PKCS7Padding using
        a randomly generated AES key.

        * The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br/>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br/>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.

        * The encryption result is then encoded using base64.<br/>

        * The public key length in the certificate can be 2048-bit or 4096-bit.


        Once deciphered, the card info contains the following information:<br/>


        |JSON field parameter name|description|MOC|Length|

        |-------|-------|-------|-------|

        |fpan|The funding pan|M|Up to 19|
      x-gitbook-description-html: >-
        <p>TSH sends card information as JSON encrypted using the PKCS#7
        encryption scheme defined in RFC 2315/5652 using following encryption
        parameters:<br></p>

        <ul>

        <li>The content encryption algorithm used is AES256/CBC/PKCS7Padding
        using a randomly generated AES key.</li>

        <li>The key encryption algorithm is either RSAES-PKCS1-v1_5
        (RSA/NONE/PKCS1Padding) or RSA/NONE/OAEPWithSHA256AndMGF1Padding (with
        MGF1 using SHA-256), using the certificate provided during
        onboarding.<br>

        The key encryption algorithm is defined during onboarding and is by
        default (if ommitted) the RSA/NONE/PKCS1Padding for legacy purpose.<br>

        It is recommended to configure RSA/NONE/OAEPWithSHA256AndMGF1Padding
        (with MGF1 using SHA-256) for new TSPs.</li>

        <li>The encryption result is then encoded using base64.<br></li>

        <li>The public key length in the certificate can be 2048-bit or
        4096-bit.</li>

        </ul>

        <p>Once deciphered, the card info contains the following
        information:<br></p>


















        <table><thead><tr><th>JSON field parameter
        name</th><th>description</th><th>MOC</th><th>Length</th></tr></thead><tbody><tr><td>fpan</td><td>The
        funding pan</td><td>M</td><td>Up to 19</td></tr></tbody></table>
  parameters:
    tokenIdPath:
      schema:
        type: string
        maxLength: 48
        minLength: 1
      description: Identifier of the token to update
      in: path
      name: tokenId
      required: true
      x-gitbook-description-html: <p>Identifier of the token to update</p>
    x-correlation-id-header:
      schema:
        type: string
        maxLength: 64
        minLength: 1
      description: Unique identifier used to trace function calls across systems
      in: header
      name: x-correlation-id
      required: true
      x-gitbook-description-html: <p>Unique identifier used to trace function calls across systems</p>
    x-request-id-header:
      schema:
        type: string
        maxLength: 64
        minLength: 1
      description: Unique identifier of the request
      in: header
      name: x-request-id
      required: true
      x-gitbook-description-html: <p>Unique identifier of the request</p>
  securitySchemes: {}
