Skip to main content

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 dataYes
ConfirmationRequired — confirm: true
Spends fundsNo
PermissionUpdate 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​

FieldTypeRequiredDefaultNotes
shipmentIdstringYes—The merged Shipment's UUID, from mailhub_get_order or mailhub_merge_orders
orderIdstringYes—The Order to add
confirmbooleanNofalseDefaults 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.MergeHasActiveLabel or Shipment.MergePurchaseInProgress.
  • An Order that cannot join is refused with Order.MergeRefused. The result does not give the reason: call mailhub_find_merge_candidates and read the Order's unavailableReason.
  • Access and shared failures are listed in Errors & Troubleshooting.

Next​