Cancel Label
mailhub_cancel_label
Cancel a Label that has been bought, voiding it with the carrier and returning
the Order to Packed — because the Label was wrong, or because the Order itself
has to be cancelled.
Permission and safety
| Changes data | Yes |
| Confirmation | Required — confirm: true |
| Spends funds | No |
| Permission | Update access to Orders |
Confirmation is enforced by the server.
Input
| Field | Type | Required | Notes |
|---|---|---|---|
labelId | string | Yes | The Label's UUID |
confirm | boolean | No | Defaults to false; the operation is refused unless the value is the boolean true |
orderId | string | No | An Order the Label is for, given together with shipmentId, so the result lists every Order the Label covers |
shipmentId | string | No | The Label's Shipment, given together with orderId |
The Label identifier appears on the Order — see
mailhub_list_orders and
mailhub_get_order.
Example input
{
"labelId": "44444444-4444-4444-4444-444444444444",
"confirm": true
}
Output
There is no data payload, unless orderId and shipmentId were given: the
result then lists every Order the Label covered in coversOrders. A successful
call means Mailhub asked the carrier to void the Label and the request was
accepted, and an Order that was LabelCreated is back in Packed — see
mailhub_get_order. It does not mean the carrier
has already confirmed the void.
Rules and common tool-specific errors
Mailhub asks the carrier to void the Label, clears the Shipment's tracking and
carrier selection, and moves the Order back to Packed so it can be re-rated,
bought again, or cancelled. An Order that had already moved on, such as Fulfilled or Returned, keeps its status. When several Orders share the Shipment, every one
of them loses the Label: tell the user before cancelling.
- Cancelling the same Label twice is safe. An already-cancelled Label is not sent to the carrier again; the call simply succeeds.
- Whether a Label can be voided at all is the carrier's rule, not Mailhub's. A carrier that refuses the void later, after Mailhub accepted the request, is not reported back through MCP: tell the user the void was requested, not that it is done.
- A cancelled Label can no longer be downloaded. Buy a new one if the Shipment still needs a Label.
Common tool-specific errors
| Code | What it means | Retrying |
|---|---|---|
MCP_CONFIRMATION_REQUIRED | The call did not carry confirm: true | Yes, confirming |
MCP_INVALID_UUID | labelId, orderId, or shipmentId is not a UUID | No — fix the value |
Label.NotFound | No such Label | No — re-read the Order |
Label.AccessDenied | The Label belongs to another account | No |
Shipment.TrackingCodeMissing or Carrier.NotFound | The Label's Shipment has no tracking code or carrier to void it with | No — contact Developer Support |
MCP_WRITE_RATE_LIMITED | Too many changing calls for the account just now | Yes, shortly |
Every code above, plus the access and shared failures this table does not cover, is listed in Errors & Troubleshooting.
Next
- Working with Labels — the two-step sequence for cancelling an Order that has a Label.
mailhub_buy_label— buy a replacement Label.- Confirmations & Spend Safety — why a cancellation is not a refund.