Skip to main content

Preflight Post-Submission Merge

POST 

/api/fulfillment-orders/merge-provider/preflight

Returns the read-only PLAN for merging two or more already-dispatched fulfillment orders into one provider order (post-submission cross-order merge). No provider call and no data is changed — this is the plan the operator confirms before the merge runs.

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body

  • fulfillment_order_ids (int[], required, min 2) — the already-dispatched fulfillment orders to merge.
  • primary_fulfillment_order_id (int, optional) — the order to keep as the master (it receives the others' lines). Defaults to the order with the most lines.

Response — a plan object:

  • primary_fulfillment_order_id (int) — the master.
  • provider (string | null) — the resolved shipping provider.
  • warehouse_id (int | null).
  • can_execute (bool) — true only when there are no blockers and at least two eligible members (including the master).
  • blockers (string[]) — whole-plan problems (different warehouses, providers, or addresses) that no per-order exclusion can fix.
  • members[] — one per order: fulfillment_order_id, sales_order_id, sales_order_number, role (master | absorbed), action (receive_lines | cancel), line_count, eligible (bool), reason (string | null), requires_label_void (bool), provider_order_reference (string | null), provider_status (string | null).

Request

Responses

OK

Response Headers
    Content-Type