Swiftazu

Customers

Update address

Change one address of a customer.

PATCH/v1/customers/{customerId}/addresses/{addressId}
Bearer tokenReturns JSONSuccess 200

Send only the fields you want to change. Orders already created keep the address as it was when they were made.

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.
addressIdrequiredstringThe address's id, from List addresses.

Request body

FieldTypeDescription
formattedAddressoptionalstringThe full address as one line.
countryIdoptionalstringCountry 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 PATCH "https://api.swiftazu.com/v1/customers/8778df1e-9b74-420d-b826-d17cdad86d36/addresses/0df7f36c-417a-4145-b956-743f66c4f9b7" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "deliveryInstructions": "Call on arrival"
}'

Response

Example response · 200
{
  "status": "ok"
}

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