openapi: 3.1.0
info:
  version: '1.0'
  title: D1 Transit Outbound API
servers:
  - url: https://CUSTOMER-PROD/d1/transit/api/v1
    description: Prod URL
    x-gitbook-description-html: <p>Prod URL</p>
  - url: https://CUSTOMER-STG/d1/transit/api/v1
    description: Staging URL
    x-gitbook-description-html: <p>Staging URL</p>
paths:
  /issuers/{issuerId}/wallets/{walletIndicator}/getDigitalCardBundleData:
    post:
      summary: Get Digital Card Bundle Data
      description: >-
        API used for fetching the data required to build the digital card bundle
        that will be provisioned into a device.
      operationId: getDigitalCardBundleData
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDigitalCardBundleDataReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDigitalCardBundleDataRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: >-
                      API used for fetching the data required to build the
                      digital card bundle that will be provisioned into a
                      device.
                    marks: []
                key: ihME5JEsNlSe
            key: wMTZ3Y2AU2Br
        key: idp54MKpbGoy
      x-gitbook-description-html: >-
        <p>API used for fetching the data required to build the digital card
        bundle that will be provisioned into a device.</p>
  /issuers/{issuerId}/wallets/{walletIndicator}/notifyDigitalCardEvent:
    post:
      summary: Notify Digital Card Event
      description: >-
        API used for notifying
        events:<ul><li>provisioning<li>lifecycle<li>digital card bundle update
        (CBT only)
      operationId: notifyDigitalCardEvent
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotifyDigitalCardEventReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotifyDigitalCardEventRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: 'API used for notifying events:'
                    marks: []
                key: bcOhhXRUqDEK
            key: hoXzh1pKkKdE
          - object: block
            type: list-unordered
            isVoid: false
            data: {}
            nodes:
              - object: block
                type: list-item
                isVoid: false
                data: {}
                nodes:
                  - object: block
                    type: paragraph
                    isVoid: false
                    data: {}
                    nodes:
                      - object: text
                        leaves:
                          - object: leaf
                            text: provisioning
                            marks: []
                        key: 94aKrvzNFjqh
                    key: HU1I48t9Pg5m
                key: 9yk7EKy8vo8b
              - object: block
                type: list-item
                isVoid: false
                data: {}
                nodes:
                  - object: block
                    type: paragraph
                    isVoid: false
                    data: {}
                    nodes:
                      - object: text
                        leaves:
                          - object: leaf
                            text: lifecycle
                            marks: []
                        key: N1zeTLuCHEJq
                    key: X4GWLuU4XVud
                key: vJsIgNEol025
              - object: block
                type: list-item
                isVoid: false
                data: {}
                nodes:
                  - object: block
                    type: paragraph
                    isVoid: false
                    data: {}
                    nodes:
                      - object: text
                        leaves:
                          - object: leaf
                            text: digital card bundle update (CBT only)
                            marks: []
                        key: q0ND8Gr5mXz4
                    key: YXeE1oSvpW4H
                key: tUPfXYGubONk
            key: kUlPtpHSsnKV
        key: wBllzcjjalZe
      x-gitbook-description-html: >-
        <p>API used for notifying
        events:</p><ul><li>provisioning</li><li>lifecycle</li><li>digital card
        bundle update (CBT only)</li></ul>
  /issuers/{issuerId}/wallets/{walletIndicator}/manageDigitalCard:
    post:
      summary: Manage Digital Card
      description: >-
        API used for managing digital cards state change trigger by Digital
        Wallets.
      operationId: manageDigitalCard
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManageDigitalCardReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManageDigitalCardRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: >-
                      API used for managing digital cards state change trigger
                      by Digital Wallets.
                    marks: []
                key: pILOc6r9Y53l
            key: v3yI9d4jlof2
        key: Bk42Hx7rrBx2
      x-gitbook-description-html: >-
        <p>API used for managing digital cards state change trigger by Digital
        Wallets.</p>
  /issuers/{issuerId}/wallets/{walletIndicator}/getCardAccountMetadata:
    post:
      summary: Get Card Account Metadata
      description: API used for getting the metadata of an account.
      operationId: getCardAccountMetadata
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetCardAccountMetadataReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCardAccountMetadataRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: API used for getting the metadata of an account.
                    marks: []
                key: ZDDXHPIylSEp
            key: 6tEW2LSrx07T
        key: jhbok0w1QxAG
      x-gitbook-description-html: <p>API used for getting the metadata of an account.</p>
  /issuers/{issuerId}/wallets/{walletIndicator}/purchaseProducts:
    post:
      summary: Purchase Products
      description: >-
        API used to request the purchase of products initiated from Digital
        Wallets.
      operationId: purchaseProducts
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseProductsReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseProductsRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: >-
                      API used to request the purchase of products initiated
                      from Digital Wallets.
                    marks: []
                key: hVW704919bQa
            key: MxwFGC2T3nap
        key: bLwZyPaRnvOh
      x-gitbook-description-html: >-
        <p>API used to request the purchase of products initiated from Digital
        Wallets.</p>
  /issuers/{issuerId}/wallets/{walletIndicator}/getPurchasableProducts:
    post:
      summary: Get Purchasable Products
      description: API used for fetching the list of purchasable products.
      operationId: getPurchasableProducts
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetPurchasableProductsReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPurchasableProductsRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: API used for fetching the list of purchasable products.
                    marks: []
                key: rD1aQcnsGjhb
            key: 1yIBmsWgvoW7
        key: kxs8niWTdLOg
      x-gitbook-description-html: <p>API used for fetching the list of purchasable products.</p>
  /issuers/{issuerId}/wallets/{walletIndicator}/registerCardAccount:
    post:
      summary: Register Card Account
      description: >-
        API used for registering a card account and binding it with an existing
        EMV tokenId.<br/>**This API is only applicable to Google Transit
        Insights (GTI).**
      operationId: registerCardAccount
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterCardAccountReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterCardAccountRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: >
                      API used for registering a card account and binding it
                      with an existing EMV tokenId.
                    marks: []
                  - object: leaf
                    text: >-
                      This API is only applicable to Google Transit Insights
                      (GTI).
                    marks:
                      - object: mark
                        type: bold
                        data: {}
                key: i47nIdqfyP22
            key: Bo5hawmriKmy
        key: Mbhu2hTVG3Vy
      x-gitbook-description-html: >-
        <p>API used for registering a card account and binding it with an
        existing EMV tokenId.<br><strong>This API is only applicable to Google
        Transit Insights (GTI).</strong></p>
  /issuers/{issuerId}/wallets/{walletIndicator}/getDigitalCardBundleCommands:
    post:
      summary: Get Digital Card Bundle Commands
      description: >-
        API used for fetching the commands required to update/read a digital
        card bundle provisioned within a device.<br/>Transit Issuer has to
        return the list of commands that needs to be executed on the device
        after checking the previous commands responses.<br/><br/>**This API is
        only applicable to CBT.**
      operationId: getDigitalCardBundleCommands
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDigitalCardBundleCommandsReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDigitalCardBundleCommandsRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: >+
                      API used for fetching the commands required to update/read
                      a digital card bundle provisioned within a device.

                      Transit Issuer has to return the list of commands that
                      needs to be executed on the device after checking the
                      previous commands responses.

                    marks: []
                  - object: leaf
                    text: This API is only applicable to CBT.
                    marks:
                      - object: mark
                        type: bold
                        data: {}
                key: jfryRxZ84nXi
            key: NZsWCmwwm9X4
        key: P6FrcPfXojXV
      x-gitbook-description-html: >-
        <p>API used for fetching the commands required to update/read a digital
        card bundle provisioned within a device.<br>Transit Issuer has to return
        the list of commands that needs to be executed on the device after
        checking the previous commands responses.<br><br><strong>This API is
        only applicable to CBT.</strong></p>
  /issuers/{issuerId}/wallets/{walletIndicator}/getTransactions:
    post:
      summary: Get Transactions
      description: >-
        API used to fetch transaction and balance details from the Transit
        Issuer.<br/><br/>**This API is only applicable to ABT.**
      operationId: getTransactions
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTransactionsReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTransactionsRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: >+
                      API used to fetch transaction and balance details from the
                      Transit Issuer.

                    marks: []
                  - object: leaf
                    text: This API is only applicable to ABT.
                    marks:
                      - object: mark
                        type: bold
                        data: {}
                key: tBV5ac3KgTk9
            key: ZSugknAQTfXb
        key: BdDNGMOLs8cp
      x-gitbook-description-html: >-
        <p>API used to fetch transaction and balance details from the Transit
        Issuer.<br><br><strong>This API is only applicable to ABT.</strong></p>
  /issuers/{issuerId}/wallets/{walletIndicator}/getMessages:
    post:
      summary: Get Messages
      description: API used to fetch messages from the Transit Issuer.
      operationId: getMessages
      parameters:
        - $ref: '#/components/parameters/issuerId'
        - $ref: '#/components/parameters/walletIndicator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetMessagesReq'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMessagesRes'
        '500':
          $ref: '#/components/responses/error500'
        '503':
          $ref: '#/components/responses/error503'
      servers:
        - url: https://CUSTOMER-PROD/d1/transit/api/v1
          description: Prod URL
          x-gitbook-description-html: <p>Prod URL</p>
        - url: https://CUSTOMER-STG/d1/transit/api/v1
          description: Staging URL
          x-gitbook-description-html: <p>Staging URL</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: API used to fetch messages from the Transit Issuer.
                    marks: []
                key: 38woU9CADNQT
            key: qIw6kC99bPe0
        key: kDUIfAUK4pEt
      x-gitbook-description-html: <p>API used to fetch messages from the Transit Issuer.</p>
