Last updated

Read customer token


This page details how to read a Kustom customer token, retrieving its status and payment method information.

Request example

To read a customer token, use a GET request to the /customer-token/v1/tokens/{customerToken} endpoint.

Path: GET /customer-token/v1/tokens/{customerToken}
Content-Type: application/json

Responses

Example successful response

This example shows a successful read of a token, including card details. Note that responses will vary based on the payment method.

Description: Token was successfully read.
Status Code: 200
Content-Type: application/json

{
    "card": {
        "brand": "VISA",
        "expiry_date": "12/2020",
        "masked_number": "**1234"
    },
    "direct_debit": {
        "masked_number": "**124"
    },
    "payment_method_type": "INVOICE",
    "status": "ACTIVE"
}

Example error responses

This example demonstrates an error response.

{
    "correlation_id":	"6a9b1cb1-73a3-4936-a030-481ba4bb203b",
    "error_code":	"ERROR_CODE",
    "error_messages":	[
        "ERROR_MESSAGE"
    ]
}

Possible error codes and messages

Error CodeError messageComment
NOT_FOUNDInvalid customer-token IDThe token is not valid or the ID is incorrect.

Best practice: Use the correlation_id for troubleshooting in the merchant portal logs.