Skip to main content

Update Supplier Closure

PUT 

/api/supplier-closures/:supplierClosure

Replace a closure's settings. Send the full closure: the same fields and rules as create, and supplier_ids, warehouse_ids and windows are full sets that replace what is stored.

Required scope: suppliers:write

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

Authentication: Requires Bearer token (scope: suppliers, write).

Windows on update: include id on a window to keep and edit that stored window; a window without id is created; stored windows missing from the request are deleted.

The name may stay the same; it must not match a different active closure.

Body fields:

  • name (string, required, max 120) — must be unique among active closures.
  • kind (string, required) — supplier_closure or inbound_cutoff.
  • preset_key (string, optional, nullable) — the preset this closure was started from: chinese_new_year, vietnam_tet, golden_week, amazon_q4_inbound.
  • ramp_days (integer, optional, 0–60, default 0) — recovery days after each window. Forced to 0 for inbound cutoffs.
  • applies_to_all_suppliers (boolean, optional, default false) — supplier closures only: apply to every supplier, now and future.
  • supplier_ids (integer[], optional) — supplier closures only; each must be an existing supplier id, no duplicates. Required (at least one) unless applies_to_all_suppliers is true. Ignored for inbound cutoffs and when applying to all suppliers.
  • warehouse_ids (integer[], optional) — inbound cutoffs only; the destination warehouses that stop receiving. Each must be an existing warehouse id. Required (at least one) for inbound cutoffs; ignored for supplier closures.
  • windows (array, required, 1–20 items) — the full set of windows; windows must not overlap.
    • windows.*.id (integer, optional, nullable) — on update, the id of an existing window to keep and edit; omit for a new window.
    • windows.*.start_date (string, required, YYYY-MM-DD) — first closed day.
    • windows.*.end_date (string, required, YYYY-MM-DD, on or after start_date) — last closed day (inclusive).
    • windows.*.label (string, optional, nullable, max 40) — e.g. the year.
  • notes (string, optional, nullable, max 2000).

Response fields: id, name, kind, kind_label, preset_key, ramp_days (always 0 for inbound cutoffs), applies_to_all_suppliers, is_active (false = archived), notes, suppliers[] (id, name, route), warehouses[] (id, name), windows[] (id, start_date, end_date, label, days — inclusive day count), next_window (the first window that has not ended yet, or null), status (upcoming, active when today falls inside a window, past when every window has ended — relative to the account's today), created_at, updated_at.

Request​

Responses​

OK

Response Headers
    Content-Type