Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

地址: http://test.birdsystem.co.ukcom/client/Container-Product/Get-Product-Stock-Info

只读,获取产品在所有站点的库存只读,获取产品在所有站点的库存(备注:用父账号key获取产品库存,能够获取到本身及包括子账号的所有库存)

参数

查询参数见操作数据

例如需要查询ID为1的产品库存时,添加URL参数:filter=[{"type":"numeric","comparison":"eq","value":11302332,"field":"product_id"}]

请求为:http://test.birdsystem.co.ukcom/client/Container-Product/Get-Product-Stock-Info?filter=[{"type":"numeric","comparison":"eq","value":1499154,"field":"product_id"}]

返回

Code Block
{
    "total": 32,//产品sku种类数
    "data": [
        {
            "product_id": 499154,
            "quantity": "11",
            "company_id": 35,
            "company_site_name": 569,  //产品ID"空运动态仓",
            "client_ref": "1-3786753345011"
           "is_dynamic_warehouse": 0//不为动态仓库
        },
        {
            "product_id": 499154,
            "quantity": "2807",
  //库存数量          "company_id": 36,
            "company_site_name": "CN 东莞站",
  //站点ID          "client_ref": "1-3786753345011"
            "is_dynamic_warehouse": 1//为动态仓库
        },
        {
            "product_id": 212236,
            "quantity": "14",
            "company_id": "0",
            "company_site_name": "CN 华南站", //站点名称Frozen Stock",//冻结库存信息单独一个数据展示
            "client_ref": "983-123456"
        }
    ],
    "success": true,
    "refresh": false,
    "moduleName": "client"
}


本接口新增一个参数, groupByWarehouse=true , 是为了能够精确获取每个仓库的库存而添加的, 只有开通了按仓库获取库存权限的客户才能使用. 其返回格式如下:

Code Block
{
    "total": 2,//产品sku种类数
    "data": [
        {
            "product_id": 499154,
            "quantity": "11",
            "company_id": 35,
            "company_site_name": "空运动态仓",
            "client_ref": "47-569" //产品客户sku1-3786753345011",
            "warehouse_id": 54,
			"warehouse_name": "仓库1",
           "is_dynamic_warehouse": 0//不为动态仓库
        },
        {
            "product_id": 469174499154,
            "quantity": "107",
            "company_id": 4436,
            "company_site_name": "共享站CN 东莞站",
            "product_client_ref": "AA211"1-3786753345011",
            "warehouse_id":  },60,
			"warehouse_name": "DG1",
        },
		{
            "product_id": 775182499154,
            "quantity": "17",
            "company_id": 36,
            "company_site_name": "CN 华南站", 东莞站",
            "client_ref": "1-3786753345011",
            "warehouse_id": 80,
			"warehouse_name": "DG2",
        },
        {
            "product_id": 212236,
            "quantity": "14",
            "company_id": "0",
            "company_site_name": "Frozen Stock",//冻结库存信息单独一个数据展示
            "client_ref": "47-775182"
983-123456",
            "warehouse_id": 0,
			"warehouse_name": "",
        }
    ],
    "success": true,
    "refresh": false,
    "moduleName": "client"
}