Skip to main content

Preview Label Batches

POST 

/api/shipping-label-batches/preview

Shows what Create Label Batches would do with the same body, without creating anything: how many fulfillment orders the body names (fulfillment_order_count), how many can go in a batch (eligible_count), how they split into one batch per ship-from warehouse (warehouses[]), and what would be skipped (skipped[], skipped_sales_orders[], with the same reason codes as create). When more orders match than one batch holds, too_many is true, fulfillment_order_count is the number that matched, and nothing else is worked out.

Required scope: orders:write

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

Body — pick the orders from one of three sources (source, default fulfillment_orders):

  • fulfillment_orders: scope selected (default) uses fulfillment_order_ids (at most 500); scope all uses every fulfillment order matching filters — the List Fulfillment Orders filters as bare column keys, e.g. {"status": "open", "warehouse_id": 1}; filter_groups and search may be included.
  • sales_orders: scope selected uses sales_order_ids (at most 500); scope all uses every sales order matching filters (the List Sales Orders filters). Each sales order's open fulfillment orders are batched; a sales order with none is returned in skipped_sales_orders[] with a reason_code: cancelled, already_shipped, no_open_fulfillment_order, not_found.
  • preset: preset + warehouse_id. ready_to_ship = every open, own-warehouse order at that warehouse not yet in a batch or shipped; ordered_today = those whose sales order date is today (account timezone); due_today = those whose requested ship date or ship-by date is today or earlier. See Get Label Batch Presets for the counts.
  • name (optional, max 200): batch name. Defaults to "<warehouse> · <date> · <n> orders"; when several warehouses are involved, each batch is named "<name> · <warehouse>".

Returns 200. 422 when the body is invalid.

Requires the orders write scope and the fulfillment_orders.index and fulfillment_orders.ship permissions.

Request​

Responses​

OK

Response Headers
    Content-Type