Skip to main content

Manage Customer Tokens


This page describes how to create, retrieve, update, and delete customer tokens, including how to retrieve a customer's default payment and shipping details, and how to manage the payment instruments and shipping addresses linked to a customer.

Create a Customer

This section describes how to create a customer token with no payment details.

Endpoint

POST /tms/v2/customers

POST /tms/v2/customers

Example

{  "buyerInformation": {    "merchantCustomerID": "Your customer identifier",    "email": "{% t key="test-email" /%}"  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "merchantDefinedInformation": [    {      "name": "data1",      "value": "Your customer data"    }  ]}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078"    },    "paymentInstruments": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/payment-instruments"    },    "shippingAddresses": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses"    }  },  "id": "F2F3ADA770102B51E053A2598D0A9078",  "buyerInformation": {    "merchantCustomerID": "Your customer identifier",    "email": "{% t key="test-email" /%}"  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "merchantDefinedInformation": [    {      "name": "data1",      "value": "Your customer data"    }  ],  "metadata": {    "creator": "testrest"  }}
Optional Fields
FieldTypeDescription
buyerInformation.merchantCustomerIDstringYour identifier for the customer.
buyerInformation.emailstringThe customer's email address.
clientReferenceInformation.codestringUnique reference code for the transaction.
merchantDefinedInformation.namestringThe name of the merchant-defined data field.
merchantDefinedInformation.valuestringThe value of the merchant-defined data field.

Retrieve a Customer

This section describes how to retrieve a customer token.

Endpoint

GET /tms/v2/customers/{customerTokenId}

GET /tms/v2/customers/{customerTokenId}

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token.

Example

{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078"    },    "paymentInstruments": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/payment-instruments"    },    "shippingAddresses": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses"    }  },  "id": "F2F3ADA770102B51E053A2598D0A9078",  "buyerInformation": {    "merchantCustomerID": "Your customer identifier",    "email": "{% t key="test-email" /%}"  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "merchantDefinedInformation": [    {      "name": "data1",      "value": "Your customer data"    }  ],  "metadata": {    "creator": "testrest"  }}

Update a Customer

This section describes how to update a customer token.

Endpoint

PATCH /tms/v2/customers/{customerTokenId}

PATCH /tms/v2/customers/{customerTokenId}

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. Include only the fields you want to add or update in the request.

Example

{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078"    },    "paymentInstruments": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/payment-instruments"    },    "shippingAddresses": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses"    }  },  "id": "F2F3ADA770102B51E053A2598D0A9078",  "buyerInformation": {    "merchantCustomerID": "Your customer identifier",    "email": "{% t key="test-email" /%}"  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "merchantDefinedInformation": [    {      "name": "data1",      "value": "Your customer data"    }  ],  "metadata": {    "creator": "testrest"  }}
Optional Fields
FieldTypeDescription
buyerInformation.merchantCustomerIDstringYour identifier for the customer.
buyerInformation.emailstringThe customer's email address.
clientReferenceInformation.codestringUnique reference code for the transaction.
merchantDefinedInformation.namestringThe name of the merchant-defined data field.
merchantDefinedInformation.valuestringThe value of the merchant-defined data field.

Delete a Customer

This section describes how to delete a customer token.

Endpoint

DELETE /tms/v2/customers/{customerTokenId}

DELETE /tms/v2/customers/{customerTokenId}

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. A successful delete response returns an empty HTTP 204 No Content status.

Retrieve a Customer's Default Payment with an Unmasked Card Number

This section describes how to retrieve a customer's default payment with an unmasked card number.

Endpoint

GET /tms/v2/customers/{customerTokenId}

GET /tms/v2/customers/{customerTokenId}

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. The response returns encrypted card data.

Example

eyJraWQiOiJiYTE1ZDRmMTIzMTM0NjlkZjg5MDM1Nzk2YWE4Nzc4ZGM0NTY4ODlkIiwiY3R5IjoianNvbiIsInR5cCI6IkpXVCIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJSU0EtT0FFUC0yNTYifQ...

Retrieve a Customer's Default Payment and Shipping Details

This section describes how to retrieve a customer's default payment and shipping details.

Endpoint

GET /tms/v2/customers/{customerTokenId}

GET /tms/v2/customers/{customerTokenId}

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token.


This section describes how to create, retrieve, update, and delete payment instruments linked to a customer token, including how to add default and non-default instruments and change which instrument is the customer's default.

Create a Customer Payment Instrument

Endpoint

POST /tms/v2/customers/{customerTokenId}/payment-instruments

POST /tms/v2/customers/{customerTokenId}/payment-instruments

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token.

Example

