Skip to main content

Preview Warehouse Provider Routing Rules

POST 

/api/warehouses/:warehouse/provider-routing-rules/preview

Previews the effect of a candidate routing rule set before saving it. Read-only — nothing is written.

Required scope: warehouses:write

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

Takes the warehouse's most recent fulfillment orders (newest first) and resolves each one's shipping provider twice: today (with the currently saved rules) and with_rules (with the candidate rules in the request body). Rows where the provider or fulfillment type would differ are flagged changed: true.

Body fields: the same rules array as Replace Warehouse Provider Routing Rules (same validation and 422 cases), plus:

  • limit (integer, optional, 1–100, default 20) — how many recent fulfillment orders to evaluate.

Response (data): warehouse_id, total (rows evaluated), changed (rows whose provider would change), and fulfillment_orders[], each with fulfillment_order_id, order_reference (the fulfillment order's human reference, {sales_order_number}.{sequence} — as the fulfillment order pages show it), sales_order_id, sales_order_number, status, request_status, shipping_method_id, shipping_method, created_at, today, with_rules, changed.

today / with_rules describe the resolved provider: { integration_instance_id, name, fulfillment_type, source, routing_rule_id }. source is the step that decided it: fba, wfs, pickup, override (per-order provider override), force_manual (per-order Manual override), routing_rule, warehouse_default, or manual_backstop (nothing configured). routing_rule_id is set only for a saved rule, so it is null on with_rules rows decided by a candidate rule.

Orders with a per-order override are unaffected by rules and never show as changed.

Returns 403 without the warehouses.update permission and 404 when the warehouse does not exist.

Requires permission: warehouses.update

Authentication: Requires Bearer token.

Request​

Responses​

OK

Response Headers
    Content-Type