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
{customerTokenId}
is the customer token ID returned in the
id
field when you created the customer token. In the
{shippingAddressTokenId}
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.

Required Fields for Changing a Default Shipping Address

default
Set to
true
.
Change a Default Shipping Address

REST Example: Changing Default Shipping Address

Request
{ "default": true }
Response to a Successful Request
{ "_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": "Visa", "address1": "1 Market St", "locality": "san francisco", "administrativeArea": "CA", "postalCode": "94105", "country": "US", "email": "
test@cybs.com
", "phoneNumber": "4158880000" }, "metadata": { "creator": "testrest" } }
Change a Default Shipping Address