Address
Storefront Address API endpoints
An API endpoint to get list of customer addresses.
ReturnsAddress[]
Address object response
Error responses
401objectMissing or invalid customer token.
An API endpoint to store customer address.
Request body
Store address body
first_nameRequiredstringlast_nameRequiredstringphoneoptionalstring | nullRequired unless the shop has optional phone numbers enabled. Must be a valid international phone number.
company_nameoptionalstring | nulladdress_oneRequiredstringaddress_twooptionalstring | nullcityRequiredstringzipRequiredstringregionoptionalstringApplicable if country doesn't have regions. If empty will be lookedup by country and zip
region_idoptionalintegerApplicable if country has regions. If empty will be lookedup by country and zip
country_idRequiredintegerReturnsAddress
Address object response
Error responses
401objectMissing or invalid customer token.
422objectValidation failed. first_name or last_name is missing or not 1-50 characters, address_one or city is missing, zip is missing or outside 3-16 characters, phone is missing (when the shop requires it) or invalid ('The phone number is invalid'), country_id is missing, not an integer or unknown, region_id is missing, prohibited or not in that country, or region is missing or prohibited for that country.
An API endpoint to update a customer address. All required fields have to be sent again, but optional fields (company_name, address_two, and phone when the shop makes it optional) are merged: leaving one out keeps its current value, and sending it as an explicit null clears it.
Path parameters
address_idRequiredintegerAddress ID
Request body
Update address body. Every field is validated exactly as on create, so the required fields must be sent again even though the method is PATCH.
first_nameRequiredstringlast_nameRequiredstringphoneoptionalstring | nullRequired unless the shop has optional phone numbers enabled. Must be a valid international phone number. Left out, the current value is kept; sent as an explicit null, it is cleared.
company_nameoptionalstring | nullLeft out, the current value is kept; sent as an explicit null, it is cleared.
address_oneRequiredstringaddress_twooptionalstring | nullLeft out, the current value is kept; sent as an explicit null, it is cleared.
cityRequiredstringzipRequiredstringregionoptionalstringApplicable if country doesn't have regions. If empty will be lookedup by country and zip
region_idoptionalintegerApplicable if country has regions. If empty will be lookedup by country and zip
country_idRequiredintegerReturnsAddress
Address object response
Error responses
400objectThe address does not belong to the customer.
401objectMissing or invalid customer token.
404objectThe address does not exist.
422objectValidation failed. The body is validated exactly as on create: unknown country_id, a region_id that does not belong to that country, a region/region_id combination that does not match the country, an invalid phone number, or a zip outside 3-16 characters.
An API endpoint to delete a customer address.
Path parameters
address_idRequiredintegerAddress ID
Returns
No content
Error responses
400objectThe address does not belong to the customer.
401objectMissing or invalid customer token.
404objectThe address does not exist.
422anyThe address is in use: it is the shipping or billing address of a subscription, or the shipping address of an order awaiting delivery or a future shipment.