Skip to main content
Welcome to the preview portal — This is an early release of the new Doc Hub experience, with more content coming soon.

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

POST /tms/v2/customers

POST /tms/v2/customers

POST /tms/v2/customers

Example

{  "buyerInformation": {    "merchantCustomerID": "Your customer identifier",    "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": ""  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "merchantDefinedInformation": [    {      "name": "data1",      "value": "Your customer data"    }  ],  "metadata": {    "creator": "testrest"  }}
Optional Fields for Create a Customer
buyerInformation.merchantCustomerID string

Your identifier for the customer.

buyerInformation.email string

The customer's email address.

clientReferenceInformation.code string

Unique reference code for the transaction.

merchantDefinedInformation.name string

The name of the merchant-defined data field.

merchantDefinedInformation.value string

The 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}

GET /tms/v2/customers/{customerTokenId}

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. For more information, see Create a 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": ""  },  "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}

PATCH /tms/v2/customers/{customerTokenId}

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": ""  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "merchantDefinedInformation": [    {      "name": "data1",      "value": "Your customer data"    }  ],  "metadata": {    "creator": "testrest"  }}
Optional Fields for Update a Customer
buyerInformation.merchantCustomerID string

Your identifier for the customer.

buyerInformation.email string

The customer's email address.

clientReferenceInformation.code string

Unique reference code for the transaction.

merchantDefinedInformation.name string

The name of the merchant-defined data field.

merchantDefinedInformation.value string

The 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}

DELETE /tms/v2/customers/{customerTokenId}

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.

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}

GET /tms/v2/customers/{customerTokenId}

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 is BASE 64-encoded JSON web encryption (JWE) token. The decoded JWE has these elements:

{ "alg": "RSA-OAEP-256", //The algorithm used to encrypt the CEK    "cty": "json", //The content type    "typ": "JWT", //The token type    "enc": "A256GCM", //The algorithm that is used to encrypt the message    "kid": "keyId" //The serial number of shared public cert for encryption of CEK}<Encrypted Data> //The encrypted payload that matches the JSON response normally returned by the TMS API, except with an unmasked payment details

Header Configuration

You must pass this request header to retrieve unmasked payment details: Accept: application/jose.

The term application/jose refers to JavaScript Object Signing and Encryption (JOSE). JOSE is a framework that provides end-to-end security to JavaScript Object Notation (JSON)-based data structures. JOSE achieves this by offering a collection of specifications to encrypt and digitally sign JSON payloads. In this case, the response is message-level encrypted using a JSON Web Token (JWT).

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}

GET /tms/v2/customers/{customerTokenId}

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.

Create a Customer Payment Instrument

Endpoint

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

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

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

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. For more information, see Create a Customer.

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": "",    "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": "",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  },  "metadata": {    "creator": "testrest"  }}
Required Fields for Create a Customer Payment Instrument
card.type string

Required if the instrument identifier ID being linked to is card-based. For example, 001 for Visa.

Optional Fields for Create a Customer Payment Instrument
bankAccount.type string

The bank account type.

billTo.address1 string

The first line of the billing street address.

billTo.address2 string

The second line of the billing street address.

billTo.administrativeArea string

State or province in the billing address.

billTo.company string

The name of the customer's company.

billTo.country string

Country of the billing address. Use the two-character ISO Standard Country Code.

billTo.email string

The customer's billing email address.

billTo.firstName string

The customer's first name.

billTo.lastName string

The customer's last name.

billTo.locality string

City in the billing address.

billTo.phoneNumber string

The customer's phone number.

billTo.postalCode string

ZIP or postal code in the billing address.

buyerInformation.companyTaxID string

The company tax ID of the customer.

buyerInformation.currency string

The default currency for the customer.

buyerInformation.dateOfBirth string

The customer's date of birth.

buyerInformation.personalIdentification.id string

Personal identification number.

buyerInformation.personalIdentification.issuedBy.administrativeArea string

State or province that issued the personal identification.

buyerInformation.personalIdentification.type string

Type of personal identification.

card.expirationMonth string

Card expiration month in two-digit format. For example, 12.

card.expirationYear string

Card expiration year in four-digit format. For example, 2031.

card.issueNumber string

Number of times a Maestro (UK Domestic) card has been issued.

card.startMonth string

Month of the start of the Maestro (UK Domestic) card validity period.

card.startYear string

