Klarna Docs - Update a Klarna customer token

Update a Klarna customer token

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.

Request

JSON
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.

Responses

Based on if the request is succesful or rejected, the response will be different.

Successful Response example

The response will only state whether or not the update was successful or not.

HTTP
Description: Token patch request has been accepted and is being processed.

Headers:
Status Code: 202
Content-Type: application/json
*Empty response*

Example error responses

JSON
{
    "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.

Possible error codes and messages

Error CodeError messageComment
NOT_FOUNDInvalid token IDThe 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.