跳到导航

调整产品库存

Add to or subtract from the on-hand quantity of a counted product at one location, without overwriting orders taken at the same time.

路径参数

product_idstring必需

产品 ID。创建时返回;可使用 GET /v1/reception/products 列出。

请求头

xi-api-keystring可选
xi-workspace-idstring必需

经销商 API 密钥操作的客户工作区。

请求

This endpoint expects an object.
location_idstring必需
Location whose count changes.
deltainteger必需

应用于现有库存的带符号变更。若目的是“增加/减少几个”,应优先使用此项而非绝对值写入。

响应

成功响应

namestring
Name of the product.
idstring

产品 ID。

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可选

智能体在预订或订购此项目之前提出的问题。对于实用的 pricing_mode='quote' 项目,此项必填——否则报价请求中没有可供定价的信息——但也适用于需要补充详情的固定价格项目(例如染发前询问当前发色、护理前询问过敏情况)。

groupslist of objects可选

此项目的分组成员关系。每个条目包含分组标签及该项目在组内从 0 开始的排名。

ungrouped_rankinteger or null可选>=0

无分组项目中的显示位置;null 排在最后。可通过重新排序端点更改。

descriptionstring可选
Description of the product.
pricedouble or null可选>=0

产品价格;无标价时为 null。

is_activeboolean可选默认为 true

False 会隐藏产品而不删除。

orderableboolean可选默认为 true

False 会保留产品列表展示(来电者可咨询),但不可订购。

allowed_fulfillment_typeslist of enums可选

客户订购此产品时可选择的履约选项。

允许的值:
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 时间戳。

updated_at_unixinteger可选

上次更新时间,以秒为单位的 Unix 时间戳。

错误

422
Unprocessable Entity Error