> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/xpay-enablement/api-reference/tsp-api-v2/incoming-operations-from-tsp/token-provisioning-and-management-api.md).

# Token Provisioning and Management API

[TSP-API-IN-v2-Provisioning-Management-oas2.yaml](https://openapi.gitbook.com/o/fwy1mtbRONGA2YDKDBr0/spec/TSP-API-IN-v2-Provisioning-Management-oas2.yaml)

## PUT /tokens/{tokenId}/data

> This method is used by TSP to send the partial or complete data preparation used to personalize the payment application.

```json
{"openapi":"3.1.1","info":{"title":"TSH Token Requestor Incoming API","version":"2.2.2"},"tags":[{"name":"Submit Token Data"}],"servers":[{"url":"https://api.dbp.thalescloud.io/gtep/tsh/trapi/v2.0"}],"paths":{"/tokens/{tokenId}/data":{"put":{"summary":"PUT /tokens/{tokenId}/data","description":"This method is used by TSP to send the partial or complete data preparation used to personalize the payment application.","operationId":"submitTokenData","parameters":[{"$ref":"#/components/parameters/x-correlation-id-header"},{"$ref":"#/components/parameters/tokenIdPath"}],"responses":{"204":{"description":"successful"},"400":{"description":"Bad Request, Invalid request URI or header, or unsupported nonstandard parameter.<br/> Possible error codes are 111, 112, 113, 119, 321, 322, 431, 432, 911, 921","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorRes"}}}},"500":{"$ref":"#/responses/500"},"503":{"$ref":"#/responses/503"}},"tags":["Submit Token Data"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/submitTokenDataReq"}}},"description":"submitTokenData request payload","required":true}}}},"components":{"parameters":{"tokenIdPath":{"schema":{"type":"string","maxLength":48,"minLength":1},"description":"Identifier of the token to update","in":"path","name":"tokenId","required":true}},"schemas":{"errorRes":{"type":"object","description":"Error Information Response","required":["responseCode"],"properties":{"responseCode":{"type":"number","description":"Error Response code to the request\n|Error code | Description| Retryable|\n|-------|-------|-------|\n|111|Missing mandatory parameter|N|\n|112|Bad parameter format|N|\n|113|Unknown issuer|N|\n|115|Unknown product|N|\n|119|Unknown Token|N|\n|163|Product not supported for mobile payment|N|\n|164|FPAN Provisioning Count Exceeded|N|\n|166|Invalid FPAN|N|\n|167|Card already enrolled|N|\n|321|Operation on token already on-going|N|\n|322|Time to live of the operation expired|N|\n|431|Invalid perso data|N|\n|432|Current token state does not allow this operation|N|\n|911|Operation failed|N|\n|921|Unexpected server error|Y|\n"},"errorMessage":{"type":"string","description":"Textual error message"}}},"submitTokenDataReq":{"type":"object","required":["issuerId","tokenPersoInfo"],"properties":{"issuerId":{"$ref":"#/components/schemas/issuerId"},"tokenPersoInfo":{"$ref":"#/components/schemas/tokenPersoInfo"}}},"issuerId":{"maxLength":10,"minLength":10,"type":"string","description":"Unique Identifier of Issuer<br/>"},"tokenPersoInfo":{"type":"array","maxItems":200,"description":"Token Data to be used for personalizing the Card.<br/>\nThe list of data element sent by the TSP is defined during the project.<br/>\nThe length of all the values concatenated together shall not exceed 100k characters. \n","items":{"type":"object","properties":{"name":{"type":"string","description":"Data element name (for example, the DGI code)","maxLength":32,"minLength":1},"value":{"type":"string","description":"Data element value","minLength":1},"keyIndex":{"type":"string","description":"Index of the key used to encrypt the data element value \nThis is optional, the value could be encrypted even if key index is not provided\n","maxLength":32,"minLength":1}}}}}},"responses":{"500":{"description":"Internal Server Error\nRetry possible\n"},"503":{"description":"Service Unavailable\nRetry possible\n          \n"}}}
```

## PUT /tokens/{tokenId}/newData

> This method is used by TSP to send the partial or complete data preparation used in order to re-personalize the payment application.

```json
{"openapi":"3.1.1","info":{"title":"TSH Token Requestor Incoming API","version":"2.2.2"},"tags":[{"name":"Submit New Token Data"}],"servers":[{"url":"https://api.dbp.thalescloud.io/gtep/tsh/trapi/v2.0"}],"paths":{"/tokens/{tokenId}/newData":{"put":{"summary":"PUT /tokens/{tokenId}/newData","description":"This method is used by TSP to send the partial or complete data preparation used in order to re-personalize the payment application.","operationId":"submitNewTokenData","parameters":[{"$ref":"#/components/parameters/x-correlation-id-header"},{"$ref":"#/components/parameters/tokenIdPath"}],"responses":{"204":{"description":"successful"},"400":{"description":"Bad Request, Invalid request URI or header, or unsupported nonstandard parameter.</br> Possible error codes are 111, 112, 113, 119, 321, 431, 432, 911, 921","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorRes"}}}},"500":{"$ref":"#/responses/500"},"503":{"$ref":"#/responses/503"}},"tags":["Submit New Token Data"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/submitNewTokenDataReq"}}},"description":"submitNewTokenData request payload","required":true}}}},"components":{"parameters":{"tokenIdPath":{"schema":{"type":"string","maxLength":48,"minLength":1},"description":"Identifier of the token to update","in":"path","name":"tokenId","required":true}},"schemas":{"errorRes":{"type":"object","description":"Error Information Response","required":["responseCode"],"properties":{"responseCode":{"type":"number","description":"Error Response code to the request\n|Error code | Description| Retryable|\n|-------|-------|-------|\n|111|Missing mandatory parameter|N|\n|112|Bad parameter format|N|\n|113|Unknown issuer|N|\n|115|Unknown product|N|\n|119|Unknown Token|N|\n|163|Product not supported for mobile payment|N|\n|164|FPAN Provisioning Count Exceeded|N|\n|166|Invalid FPAN|N|\n|167|Card already enrolled|N|\n|321|Operation on token already on-going|N|\n|322|Time to live of the operation expired|N|\n|431|Invalid perso data|N|\n|432|Current token state does not allow this operation|N|\n|911|Operation failed|N|\n|921|Unexpected server error|Y|\n"},"errorMessage":{"type":"string","description":"Textual error message"}}},"submitNewTokenDataReq":{"type":"object","required":["issuerId"],"properties":{"issuerId":{"$ref":"#/components/schemas/issuerId"},"tokenInfo":{"$ref":"#/components/schemas/tokenInfo"},"tokenPersoInfo":{"$ref":"#/components/schemas/tokenPersoInfo"}}},"issuerId":{"maxLength":10,"minLength":10,"type":"string","description":"Unique Identifier of Issuer<br/>"},"tokenInfo":{"type":"object","description":"Token related information","properties":{"exp":{"type":"string","maxLength":4,"minLength":4,"description":"Token expiry date in format MMYY to display in the wallet."},"last4":{"type":"string","maxLength":10,"minLength":2,"description":"Last digits of the token pan value to display in the wallet."}}},"tokenPersoInfo":{"type":"array","maxItems":200,"description":"Token Data to be used for personalizing the Card.<br/>\nThe list of data element sent by the TSP is defined during the project.<br/>\nThe length of all the values concatenated together shall not exceed 100k characters. \n","items":{"type":"object","properties":{"name":{"type":"string","description":"Data element name (for example, the DGI code)","maxLength":32,"minLength":1},"value":{"type":"string","description":"Data element value","minLength":1},"keyIndex":{"type":"string","description":"Index of the key used to encrypt the data element value \nThis is optional, the value could be encrypted even if key index is not provided\n","maxLength":32,"minLength":1}}}}}},"responses":{"500":{"description":"Internal Server Error\nRetry possible\n"},"503":{"description":"Service Unavailable\nRetry possible\n          \n"}}}
```

## GET /healthCheck

> This method is used by TSP to monitor TSH health. It should be used every 30 seconds in production environment.

```json
{"openapi":"3.1.1","info":{"title":"TSH Token Requestor Incoming API","version":"2.2.2"},"tags":[{"name":"Healthcheck"}],"servers":[{"url":"https://api.dbp.thalescloud.io/gtep/tsh/trapi/v2.0"}],"paths":{"/healthCheck":{"get":{"summary":"GET /healthCheck","description":"This method is used by TSP to monitor TSH health. It should be used every 30 seconds in production environment.","operationId":"healthCheck","parameters":[{"$ref":"#/components/parameters/x-request-id-header"}],"responses":{"204":{"description":"successful"},"400":{"description":"Bad Request, Invalid request URI or header, or unsupported nonstandard parameter.</br> Possible error codes are 111, 112, 911, 921"},"500":{"$ref":"#/responses/500"},"503":{"$ref":"#/responses/503"}},"tags":["Healthcheck"]}}},"components":{"parameters":{}},"responses":{"500":{"description":"Internal Server Error\nRetry possible\n"},"503":{"description":"Service Unavailable\nRetry possible\n          \n"}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/xpay-enablement/api-reference/tsp-api-v2/incoming-operations-from-tsp/token-provisioning-and-management-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
