When a purchase token has been created, you can update the status of it. This should be used if you want to cancel a specific customer token
For a description of the status in the lifecycle of a token, please read theĀ customer token lifecycle article.
Path: PATCH /customer-token/v1/tokens/{customerToken}/status
Headers:
Content-Type: application/json
{
"status": "CANCELLED"
}
You can set the status of a token to āCANCELLEDā to disable it from being used again to create orders.
Based on if the request is succesful or rejected, the response will be different.
The response will only state whether or not the update was successful or not.
Description: Token patch request has been accepted and is being processed.
Headers:
Status Code: 202
Content-Type: application/json
*Empty response*
{
"correlation_id": "6a9b1cb1-73a3-4936-a030-481ba4bb203b",
"error_code": "ERROR_CODE",
"error_messages": [
"ERROR_MESSAGE"
]
}
Best practice: You can use the correlation_id
to troubleshoot the call in the logs app in merchant portal.
Error Code | Error message | Comment |
---|---|---|
NOT_FOUND | Invalid token ID | The token you attempted to read is not valid anymore. Or the ID is incorrectly formatted. |
BAD_VALUE | [incorrect field] | If you enter any values that are not allowed, the validation will fail. |