Address
Storefront Address API endpoints
An API endpoint to get list of customer addresses.
ReturnsAddress[]
Address object response
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
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.