Bulk Create or Update Customers
Creates or updates up to 100 customers in your depot in one request, matching on account. If a customer with that account already exists in your depot, it is updated: the fields you send overwrite the stored values, and the fields you leave out are kept. For capacities, skills, tags, time_windows and custom_fields, sending the array replaces the customer's whole set (an empty array clears it). Leaving the array out keeps the existing set.
- Each customer needs an address, or both lat and lng. An address sent without coordinates is geocoded. If geocoding fails, the customer is still saved, just without coordinates.
- capacities are matched by id (see GET /capacities), skills and tags by name (ignoring case), and custom_fields by id or name (see GET /custom-fields). Entries that match nothing in your depot or organisation are dropped without an error.
- If any customer in the array fails validation, nothing is saved and the response is 400 INVALID_INPUT. A depot can hold at most 300,000 customers. A request that would go over that limit is also rejected with 400 INVALID_INPUT.
The response lists the id and account of each customer, in request order. This endpoint supports Idempotency, but a replayed response has the original status and an empty body, so recover the IDs with GET /customers. Because customers are matched on account, sending the same batch again updates the same customers rather than creating duplicates.
Request
- Base URL: https://api.smartroutes.io/v2
- URL: https://api.smartroutes.io/v2/customers
- Auth: none declared
Headers
Optional idempotency key for safe retries. See Idempotency for behaviour. 1–255 characters; UUID recommended.
Request body
Response
Customers created successfully
Changes
No recorded changes to this operation across all 1 revision of this API.