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
| Field | Type | Description |
|---|---|---|
Authorizationrequired | string | The access token from Get token, as "Bearer <token>". |
Content-Typerequired | string | Always application/json when a body is sent. |
Path parameters
| Field | Type | Description |
|---|---|---|
customerIdrequired | string | The customer's id. |
addressIdrequired | string | The address's id, from List addresses. |
Request body
| Field | Type | Description |
|---|---|---|
formattedAddressoptional | string | The full address as one line. |
countryIdoptional | string | Country id, from List countries. |
stateIdoptional | string | State id, from List states. |
cityIdoptional | string | City id, from List cities. Needed for the coverage check. |
buildingUnitoptional | string | Building, floor or unit. |
postalCodeoptional | string | Postal code. |
latitudeoptional | number | Latitude, if you have it. |
longitudeoptional | number | Longitude, if you have it. |
customFieldValuesoptional | object | Extra fields some countries require, as key and value pairs. |
labeloptional | string | A short name for the address, for example Home. |
contactNameoptional | string | Who to ask for at this address. |
contactPhoneoptional | string | Phone number at this address. |
deliveryInstructionsoptional | string | Instructions 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
| HTTP | Code | Meaning |
|---|---|---|
| 404 | not_found | The record does not exist, or it is not yours. |
| 400 | invalid_request | The request broke a business rule. message says which one. |
Every call can also return the shared errors listed on the Overview page. Overview