Skip to main content

The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.

Customer Address

Requires customers access scope.
Requires access to protected customer data.

The Customer Address resource represents addresses that a customer has added. Each customer can have multiple addresses associated with them.

For more information about the Customer resource, see Customer.

Was this section helpful?

Anchor to

The Customer Address resource

Anchor to

Properties


address1

The customer's mailing address


address2

An additional field for the customer's mailing address.


city

The customer's city, town, or village.


country

The customer's country.


country_code
read-only

The two-letter country code corresponding to the customer's country.


country_name

The customer’s normalized country name.


company

The customer’s company.


customer_id
deprecated

The unique identifier for the customer.


first_name

The customer’s first name.


id
read-only
->
id

The unique identifier for the address.


last_name

The customer’s last name.


name

The customer’s first and last names.


Was this section helpful?
{}

The Customer Address resource

{
"address1": "1 Rue des Carrieres",
"address2": "Suite 1234",
"city": "Montreal",
"country": "Canada",
"country_code": "CA",
"country_name": "Canada",
"company": "Fancy Co.",
"customer_id": {
"id": 1073339470
},
"first_name": "Samuel",
"id": 207119551,
"last_name": "de Champlain",
"name": "Samuel de Champlain",
"phone": "819-555-5555",
"province": "Quebec",
"province_code": "QC",
"zip": "G1R 4P5"
}

Anchor to POST request, Creates a new address for a customer
post
Creates a new address for a customer

Creates a new address for a customer.

Anchor to Parameters of Creates a new address for a customerParameters


api_version
string
required

customer_id
string
required

Was this section helpful?

Anchor to post-customers-customer-id-addresses-examplesExamples

Create a new address for a customer

Path parameters
customer_id=207119551
string
required
Was this section helpful?
post

/admin/api/unstable/customers/207119551/addresses.json

curl -d '{"address":{"address1":"1 Rue des Carrieres","address2":"Suite 1234","city":"Montreal","company":"Fancy Co.","first_name":"Samuel","last_name":"de Champlain","phone":"819-555-5555","province":"Quebec","country":"Canada","zip":"G1R 4P5","name":"Samuel de Champlain","province_code":"QC","country_code":"CA","country_name":"Canada"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 201 Created
{
"customer_address": {
"id": 1053317309,
"customer_id": 207119551,
"first_name": "Samuel",
"last_name": "de Champlain",
"company": "Fancy Co.",
"address1": "1 Rue des Carrieres",
"address2": "Suite 1234",
"city": "Montreal",
"province": "Quebec",
"country": "Canada",
"zip": "G1R 4P5",
"phone": "819-555-5555",
"name": "Samuel de Champlain",
"province_code": "QC",
"country_code": "CA",
"country_name": "Canada",
"default": false
}
}

Anchor to GET request, Retrieves a list of addresses for a customer
get
Retrieves a list of addresses for a customer

Retrieves a list of addresses for a customer. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.


api_version
string
required

customer_id
string
required

Was this section helpful?

Retrieve a limited number of addresses for a customer

Query parameters

Retrieve all of a customer’s addresses

Was this section helpful?
get

/admin/api/unstable/customers/207119551/addresses.json?limit=1

curl -X GET "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses.json?limit=1" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"addresses": [
{
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
]
}

Anchor to GET request, Retrieves details for a single customer address
get
Retrieves details for a single customer address

Retrieves details for a single customer address.


address_id
string
required

api_version
string
required

customer_id
string
required

Was this section helpful?
Was this section helpful?
get

/admin/api/unstable/customers/207119551/addresses/207119551.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/207119551.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"customer_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}

Updates an existing customer address.


address_id
string
required

api_version
string
required

customer_id
string
required

Was this section helpful?

Update the postal code of a customer address

Update the street address of a customer address

Was this section helpful?
put

/admin/api/unstable/customers/207119551/addresses/207119551.json

curl -d '{"address":{"id":207119551,"zip":"90210"}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/207119551.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 200 OK
{
"customer_address": {
"customer_id": 207119551,
"zip": "90210",
"country": "United States",
"province": "Kentucky",
"city": "Louisville",
"address1": "Chestnut Street 92",
"address2": "",
"first_name": null,
"last_name": null,
"company": null,
"phone": "555-625-1199",
"id": 207119551,
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}

Anchor to PUT request, Sets the default address for a customer
put
Sets the default address for a customer

Sets the default address for a customer.


address_id
string
required

api_version
string
required

customer_id
string
required

Was this section helpful?
Was this section helpful?
put

/admin/api/unstable/customers/207119551/addresses/1053317312/default.json

curl -X PUT "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/1053317312/default.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"customer_address": {
"id": 1053317312,
"customer_id": 207119551,
"first_name": "Bob",
"last_name": "Norman",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "Bob Norman",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}

Anchor to PUT request, Performs bulk operations for multiple customer addresses
put
Performs bulk operations for multiple customer addresses

Performs bulk operations for multiple customer addresses.


address_ids[]
required

Performs bulk operations on a list of customer address IDs. Format: address_ids[]=1&address_ids[]=2&address_ids[]=3.


api_version
string
required

customer_id
string
required

operation
required

Operation to perform by keyword (for example, destroy)


Was this section helpful?

Destroy multiple customer addresses

Query parameters
address_ids[]=1053317311
required

Performs bulk operations on a list of customer address IDs. Format: address_ids[]=1&address_ids[]=2&address_ids[]=3.

operation=destroy
required

Operation to perform by keyword (for example, destroy)

Was this section helpful?
put

/admin/api/unstable/customers/207119551/addresses/set.json?address_ids[]=1053317311&operation=destroy

curl -X PUT "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/set.json?address_ids%5B%5D=1053317311&operation=destroy" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{}

Anchor to DELETE request, Removes an address from a customer’s address list
del
Removes an address from a customer’s address list

Removes an address from a customer’s address list.


address_id
string
required

api_version
string
required

customer_id
string
required

Was this section helpful?

Remove a customer address

Removing a customer’s default address fails and returns an error

Was this section helpful?
del

/admin/api/unstable/customers/207119551/addresses/1053317310.json

curl -X DELETE "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/1053317310.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{}