Orders

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.

post/orders

Request

  • Base URL: https://api.smartroutes.io/v2
  • URL: https://api.smartroutes.io/v2/orders
  • Auth: none declared

Headers

idempotency-keystring

Optional idempotency key for safe retries. See Idempotency for behaviour. 1–255 characters; UUID recommended.

Request body

order_numberstring required

Order number.

type'delivery' | 'pickup' | 'shipment' required

Type of the order (delivery, pickup, or shipment).

prioritystring

Priority of the order (Accepts 'P1', 'P2', 'P3').

delivery_contact_namestring

Name of the contact person.

delivery_contact_numberstring

Contact number of the person.

delivery_contact_emailstring email

Email of the contact person.

delivery_addressstring

Delivery address.

delivery_country_codestring

Two letter country code, e.g. 'IE'

delivery_postcodestring

Postcode for delivery address.

delivery_latnumber

Latitude of the delivery location.

delivery_lngnumber

Longitude of the delivery location.

delivery_durationnumber

Duration for order delivery in minutes.

delivery_notesstring

Notes for delivery instructions.

delivery_datestring date

Date for order delivery.

delivery_available_daysstring[]

List of available delivery days for the order.

pickup_addressstring

Address for order pickup.

pickup_country_codestring

Two letter country code, e.g. 'IE'

pickup_postcodestring

Postcode for pickup address.

pickup_durationnumber

Duration for order pickup in minutes.

pickup_latnumber

Latitude of the pickup location.

pickup_lngnumber

Longitude of the pickup location.

pickup_notesstring

Notes for pickup instructions.

pickup_contact_namestring

Name of the contact person for pickup.

pickup_contact_numberstring

Contact number of the person for pickup.

pickup_contact_emailstring email

Email of the contact person for pickup.

pickup_available_daysstring[]

List of available pickup days for the order.

partsnumber

Number of parts in the order.

order_valuenumber double nullable

Total monetary value of the order, to 2 decimal places, at most 10,000,000. Settable only on an order with no valued line items — if any line item has a value, from product_unit_price or product_value, whether sent in this request or already stored, the value is derived from the lines and a non-null order_value returns 400. Omit to keep what is stored; null clears a manual value (and is accepted, with no effect, on a derived one); 0 means a genuinely zero-value order. When sending back an order read from GET /orders/{id}, remove order_value if its value_source is DERIVED — echoing a derived value returns 400. Orders are valued in the currency set on your organisation.

skillsstring[]

List of required skills for the order.

tagsstring[]

List of tag names (must already exist)

Response

Successful response

Changes

No recorded changes to this operation across all 1 revision of this API.