Update Draft Order
mailhub_update_draft_order
Save the details a user gives onto an existing Draft and leave it a Draft. Use
it when someone supplies package size, weight, or address details without
asking to finish the Order, and whenever a Draft still lacks something after
what they gave: save what they supplied so nothing is lost, then ask for the
rest. Read the Draft with mailhub_get_order
first.
Permission and safety
| Changes data | Yes |
| Confirmation | Required — confirm: true |
| Spends funds | No |
| Permission | Update access to Orders |
Confirmation is enforced by the server — see Confirmations & Spend Safety — and one call changes exactly one Order. Saving the same details again leaves the same Draft, so a repeat is safe.
Input
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
orderId | string | Yes | — | The Draft Order's identifier |
details | object | Yes | — | Only the fields supplied or changed; at least one |
storeChangeReviewedAtUtc | string | No | — | Sent only after showing the user a store change |
confirm | boolean | No | false | Defaults to false; the call is refused unless the value is the boolean true |
details is a patch. It takes the same shape as
mailhub_complete_draft_order: toAddress and fromAddress with the address
fields to change, and shipments, matched to the Draft's Shipments by position.
The tool reads the Draft's stored details itself and keeps every value you do
not send. An empty string clears an optional address field (name, company,
street2, phone, email). Giving a dimension drops the Draft's predefined
package, and giving a predefined package drops its dimensions.
Example input
{
"orderId": "55555555-5555-5555-5555-555555555555",
"details": {
"shipments": [{"parcel": {"weight": 2.5}}]
},
"confirm": true
}
Output
The saved Order, passed through from Mailhub. It keeps its identifier and stays a Draft, and the result lists what the Draft still needs before it can be completed.
Rules and common tool-specific errors
- Never invent a value. Details that look made up — test, example, or dummy
values, a 555 phone number, an
example.comaddress — are refused withMCP_PLACEHOLDER_VALUE, and the Draft is left as it was. - A
detailsobject that names nothing is refused withMCP_MISSING_FIELD. - An Order that is not a Draft is refused with
MCP_ORDER_NOT_DRAFT. - A connected store may have changed the Order behind the Draft. The call is
refused with
MCP_STORE_CHANGE_REVIEW_REQUIREDuntil the user has seen the change. Show themstoreChange.fieldsfrommailhub_get_order, and resubmit withstoreChangeReviewedAtUtcset tostoreChange.atUtconly once they agree. - An Order in a merged Shipment cannot change its recipient or parcel here:
the Shipment owns them. The call is refused with
MCP_ORDER_IN_MERGED_SHIPMENT; usemailhub_update_merged_shipment. - Access and shared failures — sign-in, permissions, rate guards — are listed in Errors & Troubleshooting.
Next
mailhub_complete_draft_order— finish the Draft once nothing is missing.