/products/{id}/availability API 端点只显示 99 之前的库存?

/products/{id}/availability API endpoint only showing stock till 99?

我想从 /products/{id}/availability API 端点获取完整的库存价值。但它只有 returns 我的存货到 99。有没有办法从那个端点获得完整的存货?

据我所知,您使用的是“商店”API 而不是“数据”API。请参考以下文档指南,其中需要使用“数据”API:

并且您会对本文档部分“获取产品库存记录”感兴趣。

GET https://hostname:port/dw/data/v20_10/inventory_lists/{inventory_list_id}/product_inventory_records/{product_id}

示例请求和响应:

REQUEST:
GET  /s/-/dw/data/v20_10/inventory_lists/my-inventory-list/product_inventory_records/my-product HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

如果成功:

RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
   "_v" : "20.10",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "product_inventory_record",
   "allocation": {
        "amount": 10,
        "reset_date": "2013-04-18.74:00:22.000Z",
   },
   "ats" : 10,
   "inventory_list_id" : my-inventory-list",
   "inventory_turnover" : 0,
   "link" : "https://example.com/s/-/dw/data/v20_10/my-inventory-list/product_inventory_records/my-product",
   "perpetual_flag" : false,
   "pre_order_back_order_handling" : "none",
   "product_id" : "my-product",
   "product_name" : "my product name",
   "quantity_on_order" : 0,
   "stock_level" : 10
}