{  "card": {    "expirationMonth": "12",    "expirationYear": "2031",    "type": "001"  },  "billTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "{% t key="test-email" /%}",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  }}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/payment-instruments/F39732BE4BDA9A1EE053AF598E0A4081"    },    "customer": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078"    }  },  "id": "F39732BE4BDA9A1EE053AF598E0A4081",  "default": true,  "state": "ACTIVE",  "card": {    "expirationMonth": "12",    "expirationYear": "2031",    "type": "001"  },  "billTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "{% t key="test-email" /%}",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  },  "metadata": {    "creator": "testrest"  }}
FieldTypeDescription
card.typestringRequired if the instrument identifier ID being linked to is card-based. For example, 001 for Visa.
Optional Fields
FieldTypeDescription
bankAccount.typestringThe bank account type.
billTo.address1stringThe first line of the billing street address.
billTo.address2stringThe second line of the billing street address.
billTo.administrativeAreastringState or province in the billing address.
billTo.companystringThe name of the customer's company.
billTo.countrystringCountry of the billing address. Use the two-character ISO Standard Country Code.
billTo.emailstringThe customer's billing email address.
billTo.firstNamestringThe customer's first name.
billTo.lastNamestringThe customer's last name.
billTo.localitystringCity in the billing address.
billTo.phoneNumberstringThe customer's phone number.
billTo.postalCodestringZIP or postal code in the billing address.
buyerInformation.companyTaxIDstringThe company tax ID of the customer.
buyerInformation.currencystringThe default currency for the customer.
buyerInformation.dateOfBirthstringThe customer's date of birth.
buyerInformation.personalIdentification.idstringPersonal identification number.
buyerInformation.personalIdentification.issuedBy.administrativeAreastringState or province that issued the personal identification.
buyerInformation.personalIdentification.typestringType of personal identification.
card.expirationMonthstringCard expiration month in two-digit format. For example, 12.
card.expirationYearstringCard expiration year in four-digit format. For example, 2031.
card.issueNumberstringNumber of times a Maestro (UK Domestic) card has been issued.
card.startMonthstringMonth of the start of the Maestro (UK Domestic) card validity period.
card.startYearstringYear of the start of the Maestro (UK Domestic) card validity period.
card.useAsstringHow the card is used. For example, credit or debit.
card.tokenizedInformation.requestorIDstringToken requestor ID for the tokenized card.
card.tokenizedInformation.transactionTypestringTransaction type for the tokenized card.
defaultbooleanSet to true to designate this as the default payment instrument. If not included, the first payment instrument for a customer becomes the default.
instrumentIdentifier.idstringThe instrument identifier token ID to link to this payment instrument.
processingInformation.billPaymentProgramEnabledbooleanSet to true to enable the bill payment program.
merchantInformation.merchantDescriptor.alternateNamestringAlternate name for the merchant descriptor.

Add a Default Payment Instrument Using Instrument Identifier

Add a default payment instrument to a customer account using an existing instrument identifier.

Endpoint

POST /tms/v2/customers/{customerTokenId}/payment-instruments

POST /tms/v2/customers/{customerTokenId}/payment-instruments

FieldTypeDescription
instrumentIdentifier.idstringThe instrument identifier token ID to link as the default payment instrument.
defaultbooleanSet to true to designate this as the default payment instrument.

Add Default Payment Instrument with Validated Payment

Add a default payment instrument to a customer account by validating a payment.

Endpoint

POST /pts/v2/payments

POST /pts/v2/payments

FieldTypeDescription
paymentInformation.paymentInstrument.idstringThe payment instrument token ID.
orderInformation.amountDetails.totalAmountstringThe total amount for the order.
orderInformation.amountDetails.currencystringThe currency for the order. Use the three-character ISO Standard Currency Code.

Add a Non-Default Payment Instrument Using Instrument Identifier

Add a non-default payment instrument to a customer account using an existing instrument identifier.

Endpoint

POST /tms/v2/customers/{customerTokenId}/payment-instruments

POST /tms/v2/customers/{customerTokenId}/payment-instruments

FieldTypeDescription
instrumentIdentifier.idstringThe instrument identifier token ID to link as a non-default payment instrument.

Add Non-Default Payment Instrument with Validated Payment

Add a non-default payment instrument to a customer account by validating a payment.

Endpoint

POST /pts/v2/payments

POST /pts/v2/payments

FieldTypeDescription
paymentInformation.paymentInstrument.idstringThe payment instrument token ID.
orderInformation.amountDetails.totalAmountstringThe total amount for the order.
orderInformation.amountDetails.currencystringThe currency for the order. Use the three-character ISO Standard Currency Code.

Change a Customer's Default Payment Instrument

Change which payment instrument is designated as the default for a customer.

Endpoint

PATCH /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

PATCH /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

FieldTypeDescription
customerTokenIdstringThe customer token ID in the URL path.
paymentInstrumentTokenIdstringThe payment instrument token ID in the URL path.

