Create Address

🔒

Requires write_customer access scope.

Create a new address for a specific customer.

This API is especially useful for:

  1. Adding a new shipping or billing address to a customer's profile.
  2. Managing customer address details for orders and deliveries.
  3. Supporting multi-address features for customers.

Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain), ensuring all updates are applied to the correct store.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

ParameterTypeRequiredExampleDescription
customer_idstringYes2dd957e3-2051-4cdf-8584-9c0046b4d1aeUnique identifier of the customer.

Body Parameters

FieldTypeRequiredExampleDescription
first_namestringNoRyanFirst name of the consignee.
last_namestringNoZhangLast name of the consignee.
genderstringNomaleGender of consignee. Acceptable values: male, female.
emailstringNo[email protected]Email associated with the address.
phonestringNo+86 150 1447 1143Phone number of the consignee.
phone_area_codestringNo+86Area code of the phone number.
address1stringYes1 Rue des CarrieresPrimary street address.
address2stringYesSuite 1234Secondary street address.
areastringNoBay areaArea or region of the address.
citystringNoSAN JOSECity of the address.
provincestringNoNew MexicoProvince or state of the address.
province_codestringNoNMProvince code.
countrystringYesUnited StatesFull name of the country.
country_codestringNoUSISO code of the country.
zipstringNo87036Postal or ZIP code.
companystringNoABC LimitedCompany associated with the address.
defaultbooleanNotrueWhether this is the default address for the customer.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
addressobjectThe newly created address object.
address.idstring2490dc6a-d511-4e5e-bbcb-d58e913243adUnique identifier for the address.
address.customer_idstring2dd957e3-2051-4cdf-8584-9c0046b4d1aeUnique identifier of the customer.
address.first_namestringRyanFirst name of the consignee.
address.last_namestringZhangLast name of the consignee.
address.companystringABC LimitedCompany associated with the address.
address.citystringSAN JOSECity of the address.
address.provincestringNew MexicoProvince or state of the address.
address.province_codestringNMProvince code.
address.countrystringUnited StatesFull name of the country.
address.country_codestringUSISO code of the country.
address.zipstring87036Postal or ZIP code.
address.genderstringmaleGender of the consignee.
address.phonestring+8615015570043Phone number of the consignee.
address.phone_area_codestring+86Area code of the phone number.
address.areastringBay areaArea or region of the address.
address.emailstring[email protected]Email associated with the address.
address.namestringRyan ZhangFull name of the consignee.
address.address1string1 Rue des CarrieresPrimary street address.
address.address2stringSuite 1234Secondary street address.
address.country_namestringUnited StatesFull name of the country.
address.defaultbooleantrueWhether this is the default address.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsEmail or Phone is already taken["Email is invalid"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Email is invalidProvided id is not existed.Email is invalid
Country code can't be blankinvalid email inputCountry code can't be blank
Gender is not included in the listinvalid gender inputGender is not included in the list

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!