Skip to main content

Bulk Update Supplier Availability Holds

POST 

/api/supplier-availability-holds/bulk-action

Runs one action on up to 500 holds by ID.

Required scope: suppliers:write

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

Body

  • ids (array of distinct integers, required, 1–500): hold IDs.
  • action (string, required): confirm (re-confirm the current date), end (mark available), convert_discontinued (end and mark discontinued at the supplier) or revise (apply hold).
  • hold (object, required when action is revise): the hold fields:
  • reason (string, optional, max 48): an active hold reason key (see List Supplier Hold Reasons). Defaults to out_of_stock when neither reason nor reason_code is sent.
  • reason_code (string, optional, max 16): the supplier's own code, matched case-insensitively against each active reason's import_aliases (and key). Use it instead of reason when relaying a supplier's code; it is stored on the hold as received.
  • available_on (date, optional, Y-m-d): when the supplier expects to supply again. Omit or send null for an unknown date. Must not be before today (its window may still be current) and no more than 5 years ahead.
  • date_precision (string, required with available_on): day, month or quarter. With month or quarter the date is stored as the start of that window, and planning waits for the window to end.
  • accepts_orders (boolean, optional, default true): whether the supplier still takes orders meanwhile.
  • note (string, optional, max 2000): required when the reason has requires_note (for example other).

Holds that are already ended, or fail validation, are reported in errors and the rest still run.

Response under data: total, succeeded, failed (integers) and errors (array of {id, message}).

Authentication: Requires Bearer token.

Requires permission: suppliers.update

Moving open purchase order ETAs: sending hold.update_open_po_line_etas: true (revise action) also edits purchase orders, so the caller must additionally hold the purchase_orders.update permission (and a token needs the purchase-orders:write scope). Without it the request is refused with 403 before anything is saved. ETAs are moved even when the hold itself is unchanged, and never for a hold whose date is unknown.

Revise options: hold.update_open_po_line_etas and hold.po_line_ids_excluded work as on the single save. expected_versions (object of hold id → version) makes each revise fail its row when that hold changed since you read it. A revise also fails its row when the hold named by the id has ended and been replaced.

Request​

Responses​

OK

Response Headers
    Content-Type