Bulk Create or Update Orders
Create or update up to 100 orders in your depot in one request. Orders are matched on order_number. A new number creates an order. A number that already exists in your depot updates that order instead of creating a duplicate, and restores it if it was deleted. Send each order complete, because some fields you leave out are reset rather than kept. To change only some fields of an existing order, use PUT /orders/{id}.
The whole batch is checked before anything is saved, and any problem rejects all of it with 400 INVALID_INPUT. This includes:
- more than 100 orders, or the same order_number twice in one request
- an order with no address for its type (shipment needs both)
- a skill, vehicle or third party that doesn't exist
- an order_exchange.reference that isn't shared by exactly two orders
If your depot doesn't allow orders without customers, any order without a customer is rejected with 403 PERMISSION. Custom fields, capacities and tags that don't exist in your depot are skipped silently, not rejected.
Addresses sent without coordinates are geocoded. A geocoding failure doesn't fail the request. The order is still saved, and the failure is listed in errors with name GEOCODING_FAILED and the order's order_number. The response gives the id and order_number of every order you sent. Fetch any of them in full with GET /orders/{id}. New orders start as OPEN, or as your depot's configured starting status. Existing orders keep their current status.
Supports Idempotency: retrying with the same idempotency-key returns the original response without processing the orders again.
Request
- Base URL: https://api.smartroutes.io/v2
- URL: https://api.smartroutes.io/v2/orders
- Auth: none declared
Headers
Optional idempotency key for safe retries. See Idempotency for behaviour. 1–255 characters; UUID recommended.
Request body
Response
Successful response
Changes
No recorded changes to this operation across all 1 revision of this API.