ナビゲーションにスキップ

Update Product Stock

Set the on-hand quantity of a counted product at one location. Rejected with a 409 if it changed since expected_on_hand was read.

パスパラメータ

product_idstring必須

ヘッダー

xi-api-keystringオプション
xi-workspace-idstring or nullオプション
The customer workspace a reseller's API key acts on.

リクエスト

This endpoint expects an object.
location_idstring必須
Location whose count is set.
on_handinteger必須>=0

The new on-hand quantity.

expected_on_handinteger必須>=0

On-hand value the caller last saw. The write is rejected with a 409 if it no longer matches, so a sale made while the caller was editing is never overwritten.

レスポンス

成功レスポンス。

namestring
Name of the product.
_idstring
pricing_modeenumオプションデフォルト値 fixed

‘fixed’ (default): the item has a known price the agent can quote, and customers can book or order it directly. ‘quote’: the price depends on the job (renovation, catering, custom work), so no price or slot is offered; the agent collects the intake_questions and files a quote request instead. Takes effect only while quotes are enabled for the business. Group services cannot use ‘quote’.

許可された値:
intake_questionslist of objectsオプション

Questions the agent asks before booking or ordering this item. Required for a useful pricing_mode='quote' item — without them a quote request arrives with nothing to price — but also valid on fixed-price items that need extra detail (current hair color before a dye job, allergies before a treatment).

groupslist of objectsオプション

Group memberships for this item. Each entry carries the group label and the item’s 0-based rank within that group.

ungrouped_rankinteger or nullオプション>=0

Display position among items with no group; null sorts last. Change it with the reorder endpoint.

descriptionstringオプション
Description of the product.
pricedouble or nullオプション>=0

Price of the product; null for no listed price.

is_activebooleanオプションデフォルト値 true
False hides the product without deleting it.
orderablebooleanオプションデフォルト値 true

False keeps the product listed (callers can ask about it) but not orderable.

allowed_fulfillment_typeslist of enumsオプション
Fulfillment options customers may choose when ordering this product.
許可された値:
location_idslist of stringsオプション

Locations where this product is sold; empty list means all locations.

stockmap from strings to integers or nullオプション

On-hand quantity by location. None means unlimited. A missing location key means zero.

created_at_unixintegerオプション

Unix timestamp (seconds since epoch)

updated_at_unixintegerオプション

Unix timestamp (seconds since epoch)

エラー

422
Unprocessable Entity Error