Skip to main content

Update Order Status

PATCH/api/v1/orders/{orderId}/status Open update order status in the API Reference.

Status reflects the Order's real fulfilment progress. Request body:

{
"status": 7,
"reason": "Packed and ready to ship",
"source": "warehouse-scanner"
}

Always send status: the contract does not mark it required, and a request that omits it asks for Created (0). reason (up to 500 characters) and source (up to 100) are optional free-text fields for your own audit trail.

status is the numeric OrderStatus value — the same representation that Create an Order, Get Order, and List Orders return. Use the table below to map numbers to names.

Status values​

ValueName
0Created
1Requested
2OnHold
3Cancelled
4Fulfilled
5Processing
6Picked
7Packed
8LabelCreated
9Returned
10Error
11Draft

A new Order starts in Created (0).

Supported transitions for this workflow​

Not every (current, target) pair is allowed — an unsupported transition returns 409. The transitions relevant to the order-to-label journey are below; Order Lifecycle has the complete table, including hold and resume.

FromToNotes
Created, Processing, or PickedPackedOptional operational status update — see below
Created, Processing, Picked, or PackedLabelCreatedSet only by a successful Label purchase. LabelCreated is never accepted as a target here
LabelCreatedFulfilledThe only path to Fulfilled — PATCH this after you have downloaded the Label and handed the shipment to the carrier
LabelCreatedPackedApplied automatically when you cancel the Label — see Cancel a Label
Draft, Requested, Created, Processing, Picked, Packed, or OnHoldCancelledAn Order with a Label cannot be cancelled: cancel the Label first
FulfilledReturned

Fulfilled is enforced: it is only reachable from LabelCreated, so you must have already purchased a Label before this call succeeds.

curl -s -X PATCH "${MAILHUB_API_BASE_URL}/api/v1/orders/${ORDER_ID}/status" \
-H "Authorization: Bearer ${MAILHUB_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"status": 4, "reason": "Handed to carrier"}'

Orders in a merged Shipment​

When the Order is in a merged Shipment, some changes apply to every Order in it, because they all travel in one box under one Label:

  • On hold, resume, hand-over (Fulfilled) and return move every Order. A resume returns each held Order to the status it was held from. A Draft Order, or one already in the target status, is left as it is.
  • All or nothing. If any other Order cannot make the move, nothing changes: the request is refused with that Order's own error, and metaData names it (orderId, orderNumber, reason).
  • Cancel affects only this Order. It takes the Order out of the merged Shipment. It is refused with 409 Shipment.MergeHasActiveLabel while a Label covers the Shipment, or 409 Shipment.MergePurchaseInProgress while one is being bought. Putting the Orders on hold is refused with the second error too.
  • Rating and buying depend on every Order. While another Order in the Shipment is Cancelled, OnHold, Fulfilled or Returned, or fails a pre-purchase check of its own, the merged Shipment cannot be rated or bought. Resolve that Order's status, or take the Shipment apart, first.

The response describes only the Order you sent the request for. Read the others with Get Order (GET /api/v1/orders/{orderId}) to see their new status. An Order with a Shipment of its own is unaffected by any of this. See also Order State Errors.

Response​

{
"success": true,
"data": {
"orderId": "5f2c1a10-2b3d-4e5f-8a9b-0c1d2e3f4a5b",
"previousStatus": 8,
"currentStatus": 4,
"updatedAt": "2026-01-01T12:00:00Z"
},
"errors": null
}

Errors​

404 if the Order does not exist for your account. 409 Order.StatusTransitionNotAllowed if the move from the Order's current status to the requested status is not a supported transition, or the Order is already in that status — retrieve the Order's current status and correct the target rather than repeating the same request. 422 if status is 10 (Error) or not a defined value, reason is longer than 500 characters, or source is longer than 100. For an Order in a merged Shipment, a refusal can also come from another Order in it, or from the Shipment's Label — see Orders in a merged Shipment.

Continue with Get Shipping Rates, or if the Order already has a Label, proceed straight to Download a Label and mark it Fulfilled afterward.