Year of the start of the Maestro (UK Domestic) card validity period.

card.useAs string

How the card is used. For example, credit or debit.

card.tokenizedInformation.requestorID string

Token requestor ID for the tokenized card.

card.tokenizedInformation.transactionType string

Transaction type for the tokenized card.

default boolean

Set to true to designate this as the default payment instrument. If not included, the first payment instrument for a customer becomes the default.

instrumentIdentifier.id string

The instrument identifier token ID to link to this payment instrument.

processingInformation.billPaymentProgramEnabled boolean

Set to true to enable the bill payment program.

merchantInformation.merchantDescriptor.alternateName string

Alternate 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

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

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

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

Example

{  "default": true,  "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",    "phoneNumber": "4158880000",    "email": ""  },  "instrumentIdentifier": {    "id": "7010000000016241111"  }}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF/payment-instruments/F45FD8DE542A9E9CE053A2598D0AFDFA"    },    "customer": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF"    }  },  "id": "F45FD8DE542A9E9CE053A2598D0AFDFA",  "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": "",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7030000000014911515"  },  "metadata": {    "creator": "testrest"  },  "_embedded": {    "instrumentIdentifier": {      "_links": {        "self": {          "href": "/tms/v1/instrumentidentifiers/7030000000014911515"        },        "paymentInstruments": {          "href": "/tms/v1/instrumentidentifiers/7030000000014911515/paymentinstruments"        }      },      "id": "7030000000014911515",      "object": "instrumentIdentifier",      "state": "ACTIVE",      "card": {        "number": "489537XXXXXX1515"      },      "issuer": {        "paymentAccountReference": "V0010013019326121174070050420"      },      "processingInformation": {        "authorizationOptions": {          "initiator": {            "merchantInitiatedTransaction": {              "previousTransactionId": "123456789619999"            }          }        }      },      "metadata": {        "creator": "testrest"      }    }  }}
Required Fields for Add a Default Payment Instrument Using Instrument Identifier
instrumentIdentifier.id string

The instrument identifier token ID to link as the default payment instrument.

default boolean

Set 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

POST /pts/v2/payments

POST /pts/v2/payments

POST /pts/v2/payments

Example

