Skip to content

Create Customer Address

Add a new address to the customer's address book.

Endpoint

POST /api/shop/customer-addresses

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Request Body

json
{
  "firstName": "Jane",
  "lastName": "Doe",
  "companyName": "ANC Corporation",
  "vatId": "GB123456789",
  "email": "[email protected]",
  "phone": "9876543210",
  "address1": "456 Oak Ave",
  "address2": "Suite 200",
  "city": "Los Angeles",
  "state": "CA",
  "country": "US",
  "postcode": "90001",
  "defaultAddress": false
}

Request Parameters

ParameterTypeRequiredDescription
firstNamestringYesFirst name
lastNamestringYesLast name
companyNamestringNoCompany name
vatIdstringNoVAT identification number
emailstringYesEmail address
phonestringYesPhone number
address1stringYesStreet address line 1
address2stringNoStreet address line 2
citystringYesCity
statestringYesState/Province
countrystringYesCountry code
postcodestringYesPostal code
defaultAddressbooleanNoSet as default address

Response Fields (201 Created)

FieldTypeDescription
addressobjectCreated address details
messagestringSuccess message

Validation Rules

  • All required fields must be provided
  • Country/State must be valid
  • Phone must be valid format
  • Email must be valid format
  • Maximum 10 addresses per customer

Use Cases

  • Add billing address
  • Add shipping address
  • Save alternate location
  • Store office address
  • Store home address

Released under the MIT License.