components:
  parameters:
    issuerId:
      name: issuerId
      in: path
      description: Issuer unique identifier. Assigned by Thales during onboarding.
      required: true
      schema:
        type: string
        maxLength: 10
      x-gitbook-description-html: <p>Issuer unique identifier. Assigned by Thales during onboarding.</p>
    walletIndicator:
      name: walletIndicator
      in: path
      description: |-
        Indicates which digital wallet is involved in the use case.
        |Value|Description|
        |---|---|
        |1|Apple|
        |2|Google|
        |3|Samsung|        
      required: true
      schema:
        type: number
      x-gitbook-description-html: >-
        <p>Indicates which digital wallet is involved in the use case.</p>






















        <table><thead><tr><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>Apple</td></tr><tr><td>2</td><td>Google</td></tr><tr><td>3</td><td>Samsung</td></tr></tbody></table>
  responses:
    error500:
      description: >
        An unexpected error occurred while processing the request.<br/>

        The request cannot be retried.<br/>

        Only used in cases where it's not be possible to provide more
        information about what went wrong with the request (i.e. return <b>HTTP
        200</b> with '<b>responseContext</b>').
      x-gitbook-description-html: >-
        <p>An unexpected error occurred while processing the request.<br>

        The request cannot be retried.<br>

        Only used in cases where it's not be possible to provide more
        information about what went wrong with the request (i.e. return <b>HTTP
        200</b> with '<b>responseContext</b>').</p>
    error503:
      description: |
        Indicates that the system is unavailable.<br/>
        The request can be retried.
      x-gitbook-description-html: |-
        <p>Indicates that the system is unavailable.<br>
        The request can be retried.</p>
  schemas:
    GetDigitalCardBundleDataReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        userId:
          $ref: '#/components/schemas/userId'
          description: User unique identifier.<br/>Always provided for Apple.
          x-gitbook-description-html: <p>User unique identifier.<br>Always provided for Apple.</p>
        walletId:
          $ref: '#/components/schemas/walletId'
        deviceType:
          $ref: '#/components/schemas/deviceType'
      required:
        - requestContext
        - digitalCardId
        - cardAccountId
        - walletId
    requestContext:
      type: object
      properties:
        requestId:
          type: string
          description: Request unique identifier. Should be different for every retry.
          maxLength: 64
          examples:
            - 493f7686-93a0-494a-a44f-867fcd10ce22
          x-gitbook-description-html: >-
            <p>Request unique identifier. Should be different for every
            retry.</p>
        correlationId:
          type: string
          description: >-
            Random identifier which can be used to correlate the different API
            calls done as part of a usecase.

            There is no strong guarantee of the uniqueness of this identifier,
            so it should not be used for purposes other than logging and
            troubleshooting.
          maxLength: 64
          examples:
            - bfd8450f-a605-4427-9714-1d620f14dda1
          x-gitbook-description-html: >-
            <p>Random identifier which can be used to correlate the different
            API calls done as part of a usecase.

            There is no strong guarantee of the uniqueness of this identifier,
            so it should not be used for purposes other than logging and
            troubleshooting.</p>
      required:
        - requestId
        - correlationId
    digitalCardId:
      type: string
      description: Digital card unique identifier
      maxLength: 64
      examples:
        - DGGLSW8D8AC610566D4EF09C22186B2A5ED756
      x-gitbook-description-html: <p>Digital card unique identifier</p>
    cardAccountId:
      type: string
      description: Card account unique identifier
      maxLength: 64
      examples:
        - FAPLSW8D8AC610566D4EF09C22186B2A5ED793
      x-gitbook-description-html: <p>Card account unique identifier</p>
    userId:
      type: string
      description: User unique identifier
      maxLength: 64
      examples:
        - sSHfawfGsHUQjg8zaOHnPPgso5TF
      x-gitbook-description-html: <p>User unique identifier</p>
    walletId:
      type: string
      description: >-
        Wallet unique identifier.<br/>Corresponds to unique device identifier
        for Apple and Samsung.<br/>Corresponds to unique identifier assigned for
        a given user and device for Google.
      maxLength: 64
      examples:
        - 9i+KsSHjySa7Nxyzpvp6V/mL/fhwwZ7H/NEE9XCGjO6zzKiNnimDDAVHxOFa0jKF
      x-gitbook-description-html: >-
        <p>Wallet unique identifier.<br>Corresponds to unique device identifier
        for Apple and Samsung.<br>Corresponds to unique identifier assigned for
        a given user and device for Google.</p>
    deviceType:
      type: number
      description: |
        Device type.
        |value|description|
        |-------|-------|
        |1|Phone|
        |2|Tablet|
        |3|Watch|
        |4-99|RFU|
      x-gitbook-description-html: >-
        <p>Device type.</p>


























        <table><thead><tr><th>value</th><th>description</th></tr></thead><tbody><tr><td>1</td><td>Phone</td></tr><tr><td>2</td><td>Tablet</td></tr><tr><td>3</td><td>Watch</td></tr><tr><td>4-99</td><td>RFU</td></tr></tbody></table>
    GetDigitalCardBundleDataRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        persoData:
          type: array
          description: >-
            Array of name/value pairs used to personalize the digital card
            bundle.<br/>Some values may require to be encrypted, please refer to
            https://docs.payments.thalescloud.io/transit-digitization/integrate-d1-transit-api/prepare-personalization-data
          minItems: 1
          items:
            type: object
            properties:
              name:
                type: string
                description: Unique name of the data
                x-gitbook-description-html: <p>Unique name of the data</p>
              value:
                type: string
                description: Value of the data
                x-gitbook-description-html: <p>Value of the data</p>
            required:
              - name
              - value
          x-gitbook-description-html: >-
            <p>Array of name/value pairs used to personalize the digital card
            bundle.<br>Some values may require to be encrypted, please refer to
            <a
            href="https://docs.payments.thalescloud.io/transit-digitization/integrate-d1-transit-api/prepare-personalization-data">https://docs.payments.thalescloud.io/transit-digitization/integrate-d1-transit-api/prepare-personalization-data</a></p>
        metaData:
          type: object
          properties:
            displayCardValue:
              $ref: '#/components/schemas/displayCardValue'
            cardArtsId:
              $ref: '#/components/schemas/cardArtsId'
            productsList:
              type: array
              minItems: 1
              items:
                type: object
                properties:
                  productId:
                    $ref: '#/components/schemas/productId'
                  productType:
                    $ref: '#/components/schemas/productType'
                  displayName:
                    $ref: '#/components/schemas/localizedString'
                    description: |
                      Localized product display name.
                    x-gitbook-description-html: <p>Localized product display name.</p>
                  displayDetails:
                    $ref: '#/components/schemas/localizedString'
                    description: |
                      Localized product display details.
                    x-gitbook-description-html: <p>Localized product display details.</p>
                  fare:
                    $ref: '#/components/schemas/fare'
                    description: |
                      Product fare.
                    x-gitbook-description-html: <p>Product fare.</p>
                  validityParameters:
                    $ref: '#/components/schemas/productValidityParameters'
                    description: |
                      Product validity parameters.
                    x-gitbook-description-html: <p>Product validity parameters.</p>
                  eligibleForTopup:
                    $ref: '#/components/schemas/eligibleForTopup'
                  renewalPeriod:
                    $ref: '#/components/schemas/renewalPeriod'
                required:
                  - productId
                  - productType
                  - displayName
          required:
            - displayCardValue
            - productsList
      required:
        - responseContext
    responseContext:
      type: object
      description: >
        Should be used for most of responses, even if the request processing was
        not successful.

        If there was an issue encountered during request processing, the
        statusCode and statusMessage are used to give more details about what
        has gone wrong.
      properties:
        requestId:
          type: string
          description: requestId value from the corresponding request.
          maxLength: 64
          examples:
            - a762c0a1-2ae7-42b1-a4d8-8d8ba09bdf30
          x-gitbook-description-html: <p>requestId value from the corresponding request.</p>
        statusCode:
          type: number
          examples:
            - 0
        statusMessage:
          type: string
          examples:
            - OK
      required:
        - requestId
        - statusCode
      x-gitbook-description-html: >-
        <p>Should be used for most of responses, even if the request processing
        was not successful.

        If there was an issue encountered during request processing, the
        statusCode and statusMessage are used to give more details about what
        has gone wrong.</p>
    displayCardValue:
      type: string
      description: Value of the card to be displayed to the user.
      minLength: 1
      maxLength: 20
      examples:
        - '458965204578'
      x-gitbook-description-html: <p>Value of the card to be displayed to the user.</p>
    cardArtsId:
      type: string
      description: >-
        Identifier referencing card arts configuration used for this
        card.<br/>Default value configured during onboarding is used if this
        parameter is not provided.
      maxLength: 64
      examples:
        - 046d8480-c229-49d3-b2b0-cfe135da1da4
      x-gitbook-description-html: >-
        <p>Identifier referencing card arts configuration used for this
        card.<br>Default value configured during onboarding is used if this
        parameter is not provided.</p>
    productId:
      type: string
      description: Product unique identifier
      maxLength: 64
      examples:
        - 6489d6ae-231d-4260-afd6-5fa44ede0d59
      x-gitbook-description-html: <p>Product unique identifier</p>
    productType:
      type: string
      enum:
        - stored-value
        - count-based
        - time-based
      description: >
        Product type.<br/>It can be either:<ul><li><b>stored-value</b>, for
        example: e-purse, balance<li><b>count-based</b>, for example: carnet of
        tickets<li><b>time-based</b>, for example: weekly pass</ul>
      x-gitbook-description-html: >-
        <p>Product type.<br>It can be either:</p><ul><li><b>stored-value</b>,
        for example: e-purse, balance</li><li><b>count-based</b>, for example:
        carnet of tickets</li><li><b>time-based</b>, for example: weekly
        pass</li></ul><p></p>
    localizedString:
      type: object
      properties:
        defaultValue:
          type: string
          description: Default value to be used if no appropriate  translation is available
          examples:
            - Default
          x-gitbook-description-html: >-
            <p>Default value to be used if no appropriate  translation is
            available</p>
        translatedValues:
          type: array
          description: Array of localized values
          items:
            type: object
            properties:
              value:
                type: string
                description: Localized value
                examples:
                  - defaut
                x-gitbook-description-html: <p>Localized value</p>
              language:
                type: string
                description: >-
                  Language tag as per <a
                  href="https://datatracker.ietf.org/doc/html/rfc5646">RFC
                  5646</a>
                examples:
                  - fr
                x-gitbook-description-html: >-
                  <p>Language tag as per <a
                  href="https://datatracker.ietf.org/doc/html/rfc5646">RFC
                  5646</a></p>
            required:
              - value
              - language
          x-gitbook-description-html: <p>Array of localized values</p>
      required:
        - defaultValue
    fare:
      type: object
      properties:
        fareId:
          type: string
          description: |
            Identifier to match to GTFS feed exposed by transit issuer.
          examples:
            - Fare_abc
          x-gitbook-description-html: <p>Identifier to match to GTFS feed exposed by transit issuer.</p>
        fareClass:
          type: string
          description: Fare class.
          examples:
            - first
            - standard
            - business
            - ...
          x-gitbook-description-html: <p>Fare class.</p>
        concession:
          type: string
          description: Concession classification.
          examples:
            - full fare
            - elder
            - under 25
            - ...
          x-gitbook-description-html: <p>Concession classification.</p>
        concessionExpiry:
          type: string
          description: |
            Concession expiry date and time.<br/>
            Should be provided when it's meaningful (e.g. student, under 25...)
          format: date-time
          x-gitbook-description-html: >-
            <p>Concession expiry date and time.<br>

            Should be provided when it's meaningful (e.g. student, under
            25...)</p>
    productValidityParameters:
      type: object
      properties:
        numberOfTrips:
          $ref: '#/components/schemas/numberOfTrips'
        timeLimits:
          $ref: '#/components/schemas/timeLimits'
        validityAfterTapIn:
          $ref: '#/components/schemas/timePeriod'
          description: Time period for which a product is valid from when you first tap-in.
          x-gitbook-description-html: >-
            <p>Time period for which a product is valid from when you first
            tap-in.</p>
        validityAfterTapOut:
          $ref: '#/components/schemas/timePeriod'
          description: Time period for which a product can be used for after tap-out.
          x-gitbook-description-html: >-
            <p>Time period for which a product can be used for after
            tap-out.</p>
        zoneLimits:
          type: object
          properties:
            fromZone:
              $ref: '#/components/schemas/zone'
              description: Zone for which a product is valid for the start of the trip.
              x-gitbook-description-html: >-
                <p>Zone for which a product is valid for the start of the
                trip.</p>
            toZone:
              $ref: '#/components/schemas/zone'
              description: Zone for which a product is valid for the end of the trip.
              x-gitbook-description-html: >-
                <p>Zone for which a product is valid for the end of the
                trip.</p>
        stationLimits:
          type: object
          properties:
            fromStation:
              $ref: '#/components/schemas/station'
              description: Station for which a product is valid for the start of the trip.
              x-gitbook-description-html: >-
                <p>Station for which a product is valid for the start of the
                trip.</p>
            toStation:
              $ref: '#/components/schemas/station'
              description: Station for which a product is valid for the start of the trip.
              x-gitbook-description-html: >-
                <p>Station for which a product is valid for the start of the
                trip.</p>
        topupLimits:
          type: object
          properties:
            minAmount:
              type: number
              description: The minimum amount a user can topup at a time.
              format: float
              examples:
                - 5
              x-gitbook-description-html: <p>The minimum amount a user can topup at a time.</p>
            maxAmount:
              type: number
              description: The maximum amount a user can topup at a time.
              format: float
              examples:
                - 50
              x-gitbook-description-html: <p>The maximum amount a user can topup at a time.</p>
    numberOfTrips:
      type: number
      description: Number of trips a product can be used for.
      examples:
        - 10
      x-gitbook-description-html: <p>Number of trips a product can be used for.</p>
    timeLimits:
      type: object
      description: Specific time window within which the product is valid.
      properties:
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
      x-gitbook-description-html: <p>Specific time window within which the product is valid.</p>
    timePeriod:
      type: object
      properties:
        timeUnit:
          type: string
          enum:
            - second
            - minute
            - hour
            - day
            - week
            - month
            - year
        value:
          type: number
          description: Number of time units this period covers.
          x-gitbook-description-html: <p>Number of time units this period covers.</p>
    zone:
      type: object
      properties:
        id:
          type: string
          description: >
            Identifier that can be used to look up zone/region details on a
            separately shared zone/region list.
          x-gitbook-description-html: >-
            <p>Identifier that can be used to look up zone/region details on a
            separately shared zone/region list.</p>
        displayName:
          type: string
          description: |
            Default zone/region name that can be displayed to the user.
          x-gitbook-description-html: <p>Default zone/region name that can be displayed to the user.</p>
    station:
      type: object
      properties:
        id:
          type: string
          description: >
            Identifier that can be used to look up station details on a
            separately shared station list.
          examples:
            - Station_123
          x-gitbook-description-html: >-
            <p>Identifier that can be used to look up station details on a
            separately shared station list.</p>
        displayName:
          type: string
          description: |
            Default station name that can be displayed to the user.
          examples:
            - Marvelous Station
          x-gitbook-description-html: <p>Default station name that can be displayed to the user.</p>
    eligibleForTopup:
      type: boolean
      description: >
        Indicates that a top-up can be done for this product.<br/>Applies to
        **stored-value** products.
      default: true
      x-gitbook-description-html: >-
        <p>Indicates that a top-up can be done for this product.<br>Applies to
        <strong>stored-value</strong> products.</p>
    renewalPeriod:
      type: object
      description: >
        Period of time when a product can be renewed.<br/>Applies to
        **time-based** products.
      properties:
        startTime:
          type: string
          description: |
            Indicates that a product can be renewed after that date.
          format: date-time
          x-gitbook-description-html: <p>Indicates that a product can be renewed after that date.</p>
        relativeStartTime:
          type: integer
          minimum: 1
          description: >-
            Offset expressed in seconds.<br/>The product can be renewed
            "relativeStartTime" seconds before its expiration date.<br/>If a
            value is provided for **startTime**, this parameter will be ignored.
          x-gitbook-description-html: >-
            <p>Offset expressed in seconds.<br>The product can be renewed
            "relativeStartTime" seconds before its expiration date.<br>If a
            value is provided for <strong>startTime</strong>, this parameter
            will be ignored.</p>
        unavailableBeforeReason:
          type: string
          description: >-
            Indicates why a product cannot be renewed before the renewal
            starting time.
          examples:
            - Too soon
          x-gitbook-description-html: >-
            <p>Indicates why a product cannot be renewed before the renewal
            starting time.</p>
        endTime:
          type: string
          description: |
            Indicates that a product can be renewed before that date.
          format: date-time
          x-gitbook-description-html: <p>Indicates that a product can be renewed before that date.</p>
        relativeEndTime:
          type: integer
          minimum: 1
          description: >-
            Offset expressed in seconds.<br/>The product can be renewed
            "relativeEndTime" seconds after its expiration date.<br/>If a value
            is provided for **endTime**, this parameter will be ignored.
          x-gitbook-description-html: >-
            <p>Offset expressed in seconds.<br>The product can be renewed
            "relativeEndTime" seconds after its expiration date.<br>If a value
            is provided for <strong>endTime</strong>, this parameter will be
            ignored.</p>
        unavailableAfterReason:
          type: string
          description: >-
            Indicates why a product cannot be renewed after the renewal ending
            time.
          examples:
            - Too late
          x-gitbook-description-html: >-
            <p>Indicates why a product cannot be renewed after the renewal
            ending time.</p>
      x-gitbook-description-html: >-
        <p>Period of time when a product can be renewed.<br>Applies to
        <strong>time-based</strong> products.</p>
    NotifyDigitalCardEventReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        walletId:
          $ref: '#/components/schemas/walletId'
        userId:
          $ref: '#/components/schemas/userId'
          description: User unique identifier.<br/>Always provided for Apple.
          x-gitbook-description-html: <p>User unique identifier.<br>Always provided for Apple.</p>
        deviceType:
          $ref: '#/components/schemas/deviceType'
        event:
          type: string
          enum:
            - provisioning_success
            - provisioning_failure
            - lifecycle_success
            - lifecycle_failure
            - update_bundle_success
            - update_bundle_failure
            - update_bundle_data_success
            - update_bundle_data_failure
            - retrieve_bundle_data_success
            - retrieve_bundle_data_failure
        eventData:
          type: object
          description: >
            Object containing contextual information based on ```event```
            value.<br/>For **Calypso** card technology, in case of
            ```provisioning_success```, it will contain the CSN:
            ```{"csn":"000000006818F4EB"}```<br/><br/>In case of failure, it may
            contain ```statusCode``` and ```statusMessage``` to provide more
            details:<br/>```{"statusCode":431,"statusMessage":"Error XYZ"}```
          x-gitbook-description-html: >-
            <p>Object containing contextual information based on
            <code>event</code> value.<br>For <strong>Calypso</strong> card
            technology, in case of <code>provisioning_success</code>, it will
            contain the CSN: <code>{"csn":"000000006818F4EB"}</code><br><br>In
            case of failure, it may contain <code>statusCode</code> and
            <code>statusMessage</code> to provide more
            details:<br><code>{"statusCode":431,"statusMessage":"Error
            XYZ"}</code></p>
        digitalCardBundle:
          $ref: '#/components/schemas/digitalCardBundle'
      required:
        - requestContext
        - digitalCardId
        - cardAccountId
        - event
    digitalCardBundle:
      type: string
      description: Last known state of the digital card bundle.<br/>Applicable to CBT only.
      x-gitbook-description-html: >-
        <p>Last known state of the digital card bundle.<br>Applicable to CBT
        only.</p>
    NotifyDigitalCardEventRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
      required:
        - responseContext
    ManageDigitalCardReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        action:
          type: string
          enum:
            - unlink
            - suspend
            - resume
            - delete
        initiator:
          type: string
          description: Indicates whether the action is initiated from the device or via cloud interface.<br/>Applicable to 'unlink' action and CBT only.
          enum:
            - device
            - cloud
      required:
        - requestContext
        - digitalCardId
        - cardAccountId
        - action
    ManageDigitalCardRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
      required:
        - responseContext
    GetCardAccountMetadataReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
      required:
        - requestContext
        - cardAccountId
    GetCardAccountMetadataRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        displayCardValue:
          $ref: '#/components/schemas/displayCardValue'
        cardArtsId:
          $ref: '#/components/schemas/cardArtsId'
        productsList:
          type: array
          description: >
            List of products attached to the card account.<br/>It should be
            ordered as in some cases, the first item of the list may be used for
            display purpose.<br/>For example, user will only see the first item
            of the list for identifying which card account will be restored in
            Apple case. 
          minItems: 1
          items:
            type: object
            properties:
              productId:
                $ref: '#/components/schemas/productId'
              productType:
                $ref: '#/components/schemas/productType'
              displayName:
                $ref: '#/components/schemas/localizedString'
                description: |
                  Localized product display name.
                x-gitbook-description-html: <p>Localized product display name.</p>
              displayDetails:
                $ref: '#/components/schemas/localizedString'
                description: |
                  Localized product display details.
                x-gitbook-description-html: <p>Localized product display details.</p>
              fare:
                $ref: '#/components/schemas/fare'
                description: |
                  Product fare.
                x-gitbook-description-html: <p>Product fare.</p>
              lastUpdatedTime:
                type: string
                description: |
                  Last known date and time of the product value update.
                format: date-time
                x-gitbook-description-html: <p>Last known date and time of the product value update.</p>
              purchaseDetails:
                $ref: '#/components/schemas/purchaseDetails'
                description: |
                  Product purchase details.
                x-gitbook-description-html: <p>Product purchase details.</p>
              validityParameters:
                $ref: '#/components/schemas/productValidityParameters'
                description: |
                  Product validity parameters.
                x-gitbook-description-html: <p>Product validity parameters.</p>
              renewalPeriod:
                $ref: '#/components/schemas/renewalPeriod'
              balanceDetails:
                $ref: '#/components/schemas/balanceDetails'
              eligibleForTopup:
                $ref: '#/components/schemas/eligibleForTopup'
            required:
              - productId
              - productType
              - displayName
              - lastUpdatedTime
          x-gitbook-description-html: >-
            <p>List of products attached to the card account.<br>It should be
            ordered as in some cases, the first item of the list may be used for
            display purpose.<br>For example, user will only see the first item
            of the list for identifying which card account will be restored in
            Apple case.</p>
      required:
        - responseContext
        - displayCardValue
    purchaseDetails:
      type: object
      properties:
        purchaseId:
          $ref: '#/components/schemas/purchaseId'
        purchaseTime:
          type: string
          description: Purchase date and time of the product.
          format: date-time
          x-gitbook-description-html: <p>Purchase date and time of the product.</p>
        price:
          $ref: '#/components/schemas/amount'
          description: Price of the product
          x-gitbook-description-html: <p>Price of the product</p>
        currencyCode:
          $ref: '#/components/schemas/currencyCode'
        repurchaseUrl:
          type: string
          description: URL to allow the repurchase of the product
          examples:
            - https://mytransitoperator/repurchase
          x-gitbook-description-html: <p>URL to allow the repurchase of the product</p>
        refundUrl:
          type: string
          description: URL to allow the refund of the product
          examples:
            - https://mytransitoperator/refund
          x-gitbook-description-html: <p>URL to allow the refund of the product</p>
    purchaseId:
      type: string
      description: Purchase unique identifier
      maxLength: 64
      examples:
        - P20160107_123456
      x-gitbook-description-html: <p>Purchase unique identifier</p>
    amount:
      type: number
      description: Amount
      format: float
      examples:
        - 12.9
      x-gitbook-description-html: <p>Amount</p>
    currencyCode:
      type: string
      description: The 3-letter currency code defined in ISO 4217
      pattern: ^[A-Za-z]{3}$
      examples:
        - EUR
      x-gitbook-description-html: <p>The 3-letter currency code defined in ISO 4217</p>
    balanceDetails:
      type: object
      description: |
        Product balance details.
      properties:
        amount:
          $ref: '#/components/schemas/amount'
        currencyCode:
          $ref: '#/components/schemas/currencyCode'
      x-gitbook-description-html: <p>Product balance details.</p>
    PurchaseProductsReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        userId:
          $ref: '#/components/schemas/userId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        orderId:
          type: string
          description: Order unique identifier
          maxLength: 64
          x-gitbook-description-html: <p>Order unique identifier</p>
        purchaseItems:
          type: array
          minItems: 1
          items:
            oneOf:
              - $ref: '#/components/schemas/PurchasableProduct'
              - $ref: '#/components/schemas/ExistingProduct'
        paymentCredentials:
          type: object
          description: >
            Payment credentials encrypted with PSP key.         

            Clear format is defined as per wallet specification
            [here](https://docs.payments.thalescloud.io/transit-digitization/get-started/concepts/payments).            
          x-gitbook-description-html: >-
            <p>Payment credentials encrypted with PSP key.<br>

            Clear format is defined as per wallet specification <a
            href="https://docs.payments.thalescloud.io/transit-digitization/get-started/concepts/payments">here</a>.</p>
        totalAmount:
          $ref: '#/components/schemas/amount'
        currencyCode:
          $ref: '#/components/schemas/currencyCode'
      required:
        - requestContext
        - cardAccountId
        - digitalCardId
        - orderId
        - purchaseItems
        - paymentCredentials
        - totalAmount
        - currencyCode
    PurchasableProduct:
      type: object
      title: PurchasableProduct
      properties:
        purchasableProductId:
          $ref: '#/components/schemas/productId'
        amount:
          $ref: '#/components/schemas/amount'
      required:
        - purchasableProductId
        - amount
    ExistingProduct:
      type: object
      title: ExistingProduct
      properties:
        existingProductId:
          $ref: '#/components/schemas/productId'
        amount:
          $ref: '#/components/schemas/amount'
      required:
        - existingProductId
        - amount
    PurchaseProductsRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        purchaseId:
          $ref: '#/components/schemas/purchaseId'
      required:
        - responseContext
    GetPurchasableProductsReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
          description: >
            Card account unique identifier.<br/>

            Not provided when Google is fetching the list of purchasable
            products for initial provisionings (done on daily basis).

            <br/>Always provided otherwise.
          x-gitbook-description-html: >-
            <p>Card account unique identifier.<br>

            Not provided when Google is fetching the list of purchasable
            products for initial provisionings (done on daily basis).

            <br>Always provided otherwise.</p>
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        productId:
          $ref: '#/components/schemas/productId'
          description: >
            Unique identifier of a time based product.<br/>Provided when
            checking renewal options of this product.
          x-gitbook-description-html: >-
            <p>Unique identifier of a time based product.<br>Provided when
            checking renewal options of this product.</p>
        digitalCardBundle:
          $ref: '#/components/schemas/digitalCardBundle'
      required:
        - requestContext
    GetPurchasableProductsRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        purchasableProducts:
          type: array
          description: >
            List of purchasable products.<br/>It shall not contain more than 1
            item if **productId** is provided in the request.
          items:
            type: object
            properties:
              productId:
                $ref: '#/components/schemas/productId'
                description: >
                  Product unique identifier.<br/>It shall be the **productId**
                  value from the request if it's provided. 
                x-gitbook-description-html: >-
                  <p>Product unique identifier.<br>It shall be the
                  <strong>productId</strong> value from the request if it's
                  provided.</p>
              productType:
                $ref: '#/components/schemas/productType'
              displayName:
                $ref: '#/components/schemas/localizedString'
              displayDetails:
                $ref: '#/components/schemas/localizedString'
              salePeriod:
                type: object
                properties:
                  startDate:
                    type: string
                    format: date-time
                  endDate:
                    type: string
                    format: date-time
              prices:
                $ref: '#/components/schemas/productPrices'
              fare:
                $ref: '#/components/schemas/fare'
              validityParameters:
                $ref: '#/components/schemas/productValidityParameters'
              eligibleForTopup:
                $ref: '#/components/schemas/eligibleForTopup'
            required:
              - productId
              - productType
              - displayName
              - prices
          x-gitbook-description-html: >-
            <p>List of purchasable products.<br>It shall not contain more than 1
            item if <strong>productId</strong> is provided in the request.</p>
      required:
        - responseContext
    productPrices:
      type: object
      properties:
        totalCost:
          type: number
          description: Total cost of the product.
          format: float
          examples:
            - 29.7
          x-gitbook-description-html: <p>Total cost of the product.</p>
        currencyCode:
          $ref: '#/components/schemas/currencyCode'
        receiptItems:
          type: array
          description: |
            List of individual receipt item for that product.
          items:
            type: object
            properties:
              costType:
                type: string
                enum:
                  - tax
                  - card_price
                  - product_price
                  - discount
              amount:
                $ref: '#/components/schemas/amount'
          x-gitbook-description-html: <p>List of individual receipt item for that product.</p>
      required:
        - totalCost
        - currencyCode
    RegisterCardAccountReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        tokenData:
          type: string
          description: >
            Encrypted Token Data about the token the user wants to
            register.<br/> It is encrypted using the JWE encryption (please
            refer to [Encrypt Sensitive
            Data](https://docs.payments.thalescloud.io/transit-digitization/integrate-d1-transit-api/encrypt-sensitive-data)
            section for more details).<br/>

            The JSON object that is encrypted is defined as follows:

            |JSON field parameter name|description|

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

            |pan|The token PAN value (up to 19 numeric digits)|

            |expiryMonth|The expiry month of the token in MM format|

            |expiryYear|The expiry year of the token in YYYY format|
          x-gitbook-description-html: >-
            <p>Encrypted Token Data about the token the user wants to
            register.<br> It is encrypted using the JWE encryption (please refer
            to <a
            href="https://docs.payments.thalescloud.io/transit-digitization/integrate-d1-transit-api/encrypt-sensitive-data">Encrypt
            Sensitive Data</a> section for more details).<br>

            The JSON object that is encrypted is defined as follows:</p>






















            <table><thead><tr><th>JSON field parameter
            name</th><th>description</th></tr></thead><tbody><tr><td>pan</td><td>The
            token PAN value (up to 19 numeric
            digits)</td></tr><tr><td>expiryMonth</td><td>The expiry month of the
            token in MM format</td></tr><tr><td>expiryYear</td><td>The expiry
            year of the token in YYYY format</td></tr></tbody></table>
        tokenId:
          $ref: '#/components/schemas/tokenId'
          description: >-
            Token unique identifier.<br/>Provided only in case of
            re-registration.
          x-gitbook-description-html: >-
            <p>Token unique identifier.<br>Provided only in case of
            re-registration.</p>
      required:
        - requestContext
        - cardAccountId
        - digitalCardId
        - tokenData
    tokenId:
      type: string
      description: Token unique identifier
      maxLength: 64
      examples:
        - 63a0c6dd-2993-49f3-b6ac-9721fbe0877e
      x-gitbook-description-html: <p>Token unique identifier</p>
    RegisterCardAccountRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        tokenId:
          $ref: '#/components/schemas/tokenId'
          description: >-
            Token unique identifier.<br/>It's the value identified by payment
            gateway thanks to ```tokenData``` provided as input.
          x-gitbook-description-html: >-
            <p>Token unique identifier.<br>It's the value identified by payment
            gateway thanks to <code>tokenData</code> provided as input.</p>
      required:
        - responseContext
    GetDigitalCardBundleCommandsReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        responses:
          type: array
          description: |
            Responses of the commands executed on the device.
          maxItems: 100
          items:
            type: object
            properties:
              id:
                type: string
                description: |
                  ID of the command that has been executed.
                x-gitbook-description-html: <p>ID of the command that has been executed.</p>
              value:
                type: string
                description: Command response.
                x-gitbook-description-html: <p>Command response.</p>
          x-gitbook-description-html: <p>Responses of the commands executed on the device.</p>
        incompletedExecution:
          type: boolean
          description: >
            Flag indicating that the commands from previous ```responses```
            array were not all executed successfully.
          x-gitbook-description-html: >-
            <p>Flag indicating that the commands from previous
            <code>responses</code> array were not all executed successfully.</p>
      required:
        - requestContext
        - digitalCardId
        - cardAccountId
    GetDigitalCardBundleCommandsRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        commands:
          type: array
          description: List of commands to be executed on the device.
          maxItems: 100
          items:
            type: object
            properties:
              id:
                type: string
                description: ID of the command to be executed.
                x-gitbook-description-html: <p>ID of the command to be executed.</p>
              value:
                type: string
                description: Value of the command.
                x-gitbook-description-html: <p>Value of the command.</p>
          x-gitbook-description-html: <p>List of commands to be executed on the device.</p>
      required:
        - responseContext
    GetTransactionsReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        lastUpdatedTime:
          type: string
          description: >
            Value that should be used to provide updates that occurred since
            that time.
          format: date-time
          x-gitbook-description-html: >-
            <p>Value that should be used to provide updates that occurred since
            that time.</p>
      required:
        - requestContext
        - cardAccountId
    GetTransactionsRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
    Transaction:
      type: object
      title: Transaction
      properties:
        transactionId:
          type: string
          description: Transaction unique identifier
          maxLength: 64
          examples:
            - 9272c57d-e911-460b-9be8-6ceb6f21fcf7
          x-gitbook-description-html: <p>Transaction unique identifier</p>
        transactionDateTime:
          type: string
          description: Date and time when the transaction occurred.
          format: date-time
          x-gitbook-description-html: <p>Date and time when the transaction occurred.</p>
        transactionStatus:
          type: string
          enum:
            - pending
            - approved
            - declined
            - refunded
          description: >
            |<b>Status</b>|<b>Description</b>|

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

            |pending|transaction is pre-authorized, <br/>for example, trip has
            started but amount is not known yet.|

            |approved|transaction has been authorized.|

            |declined|transaction has been declined.|

            |refunded|transaction has been refunded.|
          x-gitbook-description-html: >-

























            <table><thead><tr><th><b>Status</b></th><th><b>Description</b></th></tr></thead><tbody><tr><td>pending</td><td>transaction
            is pre-authorized, <br>for example, trip has started but amount is
            not known yet.</td></tr><tr><td>approved</td><td>transaction has
            been authorized.</td></tr><tr><td>declined</td><td>transaction has
            been declined.</td></tr><tr><td>refunded</td><td>transaction has
            been refunded.</td></tr></tbody></table>
        transactionType:
          type: string
          enum:
            - purchase
            - topup
            - renewal
            - refund
            - ride
            - withdrawal
            - surcharge
          description: |
            |<b>Type</b>|<b>Description</b>|
            |-------|-------|
            |purchase|purchase of a new product|
            |topup|value added to existing product|
            |renewal|extend date of a time-based product|
            |refund|value refunded to card account|
            |ride|transit ride|
            |withdrawal|value removed from card account and returned to user|
            |surcharge|value debited from card account|
          x-gitbook-description-html: >-





































            <table><thead><tr><th><b>Type</b></th><th><b>Description</b></th></tr></thead><tbody><tr><td>purchase</td><td>purchase
            of a new product</td></tr><tr><td>topup</td><td>value added to
            existing product</td></tr><tr><td>renewal</td><td>extend date of a
            time-based product</td></tr><tr><td>refund</td><td>value refunded to
            card account</td></tr><tr><td>ride</td><td>transit
            ride</td></tr><tr><td>withdrawal</td><td>value removed from card
            account and returned to
            user</td></tr><tr><td>surcharge</td><td>value debited from card
            account</td></tr></tbody></table>
        merchantName:
          type: string
          description: Card issuer merchant name
          examples:
            - My Transit Operator
          x-gitbook-description-html: <p>Card issuer merchant name</p>
        rawMerchantName:
          type: string
          description: >-
            Raw card issuer merchant name as seen on a customer's bank
            statement.
          examples:
            - MY_TRANSIT_OPER
          x-gitbook-description-html: >-
            <p>Raw card issuer merchant name as seen on a customer's bank
            statement.</p>
        zipCode:
          type: string
          description: Zip code where the transaction occurred.
          examples:
            - '15899'
          x-gitbook-description-html: <p>Zip code where the transaction occurred.</p>
        countryCode:
          type: string
          description: Two letters ISO 3166 country code where the transaction occurred
          pattern: ^[A-Za-z]{2}$
          examples:
            - FR
          x-gitbook-description-html: >-
            <p>Two letters ISO 3166 country code where the transaction
            occurred</p>
        city:
          type: string
          description: City where the transaction occurred.
          examples:
            - Nice
          x-gitbook-description-html: <p>City where the transaction occurred.</p>
        address:
          type: string
          description: Street number and name where the transaction occurred.
          examples:
            - Welcome street, 125
          x-gitbook-description-html: <p>Street number and name where the transaction occurred.</p>
        totalAmount:
          $ref: '#/components/schemas/amount'
          description: Total amount
          x-gitbook-description-html: <p>Total amount</p>
        currencyCode:
          $ref: '#/components/schemas/currencyCode'
        productId:
          $ref: '#/components/schemas/productId'
          description: |
            Unique identifier of the product involved in the transaction
          x-gitbook-description-html: <p>Unique identifier of the product involved in the transaction</p>
        localizedTitle:
          $ref: '#/components/schemas/localizedString'
        localizedDescription:
          $ref: '#/components/schemas/localizedString'
        rideDetails:
          type: array
          description: >-
            Array of chronologically ordered events involved in the
            transaction.<br/>For example, for tap-in/tap-out transaction, two
            events shall be present.<br/>Shall be provided when transactionType
            is "<b>ride</b>"
          minItems: 1
          items:
            type: object
            title: RideDetails
            properties:
              eventDateTime:
                type: string
                description: Date and time of the transit event.
                format: date-time
                x-gitbook-description-html: <p>Date and time of the transit event.</p>
              transitType:
                type: string
                enum:
                  - bus
                  - subway
                  - train
                  - ferry
                  - tram
                  - taxi
                  - bike
                  - funicular
                  - cable-tram
                  - aerial-lift
                  - trolleybus
                  - monorail
                description: Type of transportation mean.
                x-gitbook-description-html: <p>Type of transportation mean.</p>
              eventType:
                type: string
                enum:
                  - tap
                  - tap-in
                  - tap-out
                  - transfer
                description: Type of transit event.
                x-gitbook-description-html: <p>Type of transit event.</p>
              station:
                $ref: '#/components/schemas/station'
              discounts:
                type: array
                description: Discounts applied to the transaction.
                minItems: 1
                items:
                  type: string
                  enum:
                    - route
                    - transfer
                    - fare_capping
                x-gitbook-description-html: <p>Discounts applied to the transaction.</p>
              amount:
                $ref: '#/components/schemas/amount'
                description: Transit event amount.
                x-gitbook-description-html: <p>Transit event amount.</p>
              originalAmount:
                $ref: '#/components/schemas/amount'
                description: Original amount before applying adjustements.
                x-gitbook-description-html: <p>Original amount before applying adjustements.</p>
              incompleteJourneyStatus:
                type: string
                enum:
                  - resolved
                  - unresolved
                description: >-
                  Flag indicating that a trip is incomplete.<br/>Set when tap_in
                  event is missing a tap_out event.
                x-gitbook-description-html: >-
                  <p>Flag indicating that a trip is incomplete.<br>Set when
                  tap_in event is missing a tap_out event.</p>
          x-gitbook-description-html: >-
            <p>Array of chronologically ordered events involved in the
            transaction.<br>For example, for tap-in/tap-out transaction, two
            events shall be present.<br>Shall be provided when transactionType
            is "<b>ride</b>"</p>
      required:
        - transactionId
        - transactionDateTime
        - transactionStatus
        - transactionType
    GetMessagesReq:
      type: object
      properties:
        requestContext:
          $ref: '#/components/schemas/requestContext'
        digitalCardId:
          $ref: '#/components/schemas/digitalCardId'
        cardAccountId:
          $ref: '#/components/schemas/cardAccountId'
        lastUpdatedTime:
          type: string
          description: >
            Value that should be used to provide updates that occurred since
            that time.
          format: date-time
          x-gitbook-description-html: >-
            <p>Value that should be used to provide updates that occurred since
            that time.</p>
      required:
        - requestContext
        - cardAccountId
    GetMessagesRes:
      type: object
      properties:
        responseContext:
          $ref: '#/components/schemas/responseContext'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
    Message:
      type: object
      title: Message
      properties:
        messageId:
          type: string
          description: Unique identifier of the message
          maxLength: 64
          x-gitbook-description-html: <p>Unique identifier of the message</p>
        startDateTime:
          type: string
          description: Date and time when the message starts being displayed to user.
          format: date-time
          x-gitbook-description-html: >-
            <p>Date and time when the message starts being displayed to
            user.</p>
        endDateTime:
          type: string
          description: Date and time when the message stops being displayed to user.
          format: date-time
          x-gitbook-description-html: <p>Date and time when the message stops being displayed to user.</p>
        messageType:
          type: string
          enum:
            - alert
            - info
            - promotion
          description: Message type indicator.
          x-gitbook-description-html: <p>Message type indicator.</p>
        localizedHeader:
          $ref: '#/components/schemas/localizedString'
          description: Localized header to be displayed to the user.
          x-gitbook-description-html: <p>Localized header to be displayed to the user.</p>
        localizedMessage:
          $ref: '#/components/schemas/localizedString'
          description: Localized message to be displayed to the user.
          x-gitbook-description-html: <p>Localized message to be displayed to the user.</p>
        navigationTarget:
          type: string
          description: A target to navigate the user to when tapping a message.
          x-gitbook-description-html: <p>A target to navigate the user to when tapping a message.</p>
      required:
        - messageId
        - startDateTime
        - endDateTime
        - messageType
        - localizedMessage