{  "clientReferenceInformation": {    "code": "TC50171_3"  },  "processingInformation": {    "commerceIndicator": "internet",    "actionList": [      "TOKEN_CREATE"    ],    "actionTokenTypes": [      "paymentInstrument"    ]  },  "orderInformation": {    "billTo": {      "country": "US",      "lastName": "Doe",      "address2": "Address 2",      "address1": "201 S. Division St.",      "postalCode": "48104-2201",      "locality": "Ann Arbor",      "administrativeArea": "MI",      "firstName": "John",      "phoneNumber": "999999999",      "district": "MI",      "buildingNumber": "123",      "company": "Company Name",      "email": ""    },    "shipTo": {      "country": "US",      "lastName": "Doe",      "address2": "Address 2",      "address1": "201 S. Division St.",      "postalCode": "48104-2201",      "locality": "Ann Arbor",      "administrativeArea": "MI",      "firstName": "John",      "phoneNumber": "999999999",      "district": "MI",      "buildingNumber": "123",      "company": "Company Name",      "email": ""    },    "amountDetails": {      "totalAmount": "102.00",      "currency": "USD"    }  },  "paymentInformation": {    "customer": {      "id": "F45FB3E443AC3C57E053A2598D0A9CFF"    },    "card": {      "expirationYear": "2031",      "number": "4895379987X11523",      "securityCode": "965",      "expirationMonth": "12"    }  },  "tokenInformation": {    "paymentInstrument": {      "default": "true"    }  }}
{  "_links": {    "authReversal": {      "method": "POST",      "href": "/pts/v2/payments/6760637747316173203955/reversals"    },    "self": {      "method": "GET",      "href": "/pts/v2/payments/6760637747316173203955"    },    "capture": {      "method": "POST",      "href": "/pts/v2/payments/6760637747316173203955/captures"    }  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "id": "6760637747316173203955",  "orderInformation": {    "amountDetails": {      "authorizedAmount": "102.00",      "currency": "USD"    }  },  "paymentAccountInformation": {    "card": {      "type": "001"    }  },  "paymentInformation": {    "tokenizedCard": {      "type": "001"    },    "shippingAddress": {      "id": "F45FD8DE51B99E9CE053A2598D0AFDFA"    },    "card": {      "type": "001"    },    "customer": {      "id": "F45FB3E443AC3C57E053A2598D0A9CFF"    }  },  "pointOfSaleInformation": {    "terminalId": "111111"  },  "processorInformation": {    "paymentAccountReferenceNumber": "V0010013019326121538313096266",    "approvalCode": "888888",    "networkTransactionId": "123456789619999",    "transactionId": "123456789619999",    "responseCode": "100",    "avs": {      "code": "X",      "codeRaw": "I1"    }  },  "reconciliationId": "69815876LDTHD4XU",  "status": "AUTHORIZED",  "submitTimeUtc": "2023-02-10T21:16:15Z",  "tokenInformation": {    "instrumentidentifierNew": false,    "instrumentIdentifier": {      "state": "ACTIVE",      "id": "7030000000014831523"    },    "paymentInstrument": {      "id": "F45FE45E7993C7DBE053A2598D0AED19"    }  }}
Required Fields for Add Default Payment Instrument with Validated Payment
orderInformation.amountDetails.totalAmount string

The total amount for the order.

orderInformation.amountDetails.currency string

The currency for the order. Use the three-character ISO Standard Currency Code. For RuPay, set the value to INR. Vero supports Brazilian real (BRL) currency only.

orderInformation.billTo.address1 string

The first line of the billing street address.

orderInformation.billTo.administrativeArea string

State or province in the billing address.

orderInformation.billTo.country string

Country of the billing address. Use the two-character ISO Standard Country Code.

orderInformation.billTo.email string

The customer's billing email address.

orderInformation.billTo.firstName string

The customer's first name.

orderInformation.billTo.lastName string

The customer's last name.

orderInformation.billTo.locality string

City in the billing address.

orderInformation.billTo.postalCode string

ZIP or postal code in the billing address.

paymentInformation.card.expirationMonth string

Card expiration month in two-digit format. For example, 12.

paymentInformation.card.expirationYear string

Card expiration year in four-digit format. For example, 2031.

paymentInformation.card.number string

The customer's payment card number.

paymentInformation.customer.id string

Set to the ID of the customer token you want to use.

processingInformation.actionList array

Set to TOKEN_CREATE to create a payment instrument token from this payment.

processingInformation.actionTokenTypes array

Set to paymentInstrument to create a payment instrument token.

tokenInformation.paymentInstrument.default boolean

Set to true to designate the created payment instrument as the customer's default.

Optional Fields for Add Default Payment Instrument with Validated Payment
paymentInformation.card.type string

The card type code. For example, 001 for Visa.


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

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

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

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

Required Fields for Add a Non-Default Payment Instrument Using Instrument Identifier
instrumentIdentifier.id string

The 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

POST /pts/v2/payments

POST /pts/v2/payments

POST /pts/v2/payments

Example

{  "clientReferenceInformation": {    "code": "TC50171_3"  },  "processingInformation": {    "commerceIndicator": "internet",    "actionList": [      "TOKEN_CREATE"    ],    "actionTokenTypes": [      "paymentInstrument"    ]  },  "orderInformation": {    "billTo": {      "country": "US",      "lastName": "Doe",      "address2": "Address 2",      "address1": "201 S. Division St.",      "postalCode": "48104-2201",      "locality": "Ann Arbor",      "administrativeArea": "MI",      "firstName": "John",      "phoneNumber": "999999999",      "district": "MI",      "buildingNumber": "123",      "company": "Company Name",      "email": ""    },    "shipTo": {      "country": "US",      "lastName": "Doe",      "address2": "Address 2",      "address1": "201 S. Division St.",      "postalCode": "48104-2201",      "locality": "Ann Arbor",      "administrativeArea": "MI",      "firstName": "John",      "phoneNumber": "999999999",      "district": "MI",      "buildingNumber": "123",      "company": "Company Name",      "email": ""    },    "amountDetails": {      "totalAmount": "102.00",      "currency": "USD"    }  },  "paymentInformation": {    "customer": {      "id": "F45FB3E443AC3C57E053A2598D0A9CFF"    },    "card": {      "expirationYear": "2031",      "number": "4895379987X11531",      "securityCode": "258",      "expirationMonth": "12"    }  },  "tokenInformation": {    "paymentInstrument": {      "default": "false"    }  }}
{  "_links": {    "authReversal": {      "method": "POST",      "href": "/pts/v2/payments/6760638084316175703955/reversals"    },    "self": {      "method": "GET",      "href": "/pts/v2/payments/6760638084316175703955"    },    "capture": {      "method": "POST",      "href": "/pts/v2/payments/6760638084316175703955/captures"    }  },  "clientReferenceInformation": {    "code": "TC50171_3"  },  "id": "6760638084316175703955",  "orderInformation": {    "amountDetails": {      "authorizedAmount": "102.00",      "currency": "USD"    }  },  "paymentAccountInformation": {    "card": {      "type": "001"    }  },  "paymentInformation": {    "tokenizedCard": {      "type": "001"    },    "shippingAddress": {      "id": "F45FD8DE51B99E9CE053A2598D0AFDFA"    },    "card": {      "type": "001"    },    "customer": {      "id": "F45FB3E443AC3C57E053A2598D0A9CFF"    }  },  "pointOfSaleInformation": {    "terminalId": "111111"  },  "processorInformation": {    "paymentAccountReferenceNumber": "V0010013019326121921451482293",    "approvalCode": "888888",    "networkTransactionId": "123456789619999",    "transactionId": "123456789619999",    "responseCode": "100",    "avs": {      "code": "X",      "codeRaw": "I1"    }  },  "reconciliationId": "698162754DTIATRS",  "status": "AUTHORIZED",  "submitTimeUtc": "2023-02-10T21:16:48Z",  "tokenInformation": {    "instrumentidentifierNew": false,    "instrumentIdentifier": {      "state": "ACTIVE",      "id": "7030000000012931531"    },    "paymentInstrument": {      "id": "F45FE45E79DCC7DBE053A2598D0AED19"    }  }}
Required Fields for Add Non-Default Payment Instrument with Validated Payment
orderInformation.amountDetails.totalAmount string

The total amount for the order.

orderInformation.amountDetails.currency string

The currency for the order. Use the three-character ISO Standard Currency Code. For RuPay, set the value to INR. Vero supports Brazilian real (BRL) currency only.

orderInformation.billTo.address1 string

The first line of the billing street address.

orderInformation.billTo.administrativeArea string

State or province in the billing address.

orderInformation.billTo.country string

Country of the billing address. Use the two-character ISO Standard Country Code.

orderInformation.billTo.email string

The customer's billing email address.

orderInformation.billTo.firstName string

The customer's first name.

orderInformation.billTo.lastName string

The customer's last name.

orderInformation.billTo.locality string

City in the billing address.

orderInformation.billTo.postalCode string

ZIP or postal code in the billing address.

paymentInformation.card.expirationMonth string

Card expiration month in two-digit format. For example, 12.

paymentInformation.card.expirationYear string

Card expiration year in four-digit format. For example, 2031.

paymentInformation.card.number string

The customer's payment card number.

paymentInformation.customer.id string

Set to the ID of the customer token you want to use.

processingInformation.actionList array

Set to TOKEN_CREATE to create a payment instrument token from this payment.

processingInformation.actionTokenTypes array

Set to paymentInstrument to create a payment instrument token.

tokenInformation.paymentInstrument.default boolean

Set to false to designate the created payment instrument as non-default.

Optional Fields for Add Non-Default Payment Instrument with Validated Payment
paymentInformation.card.type string

The card type code. For example, 001 for Visa.


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}

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

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

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