Retrieve a Customer Payment Instrument

Retrieve a specific customer payment instrument.

Endpoint

GET /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

GET /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

Example

GET /tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/payment-instruments/F39732BE4BDA9A1EE053AF598E0A4081
{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/payment-instruments/F39732BE4BDA9A1EE053AF598E0A4081"    },    "customer": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078"    }  },  "id": "F39732BE4BDA9A1EE053AF598E0A4081",  "default": true,  "state": "ACTIVE",  "card": {    "expirationMonth": "12",    "expirationYear": "2031",    "type": "001"  },  "billTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "{% t key="test-email" /%}",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  },  "metadata": {    "creator": "testrest"  }}

Retrieve a Customer Payment Instrument with an Unmasked Card Number

Retrieve a customer payment instrument with the card number unmasked.

Endpoint

GET /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

GET /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}


List Payment Instruments for a Customer

Retrieve all payment instruments for a customer.

Endpoint

GET /tms/v2/customers/{customerTokenId}/payment-instruments

GET /tms/v2/customers/{customerTokenId}/payment-instruments

Optional Fields
FieldTypeDescription
offsetintegerPage offset number for pagination. Defaults to 0.
limitintegerMaximum number of items to return. Defaults to 20; maximum is 100.

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token.


Update a Customer Payment Instrument

Update a customer payment instrument.

Endpoint

PATCH /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

PATCH /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

FieldTypeDescription
customerTokenIdstringThe customer token ID in the URL path.
paymentInstrumentTokenIdstringThe payment instrument token ID in the URL path.
Optional Fields
FieldTypeDescription
bankAccount.typestringThe bank account type.
billTo.address1stringThe first line of the billing street address.
billTo.address2stringThe second line of the billing street address.
billTo.administrativeAreastringState or province in the billing address.
billTo.companystringThe name of the customer's company.
billTo.countrystringCountry of the billing address. Use the two-character ISO Standard Country Code.
billTo.emailstringThe customer's billing email address.
billTo.firstNamestringThe customer's first name.
billTo.lastNamestringThe customer's last name.
billTo.localitystringCity in the billing address.
billTo.phoneNumberstringThe customer's phone number.
billTo.postalCodestringZIP or postal code in the billing address.
buyerInformation.companyTaxIDstringThe company tax ID of the customer.
buyerInformation.currencystringThe default currency for the customer.
buyerInformation.dateOfBirthstringThe customer's date of birth.
buyerInformation.personalIdentification.idstringPersonal identification number.
buyerInformation.personalIdentification.issuedBy.administrativeAreastringState or province that issued the personal identification.
buyerInformation.personalIdentification.typestringType of personal identification.
card.expirationMonthstringCard expiration month in two-digit format. For example, 12.
card.expirationYearstringCard expiration year in four-digit format. For example, 2031.
card.issueNumberstringNumber of times a Maestro (UK Domestic) card has been issued.
card.startMonthstringMonth of the start of the Maestro (UK Domestic) card validity period.
card.startYearstringYear of the start of the Maestro (UK Domestic) card validity period.
card.typestringThe card type code. For example, 001 for Visa.
card.useAsstringHow the card is used. For example, credit or debit.
card.tokenizedInformation.requestorIDstringToken requestor ID for the tokenized card.
card.tokenizedInformation.transactionTypestringTransaction type for the tokenized card.
defaultbooleanSet to true if this is the default payment instrument; false otherwise.
instrumentIdentifier.idstringThe instrument identifier token ID to link to this payment instrument.
processingInformation.billPaymentProgramEnabledbooleanSet to true to enable the bill payment program.
merchantInformation.merchantDescriptor.alternateNamestringAlternate name for the merchant descriptor.

Delete a Customer Payment Instrument

Delete a customer payment instrument.

Endpoint

DELETE /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}

DELETE /tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}


This section describes how to create, retrieve, update, and delete shipping address tokens linked to a customer token, including how to add default and non-default addresses and change which address is the customer's default.

Endpoints

MethodPath
POST/tms/v2/customers/{customerTokenId}/shipping-addresses
GET/tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}
GET/tms/v2/customers/{customerTokenId}/shipping-addresses
PATCH/tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}
DELETE/tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token.


Create a Customer Shipping Address

This operation creates a new shipping address token associated with a customer. If the default field is not supplied and the customer does not already have a shipping address, the shipping address becomes the default. Otherwise, it becomes a non-default shipping address.

Endpoint

POST /tms/v2/customers/{customerTokenId}/shipping-addresses

POST /tms/v2/customers/{customerTokenId}/shipping-addresses

Example

