{
  "openapi": "3.0.0",
  "info": {
    "title": "Inbound Digital Card API",
    "version": "1.0",
    "description": "D1 Services API - Digital Card API\nThis API is used by the backend to search Digital Card as well as requesting operation on Digital Cards",
    "contact": {
      "name": "Thales Support",
      "url": "https://www.thalesgroup.com/en/markets/digital-identity-and-security",
      "email": "thalessupport@thalesgroup.com"
    }
  },
  "servers": [
    {
      "url": "https://api.d1.thalescloud.io/banking/v1",
      "description": "Production server"
    },
    {
      "url": "https://api.d1-stg.thalescloud.io/banking/v1",
      "description": "Staging server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Operations",
      "description": "Different operations that can be done on a digital card."
    }
  ],
  "paths": {
    "/issuers/{issuerId}/digitalCards/{digitalCardId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id"
        }
      ],
      "get": {
        "summary": "Get details",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "parentCardId": {
                          "$ref": "#/components/schemas/cardId"
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/DigitalCardDetails"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "operationId": "get-digital-card-information",
        "description": "This request provides detailed information about the digital card  given its card identifier."
      }
    },
    "/issuers/{issuerId}/digitalCards:search": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the issuer backend to search for digital cards in D1 using a digital PAN as lookup and retrieve card & end user related details.\nFor example this can be used to retrieve detailed information about the digital card.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/encryptedDataCriteria"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "": {
                      "$ref": "#/components/schemas/DigitalCardReference"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "Search",
        "operationId": "searchDigitalCard"
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/credentials": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "get": {
        "summary": "Get credentials",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentials": {
                      "$ref": "#/components/schemas/credentials"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "operationId": "get-token-credentials",
        "description": "This request is used by D1 to provide details about the token credentials of a digital card (that is, PAN, expiry date) given the card identifier.\n\n<!-- theme: info -->\n>### Note\n> The issuer system must be configured with the correct applicative encryption key in order to use this API. \n>"
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations:resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the issuer backend to request <br/>- the activation of the digital card if it has never been activated<br/>- the resumption of the digital card if the digital card is suspended<br/>The result of this operation is synchronous from a TSP point of view (a successful response means that the digital card has been successfully resumed on the TSP itself) but does not guarantee that any update has occurred yet on the device, an optional notification will be sent on successful/unsuccessful completion of the operation on the wallet.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/resumeOperationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful card resumption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "Resume",
        "tags": [
          "Operations"
        ],
        "operationId": "activateDigitalCard"
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations:approvebinding": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the Issuer backend to approve an association between a device and a digital card.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/approvebindingOperationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful device binding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationStatusSuccessful"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "Bind",
        "tags": [
          "Operations"
        ],
        "operationId": "bindDigitalCard",
        "x-internal": true
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations:stepupAuthenticationResult": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the Issuer backend to approve a stepup authentication request (Device Binding/Cardholder Verification).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/stepupAuthOperationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Step-up authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationStatusSuccessful"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "StepUp Auth Result",
        "tags": [
          "Operations"
        ],
        "operationId": "stepupAuthResult"
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations:unbind": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the Issuer backend to unbind a digital card and a device.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/unbindOperationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful device binding removal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationStatusSuccessful"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "Unbind",
        "tags": [
          "Operations"
        ],
        "operationId": "unbindDigitalCard",
        "x-internal": true
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations:suspend": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the issuer backend to request the suspension of the digital card if the digital card is active.<br/>The result of this operation is synchronous from a TSP point of view (a successful response means that the digital card has been successfully suspended on the TSP itself) but does not guarantee that any update has occurred yet on the device, an optional notification will be sent on successful/unsuccessful completion of the operation on the wallet.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/operationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful card suspension request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "Suspend",
        "tags": [
          "Operations"
        ],
        "operationId": "deactivatedigitalCard"
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations:delete": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by the issuer backend to request the deletion of the digital card.<br/>The result of this operation is synchronous from a TSP point of view (a successful response means that digital card has been successfully deleted on the TSP itself) but does not guarantee that any update has occurred yet on the device, an optional notification will be sent on successful/unsuccessful completion of the operation on the wallet.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/operationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful card deletion request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "summary": "Delete",
        "tags": [
          "Operations"
        ],
        "operationId": "deleteDigitalCard"
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations/{operationId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/operation-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id"
        }
      ],
      "get": {
        "summary": "Get operation",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/operationDigitalCard"
                },
                "examples": {}
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "get-digital-card-operation-operationId",
        "description": "Retrieves the information related to an operation for a digital card."
      }
    },
    "/issuers/{issuerId}/digitalCards/{digitalCardId}/operations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/digital-card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id"
        }
      ],
      "get": {
        "summary": "Get all operations",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "operations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/operationDigitalCard"
                      }
                    },
                    "remainingOperations": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "get-all-digital-card-operations-by-cardId",
        "parameters": [
          {
            "$ref": "#/components/parameters/offset-query-2"
          },
          {
            "$ref": "#/components/parameters/limit-query-2"
          }
        ],
        "description": "Retrieves all the operations related to a digital card. The API specifies the starting point (offset) and the number of operations (limit) to be retrieved. Offset 0 (the default) corresponds to the most recent operation. For example a limit of 5 and an offset of 2 would return the five most recent operations before the most recent two”.\nIf no operations are available for the given digitalCardId, an empty list is returned."
      }
    }
  },
  "components": {
    "schemas": {
      "operationDigitalCard": {
        "title": "operationDigitalCard",
        "type": "object",
        "description": "Operation details related to a specific operationId",
        "x-examples": {
          "example-1": {
            "operationId": "string",
            "operationType": "ACTIVATE",
            "status": "SUCCESSFUL",
            "startTime": "string",
            "endTime": "string",
            "requestorId": "string",
            "requestorType": "ISSUER",
            "reason": "string",
            "reasonCode": "USER_DECISION",
            "details": {
              "bindingInformation": {
                "checks": {
                  "typeNotSupported": {
                    "result": "YES"
                  },
                  "manufacturerNotSupported": {
                    "result": "YES"
                  },
                  "osVersionNotSupported": {
                    "result": "YES"
                  },
                  "osBuildVersionNotSupported": {
                    "result": "YES"
                  }
                },
                "result": {
                  "flow": "RED",
                  "idAndVMethods": {
                    "supported": [
                      "string"
                    ],
                    "selected": "string"
                  }
                },
                "deviceReference": "string",
                "deviceName": "string"
              }
            }
          }
        },
        "properties": {
          "operationId": {
            "$ref": "#/components/schemas/operationId"
          },
          "operation": {
            "type": "string",
            "description": "The operation type.",
            "enum": [
              "ACTIVATE",
              "SUSPEND",
              "RESUME",
              "DELETE",
              "RENEW",
              "BIND",
              "UNBIND"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "SUCCESSFUL",
              "PENDING",
              "FAILED"
            ],
            "description": "Status of the operation"
          },
          "startTime": {
            "$ref": "#/components/schemas/timeStampRequest"
          },
          "endTime": {
            "$ref": "#/components/schemas/timeStampRequest"
          },
          "requestorId": {
            "type": "string",
            "description": "Identifier of the principal who initiates the operation\n    - consumerId if USER\n    - issuerId if ISSUER\n    - cci user id if CCI"
          },
          "requestorType": {
            "type": "string",
            "enum": [
              "ISSUER",
              "USER",
              "TSP",
              "CCI"
            ]
          },
          "reason": {
            "type": "string"
          },
          "reasonCode": {
            "type": "string",
            "enum": [
              "USER_DECISION",
              "ISSUER_DECISION",
              "DEVICE_LOST",
              "DEVICE_STOLEN",
              "CARD_LOST",
              "CARD_STOLEN",
              "CARD_BROKEN"
            ]
          },
          "details": {
            "type": "object",
            "description": "Container to hold any detailed information regarding the executed operation",
            "properties": {
              "bindingInformation": {
                "$ref": "#/components/schemas/bindingInformation"
              }
            }
          },
          "error": {
            "type": "string",
            "description": "Human readable string representing the error, only present in case of operation failure"
          }
        },
        "required": [
          "operationId",
          "operation",
          "status",
          "startTime",
          "requestorId",
          "requestorType"
        ]
      },
      "digitalCardInformation": {
        "title": "digitalCardInformation",
        "type": "object",
        "description": "Provides information about the token. Note that this data is available only if the tokenization is successful or pending.",
        "properties": {
          "digitalCardId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Unique identifier of the token specified by the TSP"
          },
          "panSuffix": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4,
            "description": "Last four digits of the token"
          },
          "state": {
            "$ref": "#/components/schemas/digitalCardState"
          },
          "type": {
            "$ref": "#/components/schemas/tokenType"
          },
          "deviceBindingList": {
            "type": "array",
            "description": "List of all devices bound to this token. A device is represented by its binding reference.",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "provisioningTime": {
            "type": "string",
            "maxLength": 32,
            "description": "The provisioning time of the token. Format ISO 8601 YYYY-MM-DDThh:mm:ssTZD"
          },
          "lastReplenishTime": {
            "type": "string",
            "maxLength": 32,
            "description": "The last time the token keys have been replenished. Format ISO 8601 YYYY-MM-DDThh:mm:ssTZD"
          },
          "lastStateChangeTime": {
            "type": "string",
            "maxLength": 32,
            "description": "The last time the token status has been changed. Format ISO 8601 YYYY-MM-DDThh:mm:ssTZD"
          }
        },
        "required": [
          "digitalCardId",
          "panSuffix",
          "state"
        ]
      },
      "credentials": {
        "type": "string",
        "title": "credentials",
        "description": "The field is the json (cf http://www.json.org/ ) representation of the DIGITAL card.\nJWE encryption is used to secure the field (please refer to the [Encrypt sensitive data](../../../integrate-the-d1-api/encrypt-sensitive-data) for more details)\nDetails:\n\n{\n\n  \"pan\":\"...\",\n  \n  \"exp\":\"...\"\n  \n}\n\n\nThe PAN is Mandatory,  up to 19 digits.\n\nThe expiry date in the format MMYY. It is not provided for UPI scheme.",
        "minLength": 1,
        "maxLength": 8196
      },
      "encryptedDataCriteria": {
        "type": "object",
        "title": "encryptedDataCriteria",
        "properties": {
          "encryptedData": {
            "type": "string",
            "title": "encryptedCardData",
            "maxLength": 8192,
            "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$",
            "description": "Ciphered digital PAN, this DPAN is encrypted using the JWE encryption (please refer to the [Encrypt sensitive data](../../../integrate-the-d1-api/encrypt-sensitive-data) for more details)<br/><br/><b>Content</b><br/><br/>Once deciphered, the plaintext contains:\n\t\n|JSON field parameter name|type|description|MOC|Length|\n|-------|-------|-------|-------|-------|\n|pan|String|The digital pan value.|M|Up to 19|"
          },
          "searchType": {
            "type": "string",
            "description": "The search type",
            "enum": [
              "encryptedData"
            ]
          }
        },
        "required": [
          "encryptedData"
        ]
      },
      "deviceIdCriteria": {
        "type": "object",
        "title": "deviceIdCriteria",
        "properties": {
          "deviceId": {
            "$ref": "#/components/schemas/deviceId"
          },
          "searchType": {
            "type": "string",
            "enum": [
              "deviceId"
            ]
          }
        }
      },
      "deviceId": {
        "type": "string",
        "description": "Unique identifier of the device",
        "minLength": 1,
        "maxLength": 128
      },
      "DigitalCardDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/digitalCardInformation"
          },
          {
            "type": "object",
            "properties": {
              "digitalCardRequestorInformation": {
                "$ref": "#/components/schemas/digitalCardRequestorInformation"
              },
              "deviceInformation": {
                "$ref": "#/components/schemas/deviceInformation"
              }
            }
          }
        ]
      },
      "lifeCycleInformation": {
        "title": "lifeCycleInformation",
        "type": "object",
        "description": "Provides details about a performed life cycle operation.",
        "properties": {
          "state": {
            "$ref": "#/components/schemas/cardState"
          },
          "requestorStateChange": {
            "type": "string",
            "description": "The entity who required the change. Following values are possible:\n- ISSUER\n- USER",
            "minLength": 1,
            "maxLength": 16
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The reason why the action was performed. Human readable text"
          },
          "reasonCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "enum": [
              "USER_DECISION",
              "ISSUER_DECISION",
              "DEVICE_LOST",
              "DEVICE_STOLEN",
              "CARD_LOST",
              "CARD_STOLEN"
            ]
          },
          "digitalCardRequestorInformation": {
            "$ref": "#/components/schemas/digitalCardRequestorInformation"
          }
        },
        "required": [
          "state",
          "requestorStateChange"
        ]
      },
      "bindingInformation": {
        "type": "object",
        "description": "Provides details about the binding operation whatever the result (i.e. successful, pending or cancelled)",
        "title": "bindingInformation",
        "properties": {
          "checks": {
            "type": "object",
            "properties": {
              "typeNotSupported": {
                "$ref": "#/components/schemas/result"
              },
              "manufacturerNotSupported": {
                "$ref": "#/components/schemas/result"
              },
              "osVersionNotSupported": {
                "$ref": "#/components/schemas/result"
              },
              "osBuildVersionNotSupported": {
                "$ref": "#/components/schemas/result"
              }
            }
          },
          "result": {
            "type": "object",
            "required": [
              "flow"
            ],
            "properties": {
              "flow": {
                "type": "string",
                "description": "Following values are possible:\n- RED\n- GREEN\n- YELLOW",
                "minLength": 1,
                "maxLength": 64,
                "enum": [
                  "RED",
                  "GREEN",
                  "YELLOW"
                ]
              },
              "idAndVMethods": {
                "$ref": "#/components/schemas/idAndVMethods"
              }
            }
          },
          "deviceReference": {
            "type": "string",
            "maxLength": 128,
            "description": "The index number from TSP where the \ndeviceID is stored. This field is required for digital card device binding. "
          },
          "deviceName": {
            "type": "string",
            "maxLength": 128,
            "description": "A readable name for the device. Ideally, the end user enters\nthis name. It can be used to identify the device in customer support calls."
          }
        },
        "required": [
          "result"
        ]
      },
      "timeStampRequest": {
        "type": "string",
        "title": "timeStampRequest",
        "description": "The time the request has been processed.\nFormat ISO 8601 YYYY-MM-DDThh:mm:ssTZD",
        "minLength": 1,
        "maxLength": 64
      },
      "approvebindingOperationRequest": {
        "description": "Approve binding request",
        "type": "object",
        "title": "approvebindingOperationRequest",
        "properties": {
          "deviceReference": {
            "$ref": "#/components/schemas/deviceReference"
          },
          "reason": {
            "type": "string",
            "description": "The reason why the action is performed.",
            "pattern": "^[a-zA-Z0-9]{1,64}$"
          }
        },
        "required": [
          "deviceReference"
        ]
      },
      "stepupAuthOperationRequest": {
        "description": "Step-Up Authentication Result request",
        "type": "object",
        "title": "stepupAuthOperationRequest",
        "properties": {
          "authenticationId": {
            "type": "integer",
            "description": "this will be the \"lifeCycleTraceId\" for Visa or the \"authenticationCorrelationId\" for Mastercard",
            "maximum": 999999999999999
          },
          "details": {
            "type": "object",
            "properties": {
              "result": {
                "type": "string",
                "enum": [
                  "SUCCESSFUL",
                  "FAILED"
                ]
              },
              "method": {
                "type": "string",
                "description": "Authentication Method",
                "enum": [
                  "BANK_APP",
                  "BANK_WEBSITE",
                  "CUSTOMER_SERVICE"
                ]
              }
            },
            "required": [
              "result",
              "method"
            ]
          }
        },
        "required": [
          "authenticationId",
          "details"
        ]
      },
      "unbindOperationRequest": {
        "description": "Unbind request",
        "type": "object",
        "title": "unbindOperationRequest",
        "properties": {
          "deviceReference": {
            "$ref": "#/components/schemas/deviceReference"
          },
          "reason": {
            "type": "string",
            "description": "The reason why the action is performed.",
            "pattern": "^[a-zA-Z0-9]{1,64}$"
          },
          "reasonCode": {
            "type": "string",
            "description": "The reason code why the action is performed.<br/>If not provided , default reason code is ISSUER_DECISION",
            "enum": [
              "USER_DECISION",
              "ISSUER_DECISION",
              "DEVICE_LOST",
              "DEVICE_STOLEN"
            ]
          }
        },
        "required": [
          "deviceReference"
        ]
      },
      "deviceReference": {
        "type": "string",
        "description": "Corresponds to Visa device index.",
        "pattern": "^[0-9]{1,2}$",
        "minLength": 1,
        "maxLength": 2
      },
      "issuerId": {
        "maxLength": 10,
        "minLength": 10,
        "type": "string"
      },
      "cardId": {
        "type": "string",
        "description": "Unique identifier of the card.",
        "minLength": 1,
        "maxLength": 48,
        "pattern": "^[A-Za-z0-9_-]{1,48}$"
      },
      "digitalCardState": {
        "type": "string",
        "description": "the state of the digital card (token)",
        "enum": [
          "ACTIVE",
          "INACTIVE",
          "DELETED",
          "DEPLOYMENT_ONGOING",
          "PENDING_ACTIVATION"
        ],
        "example": "ACTIVE",
        "title": "digitalCardState"
      },
      "tokenType": {
        "type": "string",
        "maxLength": 16,
        "description": "The type of the token. Following values are supported:\n- SE\n- HCE\n- COF\n- ECOM\n- QRC"
      },
      "digitalCardRequestorInformation": {
        "title": "digitalCardRequestorInformation",
        "additionalProperties": false,
        "type": "object",
        "description": "Provides details about the digital card requestor.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Digital Card requestor identifier. This is provided by the TSP itself.",
            "minLength": 11,
            "maxLength": 11
          },
          "walletId": {
            "type": "string",
            "description": "MasterCard ONLY. Wallet Application identifier",
            "maxLength": 32
          },
          "name": {
            "type": "string",
            "maxLength": 256,
            "description": "Wallet or Merchant human readable name"
          },
          "tspId": {
            "type": "string",
            "maxLength": 11,
            "minLength": 11,
            "description": "VISA only. Identifiers of the couple Token Requestor - Token Service Provider"
          },
          "originalDigitalCardRequestorId": {
            "type": "string",
            "description": "Applies only to VISA in case of token for token provisioning",
            "minLength": 11,
            "maxLength": 11
          }
        }
      },
      "deviceInformation": {
        "title": "deviceInformation",
        "additionalProperties": false,
        "type": "object",
        "description": "Provides details about the device that has been used for the card digitization.\nNote that this data is available only if the check eligbility has passed with success.\nData availability dependes on the requestor.",
        "properties": {
          "deviceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Identifier of the token storage."
          },
          "digitalCardStorageType": {
            "type": "string",
            "maxLength": 32,
            "description": "Type of the token sorage location. Following values are possible:\n- HCE\n- SPAY_PHONE\n- SPAY_TABLET\n- SPAY_WATCH\n- SPAY_TV\n- IPHONE\n- IWATCH\n- IPAD\n- MAC_BOOK\n- ANDROID_PHONE\n- ANDROID_TABLET\n- ANDROID_WATCH\n- MOBILE_PHONE\n- TABLET\n- WATCH\n- MOBILE_PHONE_OR_TABLET\n- BRACELET\n- UNKNOWN"
          },
          "manufacturer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Device manufacturer name"
          },
          "brand": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Device brand"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Device model"
          },
          "osVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16,
            "description": "Device OS version"
          },
          "firmwareVersion": {
            "type": "string",
            "description": "Device firmware version",
            "minLength": 1,
            "maxLength": 32
          },
          "phoneNumber": {
            "type": "string",
            "description": "Device phone number",
            "minLength": 1,
            "maxLength": 20
          },
          "fourLastDigitPhoneNumber": {
            "type": "string",
            "description": "",
            "minLength": 1,
            "maxLength": 4
          },
          "deviceName": {
            "type": "string",
            "maxLength": 128,
            "description": "Device name set by the consumer"
          },
          "deviceParentId": {
            "type": "string",
            "description": "ID of parent device. Applies to wearable",
            "minLength": 1,
            "maxLength": 64
          },
          "language": {
            "type": "string",
            "description": "Language set on the device in ISO 639-3",
            "minLength": 1,
            "maxLength": 3
          },
          "serialNumber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Device serial number"
          },
          "timeZone": {
            "type": "string",
            "description": "Device time zone abbreviation. Example: PST, GMT, etc...",
            "minLength": 1,
            "maxLength": 32
          },
          "timeZoneSetting": {
            "type": "string",
            "maxLength": 32,
            "description": "Who has set the timezone.\nPossible values:\n- NETWORK_SET\n- CONSUMER_SET"
          },
          "simSerialNumber": {
            "type": "string",
            "description": "Secure Element serial number",
            "minLength": 1,
            "maxLength": 24
          },
          "IMEI": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "networkOperator": {
            "type": "string",
            "description": "Network operator name.",
            "maxLength": 32
          },
          "networkType": {
            "type": "string",
            "description": "Network type. Can be:\n- CELLULAR\n- WIFI",
            "maxLength": 16
          }
        },
        "required": [
          "deviceId"
        ]
      },
      "errorGeneric": {
        "additionalProperties": false,
        "type": "object",
        "description": "Generic error returned by the APIs.",
        "properties": {
          "errorCode": {
            "type": "string",
            "description": "The type of the error",
            "example": "FIELD_INVALID_FORMAT"
          },
          "error": {
            "type": "string",
            "description": "Provide more error details if possible.<br/>For example name of the field with invalid format.<br/>This field is for troubleshooting purposes only, it can change at any time so MUST NOT be parsed, and is not supposed to be human readable so CANNOT be displayed to end users.",
            "example": "consumerId"
          }
        }
      },
      "consumerId": {
        "type": "string",
        "description": "Unique identifier of the consumer. ",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "digitalCardId": {
        "type": "string",
        "description": "Unique identifier of the digital card.",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "deviceId-2": {
        "description": "Unique identifier of the deviceId *",
        "maxLength": 64,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]{1,64}$",
        "type": "string"
      },
      "DigitalCardReference": {
        "additionalProperties": false,
        "type": "object",
        "title": "",
        "x-examples": {
          "example-2": {
            "consumerId": "string",
            "digitalCardId": "string",
            "deviceId": "string"
          }
        },
        "properties": {
          "consumerId": {
            "$ref": "#/components/schemas/consumerId"
          },
          "digitalCardId": {
            "$ref": "#/components/schemas/digitalCardId"
          },
          "deviceId": {
            "$ref": "#/components/schemas/deviceId-2"
          }
        },
        "required": [
          "digitalCardId"
        ]
      },
      "resumeOperationRequest": {
        "description": "The following object represent the request body of the resume operation",
        "additionalProperties": false,
        "type": "object",
        "title": "resumeOperationRequest",
        "properties": {
          "reason": {
            "type": "string",
            "description": "The reason why the action is performed.",
            "pattern": "^[a-zA-Z0-9 ]{1,64}$"
          },
          "reasonCode": {
            "type": "string",
            "description": "The reason code why the action is performed.<br/>If not provided , default reason code is ISSUER_DECISION",
            "enum": [
              "USER_DECISION",
              "ISSUER_DECISION"
            ]
          }
        }
      },
      "operationId": {
        "type": "string",
        "description": "Unique identifier of the operation",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "operationStatus": {
        "title": "operation",
        "additionalProperties": false,
        "type": "object",
        "description": "Operation information.",
        "properties": {
          "operationId": {
            "$ref": "#/components/schemas/operationId"
          },
          "status": {
            "type": "string",
            "description": "Status of the operation",
            "enum": [
              "PENDING",
              "SUCCESSFUL",
              "FAILED"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "operationStatusSuccessful": {
        "title": "operation",
        "additionalProperties": false,
        "type": "object",
        "description": "Operation result information.",
        "properties": {
          "operationId": {
            "$ref": "#/components/schemas/operationId"
          },
          "status": {
            "type": "string",
            "description": "Status of the operation",
            "enum": [
              "SUCCESSFUL"
            ]
          }
        }
      },
      "operationRequest": {
        "description": "The following object represent the account",
        "additionalProperties": false,
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "The reason why the action is performed.",
            "pattern": "^[a-zA-Z0-9 ]{1,64}$"
          },
          "reasonCode": {
            "type": "string",
            "description": "The reason code why the action is performed.<br/>If not provided , default reason code is ISSUER_DECISION",
            "enum": [
              "USER_DECISION",
              "ISSUER_DECISION",
              "DEVICE_LOST",
              "DEVICE_STOLEN",
              "CARD_LOST",
              "CARD_STOLEN"
            ]
          }
        }
      },
      "result": {
        "title": "result",
        "type": "object",
        "properties": {
          "result": {
            "type": "string",
            "enum": [
              "YES",
              "NO",
              "NOT_APPLICABLE"
            ]
          }
        }
      },
      "idAndVMethods": {
        "additionalProperties": false,
        "type": "object",
        "properties": {
          "supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selected": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The following values are possible:\n- OTP_BY_SMS\n- OTP_BY_EMAIL\n- BANK_APP\n- CUSTOMER_SERVICE"
          }
        }
      },
      "cardState": {
        "type": "string",
        "description": "the state of the card",
        "enum": [
          "INACTIVE",
          "ACTIVE",
          "SUSPENDED",
          "DELETED",
          "REPLACED"
        ],
        "example": "ACTIVE"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "A JWT using the Bearer schema.\\nThe server checks the validity of the provided token to control access to this protected resource."
      }
    },
    "parameters": {
      "offset-query": {
        "name": "offset",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "default": 0
        },
        "description": "Index from which the query starts returning operations –  offset 0 (the default) corresponds to the most recent operation."
      },
      "limit-query": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 10
        },
        "description": "Number of operations to be returned"
      },
      "issuer-id-path": {
        "description": "The id of the issuer",
        "in": "path",
        "name": "issuerId",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/issuerId"
        }
      },
      "digital-card-id-path": {
        "name": "digitalCardId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$",
          "minLength": 1,
          "maxLength": 64
        },
        "description": "The id of the digital card"
      },
      "x-correlation-id": {
        "description": "Random identifier which can be used to correlate the different API calls done as part of a single use-case. This identifier will be the one primarily used for troubleshooting.\n\n**Warning:** This identifier should not be derived from sensitive personal data, as its value will be logged in clear.\n\nThere is no strong guarantee of the uniqueness of this identifier, so please refrain from using it for other purpose than logging and troubleshooting.",
        "in": "header",
        "name": "x-correlation-id",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$"
        }
      },
      "x-correlation-id-output": {
        "description": "Random identifier which can be used to correlate the different API calls done as part of a single use-case. This identifier will be the one primarily used for troubleshooting.\n\nThere is no strong guarantee of the uniqueness of this identifier, so please refrain from using it for other purpose than logging and troubleshooting.",
        "in": "header",
        "name": "x-correlation-id",
        "schema": {
          "type": "string"
        }
      },
      "operation-id-path": {
        "description": "The id of the operation",
        "in": "path",
        "name": "operationId",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/operationId"
        }
      },
      "offset-query-2": {
        "name": "offset",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "description": "Index from which the query starts returning operations (default value: 0)"
      },
      "limit-query-2": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 10
        },
        "description": "Upper limit of the query"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errorGeneric"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The provided Authorization header is missing or invalid",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errorGeneric"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden action, check the state of the linked consumer or account or digital card",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errorGeneric"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found, Unknown issuerId or consumerId or accountId or digital card id",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errorGeneric"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errorGeneric"
            }
          }
        }
      }
    }
  }
}