Example

{  "default": true}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F4D5E715F75E9910E053A2598D0A7278/payment-instruments/F4D5E715F7BD9910E053A2598D0A7278"    },    "customer": {      "href": "/tms/v2/customers/F4D5E715F75E9910E053A2598D0A7278"    }  },  "id": "F4D5E715F7BD9910E053A2598D0A7278",  "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": "",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  },  "metadata": {    "creator": "testrest"  },  "_embedded": {    "instrumentIdentifier": {      "_links": {        "self": {          "href": "/tms/v1/instrumentidentifiers/7010000000016241111"        },        "paymentInstruments": {          "href": "/tms/v1/instrumentidentifiers/7010000000016241111/paymentinstruments"        }      },      "id": "7010000000016241111",      "object": "instrumentIdentifier",      "state": "ACTIVE",      "card": {        "number": "411111XXXXXX1111"      },      "processingInformation": {        "authorizationOptions": {          "initiator": {            "merchantInitiatedTransaction": {              "previousTransactionId": "123456789619999"            }          }        }      },      "metadata": {        "creator": "testrest"      }    }  }}
Required Fields for Change a Customer's Default Payment Instrument
default boolean

Set to true to designate this payment instrument as the customer's default.


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}

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. The {paymentInstrumentTokenId} is the payment instrument token ID you want to retrieve. For more information, see Create a Customer and Create a Customer Payment Instrument.

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": "",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  },  "metadata": {    "creator": "testrest"  }}

