> For the complete documentation index, see [llms.txt](https://docs.xplorpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplorpay.com/api-reference/api/payments/recurring-payments-service/customer-token.md).

# Customer Token

## Get customer token

> Retrieve the payment token associated with the customer identified by the specified customer key.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers/{customerKey}/tokens":{"get":{"tags":["Customer Token"],"summary":"Get customer token","description":"Retrieve the payment token associated with the customer identified by the specified customer key.","operationId":"get_1","parameters":[{"name":"customerKey","in":"path","description":"Unique identifier of the customer.","required":true,"schema":{"type":"string"}},{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearentCustomerTokensResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ClearentCustomerTokensResponsePayload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"ClearentCustomerTokensResponsePayload":{"type":"object","properties":{"customer-tokens":{"$ref":"#/components/schemas/tokens"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload","xml":{"name":"payload"}},"tokens":{"type":"object","properties":{"token":{"type":"array","items":{"$ref":"#/components/schemas/customer-token"}}},"description":"tokens","xml":{"name":"tokens"}},"customer-token":{"required":["card-type","customer-key","exp-date","last-four-digits","token-id"],"type":"object","properties":{"customer-key":{"type":"string","description":"Unique identifier of the customer to associate with the token."},"token-id":{"type":"string","description":"Unique identifier of the existing payment token that represents the card number."},"exp-date":{"type":"string","description":"Expire date of the card (MMYY)."},"card-type":{"type":"string","description":"Type of payment card associated with the token.","enum":["AMEX","Discover","JCB","MasterCard","VISA"]},"last-four-digits":{"type":"string","description":"Last four digits of the card number associated with the token."},"description":{"type":"string","description":"Description of the customer's card to help identify the payment method."},"default":{"type":"boolean","description":"Indicates whether this card is the default payment method for the customer."},"avs-address":{"type":"string","description":"Street address used for Address Verification Service (AVS) validation for the payment card."},"avs-zip":{"type":"string","description":"ZIP or postal code used for Address Verification Service (AVS) validation."}},"description":"Represents a stored payment token for a customer.","xml":{"name":"customer-token"}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Add customer token

> Add an existing payment token to the customer identified by the specified customer key.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers/{customerKey}/tokens":{"post":{"tags":["Customer Token"],"summary":"Add customer token","description":"Add an existing payment token to the customer identified by the specified customer key.","operationId":"post","parameters":[{"name":"customerKey","in":"path","description":"Unique identifier of the customer.","required":true,"schema":{"type":"string"}},{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/customer-token"}},"application/xml":{"schema":{"$ref":"#/components/schemas/customer-token"}}},"required":true},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearentCustomerTokensResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ClearentCustomerTokensResponsePayload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"customer-token":{"required":["card-type","customer-key","exp-date","last-four-digits","token-id"],"type":"object","properties":{"customer-key":{"type":"string","description":"Unique identifier of the customer to associate with the token."},"token-id":{"type":"string","description":"Unique identifier of the existing payment token that represents the card number."},"exp-date":{"type":"string","description":"Expire date of the card (MMYY)."},"card-type":{"type":"string","description":"Type of payment card associated with the token.","enum":["AMEX","Discover","JCB","MasterCard","VISA"]},"last-four-digits":{"type":"string","description":"Last four digits of the card number associated with the token."},"description":{"type":"string","description":"Description of the customer's card to help identify the payment method."},"default":{"type":"boolean","description":"Indicates whether this card is the default payment method for the customer."},"avs-address":{"type":"string","description":"Street address used for Address Verification Service (AVS) validation for the payment card."},"avs-zip":{"type":"string","description":"ZIP or postal code used for Address Verification Service (AVS) validation."}},"description":"Represents a stored payment token for a customer.","xml":{"name":"customer-token"}},"ClearentCustomerTokensResponsePayload":{"type":"object","properties":{"customer-tokens":{"$ref":"#/components/schemas/tokens"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload","xml":{"name":"payload"}},"tokens":{"type":"object","properties":{"token":{"type":"array","items":{"$ref":"#/components/schemas/customer-token"}}},"description":"tokens","xml":{"name":"tokens"}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Update customer token

> Update the customer-key, status (ACTIVE, INACTIVE, or DELETED), or description of an existing payment token associated with the specified customer. To update other token details, you must delete the token and create a new one.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers/{customerKey}/tokens":{"put":{"tags":["Customer Token"],"summary":"Update customer token","description":"Update the customer-key, status (ACTIVE, INACTIVE, or DELETED), or description of an existing payment token associated with the specified customer. To update other token details, you must delete the token and create a new one.","operationId":"put_1","parameters":[{"name":"customerKey","in":"path","description":"Unique identifier of the customer.","required":true,"schema":{"type":"string"}},{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/customer-token"}},"application/xml":{"schema":{"$ref":"#/components/schemas/customer-token"}}},"required":true},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearentCustomerTokensResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ClearentCustomerTokensResponsePayload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"customer-token":{"required":["card-type","customer-key","exp-date","last-four-digits","token-id"],"type":"object","properties":{"customer-key":{"type":"string","description":"Unique identifier of the customer to associate with the token."},"token-id":{"type":"string","description":"Unique identifier of the existing payment token that represents the card number."},"exp-date":{"type":"string","description":"Expire date of the card (MMYY)."},"card-type":{"type":"string","description":"Type of payment card associated with the token.","enum":["AMEX","Discover","JCB","MasterCard","VISA"]},"last-four-digits":{"type":"string","description":"Last four digits of the card number associated with the token."},"description":{"type":"string","description":"Description of the customer's card to help identify the payment method."},"default":{"type":"boolean","description":"Indicates whether this card is the default payment method for the customer."},"avs-address":{"type":"string","description":"Street address used for Address Verification Service (AVS) validation for the payment card."},"avs-zip":{"type":"string","description":"ZIP or postal code used for Address Verification Service (AVS) validation."}},"description":"Represents a stored payment token for a customer.","xml":{"name":"customer-token"}},"ClearentCustomerTokensResponsePayload":{"type":"object","properties":{"customer-tokens":{"$ref":"#/components/schemas/tokens"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload","xml":{"name":"payload"}},"tokens":{"type":"object","properties":{"token":{"type":"array","items":{"$ref":"#/components/schemas/customer-token"}}},"description":"tokens","xml":{"name":"tokens"}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xplorpay.com/api-reference/api/payments/recurring-payments-service/customer-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
