Disable Token
POST /payment/disable-token
Disables a card token so it can no longer be used for payments. Use it when a shopper removes a saved card or closes their account with you.
What happens when you disable a token
- It is immediate and permanent. A disabled token cannot be re-enabled. If the shopper wants to save the card again, send them through a checkout with
recurringProcessingModelset; that produces a new token. - A TokenDisabled webhook is sent straight away.
- Later payments with the token are rejected with error
2004(Field [TokenDetails.TokenValue] cannot be resolved). See Token scope and validity. - The token must belong to a merchant your API key covers. Otherwise — and for a token that does not exist — the request fails with error
2014(Merchant cannot access entity or the entity does not exist). "Failed to disable token."means the payment processor rejected the request and the token is still active. Retry later; if it keeps failing, contact support with theresponseIdentifier.
Test URL
The disable token request will be made to the following URL:
https://checkout-api.staging.straumur.is/api/v1/payment/disable-token
Request Example
{
"tokenValue": "A1B2C3D4E5F6G7H8"
}
Request Body Fields
| Field | Type | Required | Description | Example | Min Length | Max Length |
|---|---|---|---|---|---|---|
| tokenValue | String | Required | The card token you want to disable. | A1B2C3D4E5F6G7H8 |
Example - Success Response
{
"success": true,
"message": "Token disabled successfully.",
"responseDateTime": "2025-01-04T09:50:14.343503Z",
"responseIdentifier": "e3605f81-6b09-4ce1-83ad-5a8d49f3cd44"
}
Example - Fail Response
{
"success": false,
"message": "Failed to disable token.",
"responseDateTime": "2025-01-04T09:50:14.343503Z",
"responseIdentifier": "e3605f81-6b09-4ce1-83ad-5a8d49f3cd44"
}
Response Fields
This table outlines the response fields with their corresponding types, descriptions and examples.
| Field | Type | Description | Example |
|---|---|---|---|
| success | Boolean | Indicates the request status (true/false) | true |
| message | String | Human readable result of the request. | Token disabled successfully. or Failed to disable token. |
| responseDateTime | String | The date and time when the response was generated. | 2024-09-04T09:50:14.343503Z |
| responseIdentifier | String | The unique identifier for the response. | 7be7111c-2e8e-4cd4-a5ba-f15bdfd177c1 |
Error Response
Our error responses are standardised. Please see Errors.
You can also find a detailed overview of our HTTP Status Codes.