Retrieve a Customer Payment Instrument with an Unmasked Card Number

This section describes how to retrieve a payment instrument with an unmasked card number.

Endpoint

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

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

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. The {paymentInstrumentTokenId} is the payment instrument token ID you want to retrieve.

The response is BASE 64-encoded JSON web encryption (JWE) token. The decoded JWE has these elements:

{ "alg": "RSA-OAEP-256", //The algorithm used to encrypt the CEK    "cty": "json", //The content type    "typ": "JWT", //The token type    "enc": "A256GCM", //The algorithm that is used to encrypt the message    "kid": "keyId" //The serial number of shared public cert for encryption of CEK}<Encrypted Data> //The encrypted payload that matches the JSON response normally returned by the TMS API, except with an unmasked payment details

Header Configuration

You must pass this request header to retrieve unmasked payment details: Accept: application/jose.

The term application/jose refers to JavaScript Object Signing and Encryption (JOSE). JOSE is a framework that provides end-to-end security to JavaScript Object Notation (JSON)-based data structures. JOSE achieves this by offering a collection of specifications to encrypt and digitally sign JSON payloads. In this case, the response is message-level encrypted using a JSON Web Token (JWT).


List Payment Instruments for a Customer

This section describes how to retrieve a customer's payment instruments.

Endpoint

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

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

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

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

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

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

Use these query string parameters to filter the list of payment instrument tokens:

  • offset: page offset number.
  • limit: maximum number of items you would like returned.

Example

GET /tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments?offset=4&limit=2
{  "_links": {    "self": {      "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments?offset=4&limit=2"    },    "first": {      "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments?offset=0&limit=2"    },    "prev": {      "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments?offset=2&limit=2"    },    "next": {      "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments?offset=6&limit=2"    },    "last": {      "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments?offset=8&limit=2"    }  },  "offset": 4,  "limit": 2,  "count": 2,  "total": 10,  "_embedded": {    "paymentInstruments": [      {        "_links": {          "self": {            "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments/7A906EC3D0F73581E0539599D30AAPI1"          },          "customer": {            "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1"          }        },        "id": "7A906EC3D0F73581E0539599D30AAPI1",        "state": "ACTIVE",        "card": {          "expirationMonth": "09",          "expirationYear": "2017",          "type": "001",          "issueNumber": "01",          "startMonth": "01",          "startYear": "2016",          "useAs": "pinless debit",          "tokenizedInformation": {            "requestorID": "12345",            "transactionType": "1"          }        },        "buyerInformation": {          "companyTaxID": "12345",          "currency": "USD",          "dateOfBirth": "2000-12-13",          "personalIdentification": [            {              "id": "57684432111321",              "type": "driver license",              "issuedBy": {                "administrativeArea": "CA"              }            }          ]        },        "billTo": {          "firstName": "John",          "lastName": "Smith",          "company": "Company Name",          "address1": "8310 Capital of Texas Highway North",          "address2": "Bluffstone Drive",          "locality": "Austin",          "administrativeArea": "TX",          "postalCode": "78731",          "country": "US",          "email": "",          "phoneNumber": "4158880000"        },        "processingInformation": {          "billPaymentProgramEnabled": true,          "bankTransferOptions": {            "SECCode": "WEB"          }        },        "merchantInformation": {          "merchantDescriptor": {            "alternateName": "Branch Name"          }        },        "metadata": {          "creator": "mid"        },        "instrumentIdentifier": {          "id": "7040000000057621111"        },        "_embedded": {          "instrumentIdentifier": {            "_links": {              "self": {                "href": "/tms/v1/instrumentidentifiers/7040000000057621111"              },              "paymentInstruments": {                "href": "/tms/v1/instrumentidentifiers/7040000000057621111/paymentinstruments"              }            },            "id": "7040000000057621111",            "object": "instrumentIdentifier",            "state": "ACTIVE",            "card": {              "number": "411111XXXXX1111"            },            "issuer": {              "paymentAccountReference": "V000000000000411111111111111"            },            "metadata": {              "creator": "mid"            }          }        }      },      {        "_links": {          "self": {            "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1/payment-instruments/7A906EC3D0F73581E0539599D30AAPI2"          },          "customer": {            "href": "/tms/v2/customers/7A906EC3D0F73581E0539599D30AADC1"          }        },        "id": "7A906EC3D0F73581E0539599D30AAPI2",        "state": "ACTIVE",        "card": {          "expirationMonth": "09",          "expirationYear": "2017",          "type": "001",          "issueNumber": "01",          "startMonth": "01",          "startYear": "2016",          "useAs": "pinless debit",          "tokenizedInformation": {            "requestorID": "12345",            "transactionType": "1"          }        },        "buyerInformation": {          "companyTaxID": "12345",          "currency": "USD",          "dateOfBirth": "2000-12-13",          "personalIdentification": [            {              "id": "57684432111321",              "type": "driver license",              "issuedBy": {                "administrativeArea": "CA"              }            }          ]        },        "billTo": {          "firstName": "John",          "lastName": "Smith",          "company": "Company Name",          "address1": "8310 Capital of Texas Highway North",          "address2": "Bluffstone Drive",          "locality": "Austin",          "administrativeArea": "TX",          "postalCode": "78731",          "country": "US",          "email": "",          "phoneNumber": "4158880000"        },        "processingInformation": {          "billPaymentProgramEnabled": true,          "bankTransferOptions": {            "SECCode": "WEB"          }        },        "merchantInformation": {          "merchantDescriptor": {            "alternateName": "Branch Name"          }        },        "metadata": {          "creator": "mid"        },        "instrumentIdentifier": {          "id": "7040000000057621111"        },        "_embedded": {          "instrumentIdentifier": {            "_links": {              "self": {                "href": "/tms/v1/instrumentidentifiers/7040000000057621111"              },              "paymentInstruments": {                "href": "/tms/v1/instrumentidentifiers/7040000000057621111/paymentinstruments"              }            },            "id": "7040000000057621111",            "object": "instrumentIdentifier",            "state": "ACTIVE",            "card": {              "number": "411111XXXXX1111"            },            "issuer": {              "paymentAccountReference": "V000000000000411111111111111"            },            "metadata": {              "creator": "mid"            }          }        }      }    ]  }}

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}

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. The {paymentInstrumentTokenId} is the payment instrument token ID you want to retrieve.

