Customers
Create customer
Add a customer to your account.
POST
/v1/customersBearer tokenReturns JSONSuccess 201
The mobile number identifies the customer and must be unique in your account; a second customer with the same number is refused with conflict. Add at least one address before you create an order for them.
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. |
Request body
| Field | Type | Description |
|---|---|---|
fullNamerequired | string | The customer's full name, 2 to 200 characters. |
mobilerequired | string | Mobile number in international format, for example +971501234567. Must be unique in your account. |
emailoptional | string | Email address. |
alternateNumberoptional | string | A second phone number. |
customerReferenceoptional | string | Your own id for this customer. |
notesoptional | string | Notes for your own use. |
Example request
curl -X POST "https://api.swiftazu.com/v1/customers" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fullName": "Layla Hassan",
"mobile": "+971558250908",
"email": "layla.hassan@example.com",
"customerReference": "CUST-1042"
}'Response
Example response · 201
{
"id": "8778df1e-9b74-420d-b826-d17cdad86d36"
}Errors
| HTTP | Code | Meaning |
|---|---|---|
| 409 | conflict | The change clashes with existing data. message says how. |
Every call can also return the shared errors listed on the Overview page. Overview