POST /tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses
{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses/F2F4C2D1B966D631E053A2598D0AB155"    },    "customer": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078"    }  },  "id": "F2F4C2D1B966D631E053A2598D0AB155",  "default": true,  "shipTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "{% t key=\"test-email\" /%}",    "phoneNumber": "4158880000"  },  "metadata": {    "creator": "testrest"  }}
Optional Fields
FieldTypeDescription
shipTo.address1stringThe first line of the shipping street address.
shipTo.address2stringThe second line of the shipping street address.
shipTo.administrativeAreastringState or province in the shipping address.
shipTo.companystringThe name of the recipient's company.
shipTo.countrystringCountry of the shipping address. Use the two-character ISO Standard Country Code.
shipTo.emailstringThe recipient's email address.
shipTo.firstNamestringThe recipient's first name.
shipTo.lastNamestringThe recipient's last name.
shipTo.localitystringCity in the shipping address.
shipTo.phoneNumberstringThe recipient's phone number.
shipTo.postalCodestringZIP or postal code in the shipping address.

Add a Default Shipping Address

This operation adds a new default shipping address to an existing customer. The new address becomes the customer's default shipping address.

Endpoint

POST /tms/v2/customers/{customerTokenId}/shipping-addresses

POST /tms/v2/customers/{customerTokenId}/shipping-addresses

FieldTypeDescription
defaultbooleanSet to true to mark this as the default shipping address.
Optional Fields
FieldTypeDescription
shipTo.address1stringThe first line of the shipping street address.
shipTo.address2stringThe second line of the shipping street address.
shipTo.administrativeAreastringState or province in the shipping address.
shipTo.companystringThe name of the recipient's company.
shipTo.countrystringCountry of the shipping address. Use the two-character ISO Standard Country Code.
shipTo.emailstringThe recipient's email address.
shipTo.firstNamestringThe recipient's first name.
shipTo.lastNamestringThe recipient's last name.
shipTo.localitystringCity in the shipping address.
shipTo.phoneNumberstringThe recipient's phone number.
shipTo.postalCodestringZIP or postal code in the shipping address.

Add a Non-Default Shipping Address

This operation adds a new non-default shipping address to an existing customer. The address is stored but does not replace the customer's current default shipping address.

Endpoint

POST /tms/v2/customers/{customerTokenId}/shipping-addresses

POST /tms/v2/customers/{customerTokenId}/shipping-addresses

FieldTypeDescription
defaultbooleanSet to false to mark this as a non-default shipping address.
Optional Fields
FieldTypeDescription
shipTo.address1stringThe first line of the shipping street address.
shipTo.address2stringThe second line of the shipping street address.
shipTo.administrativeAreastringState or province in the shipping address.
shipTo.companystringThe name of the recipient's company.
shipTo.countrystringCountry of the shipping address. Use the two-character ISO Standard Country Code.
shipTo.emailstringThe recipient's email address.
shipTo.firstNamestringThe recipient's first name.
shipTo.lastNamestringThe recipient's last name.
shipTo.localitystringCity in the shipping address.
shipTo.phoneNumberstringThe recipient's phone number.
shipTo.postalCodestringZIP or postal code in the shipping address.

Change Default Shipping Address

This operation designates a different existing shipping address as the customer's default. The previously default address becomes a non-default address.

Endpoint

PATCH /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

PATCH /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

FieldTypeDescription
defaultbooleanSet to true to make this address the new default shipping address.

Retrieve a Customer Shipping Address

This operation retrieves the details of a specific shipping address token associated with a customer.

Endpoint

GET /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

GET /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

The {shippingAddressTokenId} path parameter is the shipping address token ID returned in the response when you created the shipping address token.


Retrieve All Customer Shipping Addresses

This operation retrieves all shipping address tokens associated with a specific customer.

Endpoint

GET /tms/v2/customers/{customerTokenId}/shipping-addresses

GET /tms/v2/customers/{customerTokenId}/shipping-addresses


Update a Customer Shipping Address

This operation updates an existing shipping address token. You can modify any of the shipping address fields.

Endpoint

PATCH /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

PATCH /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

Optional Fields
FieldTypeDescription
shipTo.address1stringThe first line of the shipping street address.
shipTo.address2stringThe second line of the shipping street address.
shipTo.administrativeAreastringState or province in the shipping address.
shipTo.companystringThe name of the recipient's company.
shipTo.countrystringCountry of the shipping address. Use the two-character ISO Standard Country Code.
shipTo.emailstringThe recipient's email address.
shipTo.firstNamestringThe recipient's first name.
shipTo.lastNamestringThe recipient's last name.
shipTo.localitystringCity in the shipping address.
shipTo.phoneNumberstringThe recipient's phone number.
shipTo.postalCodestringZIP or postal code in the shipping address.

Delete a Customer Shipping Address

This operation deletes a specific shipping address token associated with a customer.

Endpoint

DELETE /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

DELETE /tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}

Last published: September 29, 2026