Example

{  "default": "true",  "card": {    "expirationMonth": "12",    "expirationYear": "2031",    "type": "001"  },  "billTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "address2": "Unit B",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "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",    "address2": "Unit B",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "",    "phoneNumber": "4158880000"  },  "instrumentIdentifier": {    "id": "7010000000016241111"  },  "metadata": {    "creator": "testrest"  },  "_embedded": {    "instrumentIdentifier": {      "_links": {        "self": {          "href": "/tms/v1/instrumentidentifiers/7010000000016241111"        },        "paymentInstruments": {          "href": "/tms/v1/instrumentidentifiers/7010000000016241111/paymentinstruments"        }      },      "id": "7010000000016241111",      "object": "instrumentIdentifier",      "state": "ACTIVE",      "card": {        "number": "411111XXXXXX1111"      },      "processingInformation": {        "authorizationOptions": {          "initiator": {            "merchantInitiatedTransaction": {              "previousTransactionId": "123456789012345"            }          }        }      },      "metadata": {        "creator": "testrest"      }    }  }}
Optional Fields for Update a Customer Payment Instrument
bankAccount.type string

The bank account type.

billTo.address1 string

The first line of the billing street address.

billTo.address2 string

The second line of the billing street address.

billTo.administrativeArea string

State or province in the billing address.

billTo.company string

The name of the customer's company.

billTo.country string

Country of the billing address. Use the two-character ISO Standard Country Code.

billTo.email string

The customer's billing email address.

billTo.firstName string

The customer's first name.

billTo.lastName string

The customer's last name.

billTo.locality string

City in the billing address.

billTo.phoneNumber string

The customer's phone number.

billTo.postalCode string

ZIP or postal code in the billing address.

buyerInformation.companyTaxID string

The company tax ID of the customer.

buyerInformation.currency string

The default currency for the customer.

buyerInformation.dateOfBirth string

The customer's date of birth.

buyerInformation.personalIdentification.id string

Personal identification number.

buyerInformation.personalIdentification.issuedBy.administrativeArea string

State or province that issued the personal identification.

buyerInformation.personalIdentification.type string

Type of personal identification.

card.expirationMonth string

Card expiration month in two-digit format. For example, 12.

card.expirationYear string

Card expiration year in four-digit format. For example, 2031.

card.issueNumber string

Number of times a Maestro (UK Domestic) card has been issued.

card.startMonth string

Month of the start of the Maestro (UK Domestic) card validity period.

card.startYear string

Year of the start of the Maestro (UK Domestic) card validity period.

card.type string

The card type code. For example, 001 for Visa.

card.useAs string

How the card is used. For example, credit or debit.

card.tokenizedInformation.requestorID string

Token requestor ID for the tokenized card.

card.tokenizedInformation.transactionType string

Transaction type for the tokenized card.

default boolean

Set to true if this is the default payment instrument; false otherwise.

instrumentIdentifier.id string

The instrument identifier token ID to link to this payment instrument.

processingInformation.billPaymentProgramEnabled boolean

Set to true to enable the bill payment program.

merchantInformation.merchantDescriptor.alternateName string

Alternate 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}

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. The {paymentInstrumentTokenId} is the payment instrument token ID you want to retrieve. For more information, see Create a Customer and Create a Customer Payment Instrument.


