Bulk Place Supplier Availability Holds
POST/api/supplier-availability-holds/bulk
Applies one hold to many product × supplier pairs, for example every title from a publisher that is reprinting. Each pair is placed or, when it already has an open hold, revised; pairs without a supplier link, and duplicates, are reported as failed or skipped.
suppliers:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Up to 200 pairs are processed immediately and the row results are returned. Larger requests (up to 10,000 pairs) run in the background: the response is 202 with a tracked_job_log_id you can poll at GET /api/tracked-job-logs/{trackedJobLog}.
Body
pairs(array, required, 1–10,000): each{product_id, supplier_id}(integers, required).hold(object, required): the hold to apply, with the fields below, each prefixedhold.in validation errors.reason(string, optional, max 48): an active hold reason key (see List Supplier Hold Reasons). Defaults toout_of_stockwhen neitherreasonnorreason_codeis sent.reason_code(string, optional, max 16): the supplier's own code, matched case-insensitively against each active reason'simport_aliases(and key). Use it instead ofreasonwhen 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 withavailable_on):day,monthorquarter. Withmonthorquarterthe 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 hasrequires_note(for exampleother).hold.update_open_po_line_etas(boolean, optional): also move the ETA of open single-product purchase orders to each hold's earliest arrival.
Response under data (immediate): queued (false), total, placed, revised, unchanged, failed (integers), errors (array of {product_id, supplier_id, message}), hold_ids (integers) and cancelled (boolean).
Authentication: Requires Bearer token.
Requires permission: suppliers.update
Moving open purchase order ETAs: sending hold.update_open_po_line_etas: true 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.
Optimistic locking: each pair may carry expected_version and expected_hold_id (that pair's open hold version and id); a stale one fails that row with a conflict message. hold.po_line_ids_excluded lists purchase orders to leave alone when moving ETAs.
Request
Responses
- 200
- 202
- 401
- 403
- 422
- 429
OK
Response Headers
Accepted
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.
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.