The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide.

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?

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

Creates a new address for a customer.

api_version
string
required

customer_id
string
required

Was this section helpful?
Path parameters
customerid=207119551
string
required
Was this section helpful?
post
/admin/api/2024-10/customers/207119551/addresses.json
Copy
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/2024-10/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": 1053317305,
    "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
  }
}

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?
Query parameters
Was this section helpful?
get
/admin/api/2024-10/customers/207119551/addresses.json?limit=1
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/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
    }
  ]
}

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/2024-10/customers/207119551/addresses/207119551.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/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?
Was this section helpful?
put
/admin/api/2024-10/customers/207119551/addresses/207119551.json
Copy
curl -d '{"address":{"id":207119551,"zip":"90210"}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2024-10/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
  }
}

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/2024-10/customers/207119551/addresses/1053317302/default.json
Copy
curl -X PUT "https://your-development-store.myshopify.com/admin/api/2024-10/customers/207119551/addresses/1053317302/default.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "customer_address": {
    "id": 1053317302,
    "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
  }
}

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?
Query parameters
addressids[]=1053317304
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/2024-10/customers/207119551/addresses/set.json?addressids[]=1053317304&operation=destroy
Copy
curl -X PUT "https://your-development-store.myshopify.com/admin/api/2024-10/customers/207119551/addresses/set.json?address_ids%5B%5D=1053317304&operation=destroy" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{}

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?
Was this section helpful?
del
/admin/api/2024-10/customers/207119551/addresses/1053317303.json
Copy
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2024-10/customers/207119551/addresses/1053317303.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{}