Shipping Address Tokens

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.

Endpoint

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

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

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. For more information, see Create 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 customer's non-default shipping address.

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": "",    "phoneNumber": "4158880000"  },  "metadata": {    "creator": "testrest"  }}
Optional Fields for Create a Customer Shipping Address
shipTo.address1 string

The first line of the shipping street address.

shipTo.address2 string

The second line of the shipping street address.

shipTo.administrativeArea string

State or province in the shipping address.

shipTo.company string

The name of the recipient's company.

shipTo.country string

Country of the shipping address. Use the two-character ISO Standard Country Code.

shipTo.email string

The recipient's email address.

shipTo.firstName string

The recipient's first name.

shipTo.lastName string

The recipient's last name.

shipTo.locality string

City in the shipping address.

shipTo.phoneNumber string

The recipient's phone number.

shipTo.postalCode string

ZIP 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

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. For more information, see Create a Customer.

Example

{  "default": true,  "shipTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "phoneNumber": "4158880000",    "email": ""  }}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF/shipping-addresses/F45FD8DE51A89E9CE053A2598D0AFDFA"    },    "customer": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF"    }  },  "id": "F45FD8DE51A89E9CE053A2598D0AFDFA",  "default": true,  "shipTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "",    "phoneNumber": "4158880000"  },  "metadata": {    "creator": "testrest"  }}
Required Fields for Add a Default Shipping Address
default boolean

Set to true to mark this as the default shipping address.

Optional Fields for Add a Default Shipping Address
shipTo.address1 string

The first line of the shipping street address.

shipTo.address2 string

The second line of the shipping street address.

shipTo.administrativeArea string

State or province in the shipping address.

shipTo.company string

The name of the recipient's company.

shipTo.country string

Country of the shipping address. Use the two-character ISO Standard Country Code.

shipTo.email string

The recipient's email address.

shipTo.firstName string

The recipient's first name.

shipTo.lastName string

The recipient's last name.

shipTo.locality string

City in the shipping address.

shipTo.phoneNumber string

The recipient's phone number.

shipTo.postalCode string

ZIP 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

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

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

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

The {customerTokenId} is the customer token ID returned in the id field when you created the customer token. For more information, see Create a Customer.

Example

{  "default": false,  "shipTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "phoneNumber": "4158880000",    "email": ""  }}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF/shipping-addresses/F45FD8DE51B99E9CE053A2598D0AFDFA"    },    "customer": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF"    }  },  "id": "F45FD8DE51B99E9CE053A2598D0AFDFA",  "default": false,  "shipTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "",    "phoneNumber": "4158880000"  },  "metadata": {    "creator": "testrest"  }}
Required Fields for Add a Non-Default Shipping Address
default boolean

Set to false to mark this as a non-default shipping address.

Optional Fields for Add a Non-Default Shipping Address
shipTo.address1 string

