Shipping Address Tokens
The shipping address token contains the shipping address information associated with a
customer token. This token includes any shipping address details, including the
recipient's first and last name, company, shipping address, email, and phone number. A
customer can have one or more shipping addresses, with one allocated as the customer's
default shipping address.
Manage Shipping Address Tokens
This section contains information managing shipping address tokens.
A shipping address token is associated with a customer token. You can create, retrieve, update, or delete an instrument identifier by submitting an HTTP
POST
,
GET
,
PATCH
, or
DELETE
operation to the
/tms/v2/customers/
endpoint. Use the
{customerTokenId}
/shipping-addresses
TMS
REST API shipping address endpoint to:
For more information on shipping address tokens, see Shipping Address Tokens.
Create a Customer Shipping Address
This section shows you how to create a customer shipping address.
Endpoint
Test:
POST
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production:
POST
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production in India:
POST
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
The
is the customer token ID returned in the
{customerTokenId}
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, then the shipping address will become the default. Otherwise, it will become a customer's non-default shipping address.
Add a Default Shipping Address
This section shows you how to add a default customer shipping address.
Endpoint
Test:
POST
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production:
POST
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production in India:
POST
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
The
is the customer token ID returned in the
{customerTokenId}
id
field when you created the customer token. For more information, see Create a Customer.
Add a Non-Default Shipping Address
This section shows you how to add a non-default customer shipping address.
Endpoint
Test:
POST
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production:
POST
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production in India:
POST
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
The
is the customer token ID returned in the
{customerTokenId}
id
field when you created the customer token. For more information, see Create a Customer Shipping Address.
Change a Default Shipping Address
This section shows you how to change a default customer shipping address.
Endpoint
Test:
PATCH
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production:
PATCH
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production in India:
PATCH
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
The
is the customer token ID returned in the
path parameter, pass 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.
{customerTokenId}
id
field when you created the customer token. In the
{shippingAddressTokenId}
Retrieve a Customer Shipping Address
This section shows you how to retrieve a customer shipping address.
Endpoint
Test:
GET
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production:
GET
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production in India:
GET
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
The
is the customer token ID returned in the
path parameter, pass 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.
{customerTokenId}
id
field when you created the customer token. In the
{shippingAddressTokenId}
Retrieve All Customer Shipping Addresses
This section shows you how to retrieve all customer shipping addresses.
Endpoint
Test:
GET
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production:
GET
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
Production in India:
GET
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses
The
is the customer token ID returned in the
{customerTokenId}
id
field when you created the customer token. For more information, see Create a Customer.
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.
Update a Customer Shipping Address
This section shows you how to update a customer shipping address.
Endpoint
Test:
PATCH
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production:
PATCH
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production in India:
PATCH
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
The
is the customer token ID returned in the
path parameter, pass 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.
{customerTokenId}
id
field when you created the customer token. In the
{shippingAddressTokenId}
Delete a Customer Shipping Address
This section shows you how to delete a customer shipping address.
Endpoint
Test:
DELETE
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production:
DELETE
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
Production in India:
DELETE
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/shipping-addresses/{shippingAddressTokenId}
The
is the customer token ID returned in the
path parameter, pass 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.
{customerTokenId}
id
field when you created the customer token. In the
{shippingAddressTokenId}
IMPORTANT
If you have more than one shipping address, the default shipping address cannot be deleted without first selecting a new default shipping address.
Payments with Shipping Address Tokens
This section contains information on making payments with shipping address tokens.
A shipping address token is associated with a specific customer token. This includes any shipping address details, including first and last name, company, shipping address, email, and phone number.
To make a payment using a shipping address token, you must either create the token in the authorization request or include the customer token ID as the value in the
paymentInformation.customer.id
and
paymentInformation.shippingAddress.id
fields. You can make payments using non-default shipping address tokens. For example:
For more information on shipping address tokens, see Shipping Address Tokens.
Authorizing a Payment with a Non-Default Shipping Address
This section provides the information you need in order to make a payment with a non-default shipping address.
Endpoint
Production:
POST
https://api.cybersource.com
/pts/v2/payments
Test:
POST
https://apitest.cybersource.com
/pts/v2/payments
Production in India:
POST
https://api.in.cybersource.com
/pts/v2/payments