Skip to main content

Place or Update Supplier Product Availability Hold

PUT 

/api/supplier-products/:supplier_product/availability-hold

Places a hold on the link ("unavailable at this supplier until <date>"), or revises the open one. Returns 201 when a hold was placed and 200 when the open hold was updated. Sending the same payload again changes nothing, so the call is safe to retry. Moving the date to a later window counts as a slip (slip_count).

Required scope: suppliers:write

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

While the hold is active, demand planning, purchasing suggestions and customer-facing availability (expected dates in the customer portal and sales channels) use the hold's dates. Changes fire the supplier_product.availability_changed webhook, and product.updated when the product's supply status changes.

Body

  • 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).
  • update_open_po_line_etas (boolean, optional, default false): also move the expected delivery date of open purchase orders to this supplier that carry only this product to the hold's earliest arrival (purchase orders with other products are left alone).
  • po_line_ids_excluded (array of integers, optional): purchase order IDs (from the preview's open_purchase_orders[].purchase_order_id) to leave unchanged when update_open_po_line_etas is true.
  • expected_updated_at (datetime, optional): the updated_at you last read. When the open hold has changed since, nothing is saved and 409 is returned with the current hold.
  • source (string, optional): ignored for API tokens, which are always recorded as api.

Errors: 422 for an unknown or archived reason, an unmatched reason_code, a missing required note, a past date, or a date more than 5 years ahead. 409 on a stale expected_updated_at.

Authentication: Requires Bearer token.

Requires permission: suppliers.update

Moving open purchase order ETAs: sending 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: send expected_version (the hold's version from your last read) with expected_hold_id (that hold's id). A different open hold — one ended and replaced since — is also a conflict. A stale version — or a hold that has ended since — returns 409 with the current hold (or data: null when none is open). version is bumped on every change, so two saves in the same second still conflict. expected_updated_at is still accepted as a fallback when expected_version is not sent.

Request​

Responses​

OK

Response Headers
    Content-Type