The first line of the shipping street address.

shipTo.address2 string

The second line of the shipping street address.

shipTo.administrativeArea string

State or province in the shipping address.

shipTo.company string

The name of the recipient's company.

shipTo.country string

Country of the shipping address. Use the two-character ISO Standard Country Code.

shipTo.email string

The recipient's email address.

shipTo.firstName string

The recipient's first name.

shipTo.lastName string

The recipient's last name.

shipTo.locality string

City in the shipping address.

shipTo.phoneNumber string

The recipient's phone number.

shipTo.postalCode string

ZIP 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}

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

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

PATCH /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. The {shippingAddressTokenId} is the shipping address token ID response field returned when you created a shipping address token. For more information, see Create a Customer and Create a Customer Shipping Address.

Example

{  "default": true}
{  "_links": {    "self": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF/shipping-addresses/F45FD8DE51B99E9CE053A2598D0AFDFA"    },    "customer": {      "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF"    }  },  "id": "F45FD8DE51B99E9CE053A2598D0AFDFA",  "default": true,  "shipTo": {    "firstName": "John",    "lastName": "Doe",    "company": "Company Name",    "address1": "1 Market St",    "locality": "San Francisco",    "administrativeArea": "CA",    "postalCode": "94105",    "country": "US",    "email": "",    "phoneNumber": "4158880000"  },  "metadata": {    "creator": "testrest"  }}
Required Fields for Change Default Shipping Address
default boolean

Set 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}

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

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

GET /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. The {shippingAddressTokenId} path parameter is the shipping address token ID returned in the response when you created the shipping address token. For more information, see Create a Customer and Create a Customer Shipping Address.

Example

GET /tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses/F2F4C2D1B966D631E053A2598D0AB155
{  "shipTo": {    "firstName": "Jane",    "lastName": "Smith",    "company": "Company Name",    "address1": "123 Mountain Peaks Rd",    "address2": "",    "locality": "Mountain Peaks",    "administrativeArea": "CA",    "postalCode": "90212",    "country": "US",    "email": "",    "phoneNumber": "4158880000"  }}

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

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

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

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

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

Use these query string parameters to filter the list of shipping address tokens:

  • offset: page offset number.
  • limit: maximum number of items you would like returned.

Example

GET /tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses?offset=0&limit=20
{  "_links": {    "self": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses?offset=0&limit=20"    },    "first": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses?offset=0&limit=20"    },    "last": {      "href": "/tms/v2/customers/F2F3ADA770102B51E053A2598D0A9078/shipping-addresses?offset=0&limit=20"    }  },  "offset": 0,  "limit": 20,  "count": 1,  "total": 1,  "_embedded": {    "shippingAddresses": [      {        "_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": "",          "phoneNumber": "4158880000"        },        "metadata": {          "creator": "testrest"        }      }    ]  }}

The shipping address in the first array element is the default shipping address.


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}

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

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

PATCH /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. The {shippingAddressTokenId} is the shipping address token ID response field returned when you created a shipping address token. For more information, see Create a Customer and Create a Customer Shipping Address.

Example

{  "shipTo": {    "firstName": "Jane",    "lastName": "Smith",    "company": "Company Name",    "address1": "123 Mountain Peaks Rd",    "address2": "Unit B",    "locality": "Mountain Peaks",    "administrativeArea": "CA",    "postalCode": "90212",    "country": "US",    "email": "",    "phoneNumber": "4158880000"  }}
Optional Fields for Update a Customer Shipping Address
shipTo.address1 string

The first line of the shipping street address.

shipTo.address2 string

The second line of the shipping street address.

shipTo.administrativeArea string

State or province in the shipping address.

shipTo.company string

The name of the recipient's company.

shipTo.country string

Country of the shipping address. Use the two-character ISO Standard Country Code.

shipTo.email string

The recipient's email address.

shipTo.firstName string

The recipient's first name.

shipTo.lastName string

The recipient's last name.

shipTo.locality string

City in the shipping address.

shipTo.phoneNumber string

The recipient's phone number.

shipTo.postalCode string

ZIP 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}

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

DELETE /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. The {shippingAddressTokenId} is the shipping address token ID response field returned when you created a shipping address token. For more information, see Create a Customer and Create a Customer Shipping Address.

Last published: October 28, 2026

Not available for your audience

This page isn't available for your current audience selection.