版权所有©,上海海鼎信息工程股份有限公司,2016-2025,保留所有权利。
1. 接口定义
1.1. 订单占货服务
1.1.1. 订单占货
POST /{tenant_id}/invc/orderstockservice/lock
1.1.1.1. 说明
订单占货
1.1.1.2. 参数
| 类型 | 名称 | 说明 | 类型 |
|---|---|---|---|
Path |
tenant_id |
租户ID |
string |
Query |
operator |
操作人 |
string |
Body |
param |
占货参数 |
1.1.1.3. 响应
| HTTP代码 | 说明 | 类型 |
|---|---|---|
200 |
successful operation |
1.1.1.4. HTTP请求示例
请求 path
/string/invc/orderstockservice/lock?operator=string
请求 body
{
"items" : [ {
"sku_id" : "12",
"qty" : 32.0
} ],
"order_id" : "4545454545454542",
"platform_id" : "jdo2o",
"shop_id" : "12121212",
"shop_name" : "百度外卖",
"store_id" : "43435545",
"store_name" : "aaa",
"request_id" : "3232323",
"lock_type" : "3232323"
}
1.1.1.5. HTTP响应示例
响应 200
{
"success" : true,
"message" : "占货失败",
"stock_state" : "locked",
"lock_result" : "none",
"lock_id" : "string",
"store_id" : "string"
}
1.1.2. 查询订单占货
GET /{tenant_id}/invc/orderstockservice/order/lockresult
1.1.2.1. 说明
查询订单占货
1.1.2.2. 参数
| 类型 | 名称 | 说明 | 类型 |
|---|---|---|---|
Path |
tenant_id |
租户ID |
string |
Query |
order_id |
订单号 |
string |
1.1.2.3. 响应
| HTTP代码 | 说明 | 类型 |
|---|---|---|
200 |
successful operation |
1.1.2.4. HTTP请求示例
请求 path
/string/invc/orderstockservice/order/lockresult?order_id=string
1.1.2.5. HTTP响应示例
响应 200
{
"success" : true,
"message" : "占货失败",
"stock_state" : "locked",
"lock_result" : "none",
"lock_id" : "string",
"store_id" : "string"
}
1.1.3. 获取指定货号平台商家占用门店库存记录
GET /{tenant_id}/invc/orderstockservice/orderstocks
1.1.3.1. 说明
获取指定货号平台商家占用门店库存记录
1.1.3.2. 参数
| 类型 | 名称 | 说明 | 类型 |
|---|---|---|---|
Path |
tenant_id |
租户ID |
string |
Query |
platform_id |
平台id |
string |
Query |
shop_id |
商家id |
string |
Query |
shop_id |
门店id |
string |
Query |
sku_ids |
货号集合 |
< string > array(multi) |
1.1.3.3. 响应
| HTTP代码 | 说明 | 类型 |
|---|---|---|
200 |
successful operation |
1.1.3.4. HTTP请求示例
请求 path
/string/invc/orderstockservice/orderstocks?platform_id=string&shop_id=string&sku_ids=string
1.1.3.5. HTTP响应示例
响应 200
{
"operator" : "string",
"skus" : [ {
"available" : 155.0,
"sku_id" : "54654",
"fixed_qty" : 10.0,
"stock_qty" : 12.0,
"change_time" : "2019-07-30 00:00:00",
"task_id" : "54654"
} ],
"business_type" : "order",
"business_key" : "4089440170477411908"
}
1.1.4. 订单占货发货|出库
PUT /{tenant_id}/invc/orderstockservice/ship/{order_id}
1.1.4.1. 说明
订单占货发货|出库
1.1.4.2. 参数
| 类型 | 名称 | 说明 | 类型 |
|---|---|---|---|
Path |
order_id |
订单号 |
string |
Path |
tenant_id |
租户ID |
string |
Query |
operator |
操作人 |
string |
1.1.4.3. 响应
| HTTP代码 | 说明 | 类型 |
|---|---|---|
200 |
successful operation |
1.1.4.4. HTTP请求示例
请求 path
/string/invc/orderstockservice/ship/string?operator=string
1.1.4.5. HTTP响应示例
响应 200
{
"success" : true,
"code" : "string",
"message" : "string"
}
1.1.5. 取消占货
POST /{tenant_id}/invc/orderstockservice/unlock
1.1.5.1. 说明
取消订单占货,释放占用库存
1.1.5.2. 参数
| 类型 | 名称 | 说明 | 类型 |
|---|---|---|---|
Path |
tenant_id |
租户ID |
string |
Query |
operator |
操作人 |
string |
Query |
order_id |
订单号 |
string |
Query |
request_id |
标识一次占货请求,如果不为空表示释放某一次请求的占货结果,如果为空表示释放订单的占货结果 |
string |
1.1.5.3. 响应
| HTTP代码 | 说明 | 类型 |
|---|---|---|
200 |
successful operation |
1.1.5.4. HTTP请求示例
请求 path
/string/invc/orderstockservice/unlock?operator=string&order_id=string
1.1.5.5. HTTP响应示例
响应 200
{
"success" : true,
"code" : "string",
"message" : "string"
}
2. 定义
2.1. ActionResult
| 名称 | 说明 | 类型 |
|---|---|---|
code |
样例 : |
string |
message |
样例 : |
string |
success |
默认值 : |
boolean |
2.2. LockStockResult
占货结果
| 名称 | 说明 | 类型 |
|---|---|---|
lock_id |
占货ID |
string |
lock_result |
占货结果,取值:none(未占货), lock_all(全部占货), lock_part(部分占货) |
string |
message |
消息 |
string |
stock_state |
占货状态,取值:initial(未占货), locked(已占货), shipped(已发货), aborted(已作废) |
enum (initial, locked, shipped, aborted) |
store_id |
门店ID |
string |
success |
是否成功,取值:true(成功), false(失败) |
boolean |
2.4. OrderDataParam
占货参数
| 名称 | 说明 | 类型 |
|---|---|---|
items |
明细 |
< OrderDataItem > array |
lock_type |
占货类型:(pre_lock)预占、(lock)在单库存 |
string |
order_id |
订单号 |
string |
platform_id |
平台id |
string |
request_id |
请求标识ID,识别一次占货请求 |
string |
shop_id |
平台商家id |
string |
shop_name |
平台商家名称 |
string |
store_id |
门店id |
string |
store_name |
门店名称 |
string |
2.5. SkuQuantity
库存
| 名称 | 说明 | 类型 |
|---|---|---|
available |
可用库存数 |
number |
change_time |
库存变化时间 |
string (date-time) |
fixed_qty |
期初库存数 |
number |
sku_id |
商品ID |
string |
stock_qty |
占用库存 |
number |
task_id |
任务ID |
string |
2.6. SkuQuantityList
当前可用库存集合
| 名称 | 说明 | 类型 |
|---|---|---|
business_key |
业务关键字 |
string |
business_type |
业务类型 |
string |
operator |
操作人 |
string |
skus |
当前可用库存集合 |
< SkuQuantity > array |