Swiftazu

Customers

Create address

Add an address to a customer.

POST/v1/customers/{customerId}/addresses
Bearer tokenReturns JSONSuccess 201

Send the full address as one line (formattedAddress) plus the country, and the state and city where you know them, using ids from the Reference lists. The first address of a customer becomes their default. Some countries need extra fields (for example the Saudi National Address); send those in customFieldValues.

Request

Headers

FieldTypeDescription
AuthorizationrequiredstringThe access token from Get token, as "Bearer <token>".
Content-TyperequiredstringAlways application/json when a body is sent.

Path parameters

FieldTypeDescription
customerIdrequiredstringThe customer's id.

Request body

FieldTypeDescription
formattedAddressrequiredstringThe full address as one line.
countryIdrequiredstringCountry id, from List countries.
stateIdoptionalstringState id, from List states.
cityIdoptionalstringCity id, from List cities. Needed for the coverage check.
buildingUnitoptionalstringBuilding, floor or unit.
postalCodeoptionalstringPostal code.
latitudeoptionalnumberLatitude, if you have it.
longitudeoptionalnumberLongitude, if you have it.
customFieldValuesoptionalobjectExtra fields some countries require, as key and value pairs.
labeloptionalstringA short name for the address, for example Home.
contactNameoptionalstringWho to ask for at this address.
contactPhoneoptionalstringPhone number at this address.
deliveryInstructionsoptionalstringInstructions for the driver.
Example request
curl -X POST "https://api.swiftazu.com/v1/customers/8778df1e-9b74-420d-b826-d17cdad86d36/addresses" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "formattedAddress": "Burj Views B, Downtown Dubai",
  "countryId": "cfde4319-9563-4d6a-9afa-0f72dad3c718",
  "stateId": "73ff99bd-ca0e-4ec7-a60e-f314c57c0046",
  "cityId": "23a058c2-9b96-460b-92d8-1196cba2f562",
  "buildingUnit": "Apt 1203",
  "label": "Home",
  "contactName": "Layla Hassan",
  "contactPhone": "+971558250908"
}'

Response

Example response · 201
{
  "id": "0df7f36c-417a-4145-b956-743f66c4f9b7"
}

Errors

HTTPCodeMeaning
404not_foundThe record does not exist, or it is not yours.
400invalid_requestThe request broke a business rule. message says which one.

Every call can also return the shared errors listed on the Overview page. Overview