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.
warehouses:writeGrant 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
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.