Add Order to Shipment
mailhub_add_order_to_shipment
Add one more Order to a merged Shipment that has no Label yet. The Order must go to the Shipment's recipient address. Its weight is added to the Shipment's parcel, and the Shipment's quoted Rates are dropped, so rate it again before buying.
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.
Adding an Order that is already in the Shipment changes nothing.
Input
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
shipmentId | string | Yes | — | The merged Shipment's UUID, from mailhub_get_order or mailhub_merge_orders |
orderId | string | Yes | — | The Order to add |
confirm | boolean | No | false | Defaults to false; the call is refused unless the value is the boolean true |
Example input
{
"shipmentId": "33333333-3333-3333-3333-333333333333",
"orderId": "22222222-2222-2222-2222-222222222222",
"confirm": true
}
Output
The merged Shipment and its Orders, passed through from Mailhub, with a note that one Label will cover every Order in it.
Rules and common tool-specific errors
- A Shipment with a Label, or one being bought, is refused with
Shipment.MergeHasActiveLabelorShipment.MergePurchaseInProgress. - An Order that cannot join is refused with
Order.MergeRefused. The result does not give the reason: callmailhub_find_merge_candidatesand read the Order'sunavailableReason. - Access and shared failures are listed in Errors & Troubleshooting.
Next
mailhub_get_shipment_rates— rate the Shipment again.