Orders through the API
These routes do what the Orders screens do. An order is routed at once, exactly as an order created on the screen: to the partner site nearest the recipient that holds every product, split into parts when no single site does, or in exception.
| Route | Scope | Does |
|---|---|---|
POST /v1/order/create | order:write | creates one order and routes it |
GET /v1/order/list | order:read | lists your orders |
GET /v1/order/detail/<id> | order:read | one order with its lines and, for a split order, its parts |
PATCH /v1/order/detail/<id> | order:write | "status": "cancelled" cancels the order |
POST /v1/order/cancel/<id> | order:write | cancels the order before picking |
Create an order
curl -X POST https://api.logistic.ultineo.com/v1/order/create \
-H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-d '{"source_ref": "SHOP-10045", "service": "standard",
"ship_to": {"name": "Alex Sample", "line1": "12 Example Street", "postcode": "75011",
"city": "Paris", "country": "FR", "email": "alex@example.com"},
"lines": [{"sku": "TEE-BLUE-M", "quantity": 2}]}' | Field | Rule |
|---|---|
source_ref | required: your order number |
ship_to | required: name, line1, city and country (ISO 3166-1 alpha-2); optional company, line2, postcode, region, phone, email |
lines | required: 1 to 50 lines, each with a product_id or a sku and a quantity from 1 to 10000, a product at most once |
service | standard (default) or express |
note | optional |
The answer is 201 with the order. An order is accepted once: sending the same source_ref again answers 200 with the order already created, never a second one, so you can send it again after a failure.
Read an order
GET /v1/order/detail/<id> answers its reference, status, service, site (name, city, country), exception_reason, parcel once shipped, totals, the dates routed_at, exception_at, picking_at, packed_at, shipped_at, delivered_at and cancelled_at, and its lines, each with quantity, reserved and picked. A split order lists its parts in children, each part points to it in parent.
status | Means |
|---|---|
new | saved, waiting for a site |
routed | a site holds the stock; it is reserved |
split | sent as several parts, one per site |
exception | cannot go on; exception_reason says why (no_stock, for example) |
picking, packed, shipped, delivered | the site prepares, packs and ships it, then the carrier delivers it |
cancelled | will not be prepared |
GET /v1/order/list filters on status (a comma list, for example routed,exception), q (reference, order number, recipient name, company, e-mail or city), source and source_ref (exact), with limit (at most 100) and offset.
Cancel an order
Send POST /v1/order/cancel/<id>, with an optional note, or a PATCH with "status": "cancelled". An order is cancelled until the site starts picking it, and its reserved stock becomes available again; a split order is cancelled with its parts. Once picking has started, the answer is 409. To change the lines or the address, cancel the order and create a new one.