Find Merge Candidates
mailhub_find_merge_candidates
Find the Orders that can be merged with an Order into one Shipment — one box,
bought with one Label. Candidates are Draft and Created Orders going to the
same recipient and address, from the same source. For an Order
that is already in a merged Shipment, they are the Orders that can be added to
it.
Permission and safety
| Changes data | No |
| Confirmation | Not required |
| Spends funds | No |
| Permission | View access to Orders is enough |
Input
| Field | Type | Required | Notes |
|---|---|---|---|
orderId | string | Yes | The Order's UUID. Checked for shape before the call is made. |
Example input
{
"orderId": "11111111-1111-1111-1111-111111111111"
}
Output
Mailhub's candidate list, passed through with statuses decoded to names.
Available candidates come first. Orders that match but cannot be merged now are
listed too, each with an unavailableReason — for example AlreadyMerged,
StatusNotMergeable, or ActiveLabel. When the Order itself cannot start or
extend a merge, the list is empty. At most 100 Orders are considered, in one
list with no paging. The REST guide
Merge Orders into One Shipment lists every
reason.
Next
mailhub_merge_orders— merge the available candidates.mailhub_add_order_to_shipment— add one to a merged Shipment that already exists.