Skip to main content

Update Order Status

mailhub_update_order_status

Move one Order to another fulfillment status, when that status change is what someone actually asked for — recording fulfillment progress, cancelling an Order that will not ship, or marking one returned.

Do not use it as preparation for something else. Rating and buying a Label never require a status change first.

Permission and safety

Changes dataYes
ConfirmationRequiredconfirm: true
Spends fundsNo
PermissionUpdate access to Orders

Confirmation is enforced by the server, and one call changes exactly one Order.

Input

FieldTypeRequiredNotes
orderIdstringYesThe Order's UUID
newStatusstringYesThe target status, by name — see the list below
reasonstringNoRecorded on the Order's status history; up to 500 characters
confirmbooleanNoDefaults to false; the operation is refused unless the value is the boolean true

Statuses you can set

Created, OnHold, Cancelled, Fulfilled, Processing, Picked, Packed, Returned.

Anything else is refused with MCP_INVALID_VALUE, and the refusal lists the names above. Order Statuses carries the full set of twelve statuses, the transitions each one allows, and why the other four are not settable. In particular, Requested, LabelCreated, Error, and Draft are not settable here.

Example input

{
"orderId": "11111111-1111-1111-1111-111111111111",
"newStatus": "Packed",
"reason": "Packed on the morning run",
"confirm": true
}

Output

The updated Order state, carrying both the status name and its numeric code, so you can see which status was actually applied rather than only that a change went through.

Rules and common tool-specific errors

Mailhub checks that the move is legal from the Order's current status and applies it, recording the change — and your reason, if you gave one — on the Order's status history.

  • Not every move is legal from every status, and several are irreversible. An illegal move is refused, and where Mailhub can say so, the refusal names the statuses the Order can actually move to next — read it rather than guessing.
  • An Order that was put on hold resumes to the status it was held from, not to an arbitrary one.

Common tool-specific errors

CodeWhat it meansRetrying
MCP_CONFIRMATION_REQUIREDThe call did not carry confirm: trueYes, confirming
MCP_INVALID_VALUEnewStatus is not one of the settable namesNo — use a listed name
MCP_INVALID_UUIDorderId is not a UUIDNo — fix the value
Order.StatusTransitionNotAllowedMailhub refused the status changeNo — read the message and pick a target the Order accepts

Every refused status change arrives under that one code. The message says which case it is, and there is no per-case code to branch on:

The message saysWhat to do
The Order is already in that statusNothing — carry on from where it is
The transition is not allowed, naming the reachable statusesPick one of those
LabelCreated is set when a Label is purchasedBuy a Label instead — that is what sets it
An Order with a purchased Label returns to Packed only by cancelling itCancel the Label
The Order cannot be cancelled directly while it holds a LabelCancel the Label first, then cancel the Order
A draft Order's status cannot be set directlyLeave Draft alone
The Order was put on hold from a named statusResume it to that status

Every code above, plus the access and shared failures this table does not cover, is listed in Errors & Troubleshooting.

Next