Complete Draft Order
mailhub_complete_draft_order
Finish a Draft — an Order that exists but is still missing details — and move it
to Created. Find Drafts with
mailhub_list_orders using status: "Draft", and
read one with mailhub_get_order before completing
it.
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 completes exactly
one Order. Completing a Draft buys nothing: postage is still a separate
mailhub_buy_label call.
Input
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
orderId | string | Yes | — | The Draft Order's identifier |
details | object | No | — | Only the fields supplied or changed |
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, not a replacement. The tool reads the Draft's stored
details itself and keeps every value you do not send, so send only what the user
supplied or asked to change. There is no way to blank a field by omitting it.
Example input
{
"orderId": "55555555-5555-5555-5555-555555555555",
"details": {
"toAddress": {"phone": "512-555-0142"},
"shipments": [{"parcel": {"weight": 2.5}}]
},
"confirm": true
}
Output
The completed Order, passed through from Mailhub. It carries
the same order identifier the Draft had, now in the Created
status rather than Draft.
Rules and common tool-specific errors
- A Draft that is still missing details is refused, and stays a Draft. The refusal names the fields that are missing or invalid. Ask the user for them — package size, weight, sender address, phone — and never invent a value.
- A connected store may have changed the Order behind the Draft. The call is
then refused until the user has seen the change. Show them
storeChange.fieldsfrommailhub_get_order, and resubmit withstoreChangeReviewedAtUtcset tostoreChange.atUtconly once they agree. Sending it without showing them defeats the check. - A Draft cannot be moved by status.
mailhub_update_order_statuscan only cancel a Draft; completing one is this tool's job. - Access and shared failures — sign-in, permissions, rate guards — are listed in Errors & Troubleshooting.
Next
mailhub_get_shipment_rates— Rates for the now-Created Order's Shipment.mailhub_buy_label— buy postage for a chosen Rate.