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
customers
access scope.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.
Endpoints
- post/admin/api/unstable/customers/{customer_
id}/addresses. json Creates a new address for a customer - get/admin/api/unstable/customers/{customer_
id}/addresses. json?limit=1 Retrieves a list of addresses for a customer - get/admin/api/unstable/customers/{customer_
id}/addresses/{address_ id}. json Retrieves details for a single customer address - put/admin/api/unstable/customers/{customer_
id}/addresses/{address_ id}. json Updates an existing customer address - put/admin/api/unstable/customers/{customer_
id}/addresses/{address_ id}/default. json Sets the default address for a customer - put/admin/api/unstable/customers/{customer_
id}/addresses/set. json?address_ ids[]=1053317311&operation=destroy Performs bulk operations for multiple customer addresses - del/admin/api/unstable/customers/{customer_
id}/addresses/{address_ id}. json Removes an address from a customer’s address list
The Customer Address resource
Properties
The customer's mailing address
An additional field for the customer's mailing address.
The customer's city, town, or village.
The customer's country.
The two-letter country code corresponding to the customer's country.
The customer’s normalized country name.
The customer’s company.
The unique identifier for the customer.
The customer’s first name.
The unique identifier for the address.
The customer’s last name.
The customer’s first and last names.
The Customer Address resource
Anchor to POST request, Creates a new address for a customerpostCreates a new address for a customer
Creates a new address for a customer.
Create a new address for a customer
Create a new address for a customer
/admin/api/unstable/customers/207119551/addresses. json
Response
examples
Create a new address for a customer
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"
import { DataType } from '@shopify/shopify-api'; const client = new shopify.clients.Rest({session}); const data = await client.post({ path: 'customers/207119551/addresses', data: {"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"}}, type: DataType.JSON, });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.post( path: 'customers/207119551/addresses', body: { "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" } }, )
import { DataType } from '@shopify/shopify-api'; const client = new shopify.clients.Rest({session}); const data = await client.post({ path: 'customers/207119551/addresses', data: {"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"}}, type: DataType.JSON, });
response
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 customergetRetrieves 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.
Retrieve a limited number of addresses for a customer
Retrieve a limited number of addresses for a customer
Retrieve all of a customer’s addresses
Retrieve all of a customer’s addresses
/admin/api/unstable/customers/207119551/addresses. json?limit= 1
Response
examples
Retrieve a limited number of addresses for a customer
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}"
const client = new shopify.clients.Rest({session}); const data = await client.get({ path: 'customers/207119551/addresses', query: {"limit":"1"}, });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.get( path: 'customers/207119551/addresses', query: { "limit": "1" }, )
const client = new shopify.clients.Rest({session}); const data = await client.get({ path: 'customers/207119551/addresses', query: {"limit":"1"}, });
response
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}]}
Retrieve all of a customer’s addresses
curl -X GET "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses.json" \ -H "X-Shopify-Access-Token: {access_token}"
const client = new shopify.clients.Rest({session}); const data = await client.get({ path: 'customers/207119551/addresses', });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.get( path: 'customers/207119551/addresses', )
const client = new shopify.clients.Rest({session}); const data = await client.get({ path: 'customers/207119551/addresses', });
response
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 addressgetRetrieves details for a single customer address
Retrieves details for a single customer address.
Retrieve a single customer address
Retrieve a single customer address
/admin/api/unstable/customers/207119551/addresses/207119551. json
Response
examples
Retrieve a single customer address
curl -X GET "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/207119551.json" \ -H "X-Shopify-Access-Token: {access_token}"
const client = new shopify.clients.Rest({session}); const data = await client.get({ path: 'customers/207119551/addresses/207119551', });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.get( path: 'customers/207119551/addresses/207119551', )
const client = new shopify.clients.Rest({session}); const data = await client.get({ path: 'customers/207119551/addresses/207119551', });
response
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}}
Anchor to PUT request, Updates an existing customer addressputUpdates an existing customer address
Updates an existing customer address.
Update the postal code of a customer address
Update the postal code of a customer address
Update the street address of a customer address
Update the street address of a customer address
/admin/api/unstable/customers/207119551/addresses/207119551. json
Response
examples
Update the postal code of a customer address
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"
import { DataType } from '@shopify/shopify-api'; const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/207119551', data: {"address":{"id":207119551,"zip":"90210"}}, type: DataType.JSON, });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.put( path: 'customers/207119551/addresses/207119551', body: { "address": { "id": 207119551, "zip": "90210" } }, )
import { DataType } from '@shopify/shopify-api'; const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/207119551', data: {"address":{"id":207119551,"zip":"90210"}}, type: DataType.JSON, });
response
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}}
Update the street address of a customer address
curl -d '{"address":{"id":207119551,"address1":"Apartment 23","address2":"Chestnut Street 92"}}' \ -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"
import { DataType } from '@shopify/shopify-api'; const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/207119551', data: {"address":{"id":207119551,"address1":"Apartment 23","address2":"Chestnut Street 92"}}, type: DataType.JSON, });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.put( path: 'customers/207119551/addresses/207119551', body: { "address": { "id": 207119551, "address1": "Apartment 23", "address2": "Chestnut Street 92" } }, )
import { DataType } from '@shopify/shopify-api'; const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/207119551', data: {"address":{"id":207119551,"address1":"Apartment 23","address2":"Chestnut Street 92"}}, type: DataType.JSON, });
response
HTTP/1.1 200 OK{"customer_address":{"customer_id":207119551,"address1":"Apartment 23","address2":"Chestnut Street 92","country":"United States","province":"Kentucky","zip":"40202","city":"Louisville","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 customerputSets the default address for a customer
Sets the default address for a customer.
Set a default address for a customer
Set a default address for a customer
/admin/api/unstable/customers/207119551/addresses/1053317312/default. json
Response
examples
Set a default address for a customer
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}"
const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/1053317312/default', });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.put( path: 'customers/207119551/addresses/1053317312/default', )
const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/1053317312/default', });
response
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 addressesputPerforms bulk operations for multiple customer addresses
Performs bulk operations for multiple customer addresses.
Performs bulk operations on a list of customer address IDs. Format: address_ids[]=1&address_ids[]=2&address_ids[]=3
.
Operation to perform by keyword (for example, destroy)
Destroy multiple customer addresses
Destroy multiple customer addresses
Performs bulk operations on a list of customer address IDs. Format: address_ids[]=1&address_ids[]=2&address_ids[]=3
.
Operation to perform by keyword (for example, destroy)
/admin/api/unstable/customers/207119551/addresses/set. json?address_ ids[]= 1053317311&operation= destroy
Response
examples
Destroy multiple customer addresses
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}"
const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/set', query: {"address_ids%5B%5D":"1053317311","operation":"destroy"}, });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.put( path: 'customers/207119551/addresses/set', query: { "address_ids%5B%5D": "1053317311", "operation": "destroy" }, )
const client = new shopify.clients.Rest({session}); const data = await client.put({ path: 'customers/207119551/addresses/set', query: {"address_ids%5B%5D":"1053317311","operation":"destroy"}, });
response
HTTP/1.1 200 OK{}
Anchor to DELETE request, Removes an address from a customer’s address listdelRemoves an address from a customer’s address list
Removes an address from a customer’s address list.
Remove a customer address
Remove a customer address
Removing a customer’s default address fails and returns an error
Removing a customer’s default address fails and returns an error
/admin/api/unstable/customers/207119551/addresses/1053317310. json
Response
examples
Remove a customer address
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/1053317310.json" \ -H "X-Shopify-Access-Token: {access_token}"
const client = new shopify.clients.Rest({session}); const data = await client.delete({ path: 'customers/207119551/addresses/1053317310', });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.delete( path: 'customers/207119551/addresses/1053317310', )
const client = new shopify.clients.Rest({session}); const data = await client.delete({ path: 'customers/207119551/addresses/1053317310', });
response
HTTP/1.1 200 OK{}
Removing a customer’s default address fails and returns an error
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/unstable/customers/207119551/addresses/207119551.json" \ -H "X-Shopify-Access-Token: {access_token}"
const client = new shopify.clients.Rest({session}); const data = await client.delete({ path: 'customers/207119551/addresses/207119551', });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Rest::Admin.new( session: session ) response = client.delete( path: 'customers/207119551/addresses/207119551', )
const client = new shopify.clients.Rest({session}); const data = await client.delete({ path: 'customers/207119551/addresses/207119551', });
response
HTTP/1.1 422 Unprocessable Entity{"errors":{"base":["Cannot delete the customer’s default address"]}}