Skip to content

Get Customer Addresses

Retrieve all saved addresses for the authenticated customer.

Endpoint

GET /api/shop/customer-addresses

Request Headers

HeaderRequiredDescription
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Query Parameters

ParameterRequiredDefaultDescription
sortNoidColumn to sort by — id or created_at. The compound form created_at-desc (<column>-<direction>) is also accepted.
orderNoascSort direction — asc or desc. Use desc to return the most recently added addresses first.

By default addresses are returned oldest-first (the order they were added). To show the newest address at the top, pass ?sort=created_at&order=desc (or the shorthand ?sort=created_at-desc).

Response

The response is a bare array of addresses — there is no wrapper object and no addresses key.

Address Fields

FieldTypeDescription
idintegerAddress ID. Use it on Update and Delete.
addressTypestringAlways customer for an address-book entry. Cart addresses saved during checkout carry cart_billing or cart_shipping instead.
firstName / lastNamestringName on the address.
addressstringStreet address. Note the read endpoints return address, while create and update accept and echo address1 / address2.
citystringCity.
statestringState or region code.
countrystringTwo-letter country code.
postcodestringPostal code.
email / phonestringContact details stored with the address.
defaultAddressbooleanWhether this is the customer's default address.
useForShippingbooleanCarried from checkout usage; false on a plain address-book entry.
createdAt / updatedAtstringISO 8601 timestamps.

Use Cases

  • Address picker at checkout — list the customer's entries and post the chosen one's fields to Set Shipping Address; the checkout endpoints take address fields, not an address ID.
  • Address book, newest first?sort=created_at&order=desc puts the most recently added entry at the top, which is what an "added just now" confirmation screen needs.
  • Pre-select the default — find the entry whose defaultAddress is true; there is at most one, and there may be none if the default was deleted.

Best Practices

  • Filter out cart addresses before rendering — checkout writes entries with an addressType of cart_billing or cart_shipping into the same list, and showing them makes the address book look duplicated.
  • Map address to address1 when submitting — the read returns address, but create and update expect address1; posting address stores an empty street with no error.
  • Do not assume a default exists — deleting the default promotes nothing in its place.

Released under the MIT License.