# 4 仓库
# 4.1 仓库信息
# 4.1.1 获取仓库信息 (GET)
# URL
https://developers.cjdropshipping.com/api2.0/v1/warehouse/detail
# CURL
curl --location 'https://developers.cjdropshipping.com/api2.0/v1/warehouse/detail?id=201e67f6ba4644c0a36d63bf4989dd70' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
| 参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
|---|---|---|---|---|---|
| id | 仓库id | string | 是 | 200 | Query |
# 返回
success
{
"code": 200,
"result": true,
"message": "Success",
"data": {
"id": "201e67f6ba4644c0a36d63bf4989dd70",
"name": "Cranbury Warehouse",
"areaId": 2,
"areaCountryCode": "US",
"address1": "Cranbury, New Jersey ",
"address2": null,
"contacts": null,
"phone": "+1-9095862127",
"city": "Cranbury",
"province": "New Jersey",
"logisticsBrandList": [
{
"id": "USPS",
"name": "USPS"
},
{
"id": "FedEx",
"name": "FedEx"
},
{
"id": "UPS",
"name": "UPS"
},
{
"id": "GOFO",
"name": "GOFO"
},
{
"id": "DHL",
"name": "DHL"
},
{
"id": "UniUni",
"name": "UniUni"
},
{
"id": "CBT",
"name": "CBT"
}
],
"isSelfPickup": null,
"zipCode": null
},
"requestId": "2b97f15603384fe4832e85617cf07d9c",
"success": true
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| id | 仓库id | string | 200 | |
| name | 仓库名称 | string | 200 | |
| areaId | 区域id | integer | 200 | |
| areaCountryCode | 区域国家二字码 | string | 200 | |
| province | 省份 | string | 200 | |
| city | 城市 | string | 200 | |
| address1 | 地址1 | string | 200 | |
| address2 | 地址2 | string | 200 | |
| contacts | 联系人 | string | 200 | |
| phone | 联系人电话 | string | 200 | |
| isSelfPickup | 是否支持自提 | integer | 1 | 1: 支持 0: 不支持 |
| zipCode | 邮政编码 | string | 200 | |
| logisticsBrandList | 支持的品牌列表 | list | 200 | |
| - id | 品牌ID | string | 200 | |
| - name | 品牌名称 | string | 200 |
error
{
"code": 1608001,
"result": false,
"message": "Warehouse info not found",
"data": null,
"requestId": "c5d92fbc9c794c5caa0ce453dd9c9236",
"success": false
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| code | 错误码 | int | 20 | 返回错误码标准表 |
| result | 是否正常返回 | boolean | 1 | |
| message | 返回信息 | string | 200 | |
| data | object | 接口数据返回 | ||
| requestId | 请求Id | string | 48 | 用于日志查询错误 |
# 4.2 私有库存
以下接口均使用当前 CJ-Access-Token 对应账号查询私有库存数据,接口服务端会自动绑定当前用户,无需在请求体中传 userId。
# 4.2.1 查询私有库存SPU分页 (POST)
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySpuPage
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySpuPage' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"pageNum": 1,
"pageSize": 20,
"keyword": "shirt",
"availableStock": true,
"productId": "1234567890",
"sku": "CJNS000000101AZ",
"sortField": "totalWarehouseQuantity",
"sortType": "desc"
}'
| 参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
|---|---|---|---|---|---|
| pageNum | 页码 | integer | 否 | 20 | 默认1 |
| pageSize | 每页条数 | integer | 否 | 20 | 默认20 |
| keyword | 搜索关键字 | string | 否 | 200 | 可按商品名称/SPU/SKU等模糊搜索 |
| availableStock | 是否仅查询有可用库存商品 | boolean | 否 | 1 | true-仅有库存 |
| pack | 是否包装商品 | boolean | 否 | 1 | true-是 |
| serviceProd | 是否服务商品 | boolean | 否 | 1 | true-是 |
| pod | 是否POD商品 | boolean | 否 | 1 | true-是 |
| productId | 商品ID | string | 否 | 200 | CJ商品ID |
| sku | SKU | string | 否 | 200 | 商品SKU |
| sortField | 排序字段 | string | 否 | 100 | 如 totalWarehouseQuantity、minStockPrice |
| sortType | 排序方式 | string | 否 | 10 | asc/desc |
# 返回
success
{
"code": 200,
"result": true,
"message": "Success",
"data": {
"pageSize": 20,
"pageNumber": 1,
"totalRecords": 1,
"totalPages": 1,
"content": [
{
"productId": "1234567890",
"productName": "Private Inventory Product",
"spu": "CJNS0000001",
"productPic": "https://...",
"productType": "NORMAL",
"skuQuantity": 3,
"totalWarehouseQuantity": 100,
"minStockPrice": 1.23,
"maxStockPrice": 2.34,
"warehouseQuantityInfoList": [
{
"countryCode": "US",
"warehouseQuantity": 100,
"clientTransitQuantity": 0
}
]
}
]
},
"requestId": "2b97f15603384fe4832e85617cf07d9c"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| pageSize | 每页条数 | long | 20 | 分页字段 |
| pageNumber | 当前页 | long | 20 | 分页字段 |
| totalRecords | 总记录数 | long | 20 | 分页字段 |
| totalPages | 总页数 | long | 20 | 分页字段 |
| content | SPU库存列表 | list | ||
| productId | 商品ID | string | 200 | |
| productName | 商品名称 | string | 500 | |
| spu | SPU | string | 200 | |
| productPic | 商品图片 | string | 500 | |
| productType | 商品类型 | string | 100 | |
| skuQuantity | SKU数量 | integer | 20 | |
| totalWarehouseQuantity | 仓库总库存 | long | 20 | |
| minStockPrice | 最小库存单价 | BigDecimal | (18,2) | 单位:$(美元) |
| maxStockPrice | 最大库存单价 | BigDecimal | (18,2) | 单位:$(美元) |
| warehouseQuantityInfoList | 仓库库存列表 | list | ||
| - countryCode | 仓库国家二字码 | string | 20 | 如 CN、US |
| - warehouseQuantity | 仓库库存数量 | long | 20 | |
| - clientTransitQuantity | 在途数量 | long | 20 |
# 4.2.2 根据商品ID查询私有库存SKU列表 (POST)
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuListByProductId
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuListByProductId' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"productId": "1234567890",
"keyword": "black",
"variantId": "9876543210"
}'
| 参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
|---|---|---|---|---|---|
| productId | 商品ID | string | 是 | 200 | CJ商品ID |
| keyword | 搜索关键字 | string | 否 | 200 | 可按SKU/规格模糊搜索 |
| variantId | 变体ID | string | 否 | 200 | CJ变体ID |
# 返回字段
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| data | SKU库存列表 | list | ||
| merchantId | 商户ID | string | 200 | |
| productId | 商品ID | string | 200 | |
| variantId | 变体ID | string | 200 | |
| sku | SKU | string | 200 | |
| productName | 商品名称 | string | 500 | |
| variantKey | 变体属性 | string | 500 | |
| variantValue1 | 变体值1 | string | 200 | |
| variantValue2 | 变体值2 | string | 200 | |
| variantValue3 | 变体值3 | string | 200 | |
| bigImage | 变体图片 | string | 500 | |
| minStockPrice | 最小库存单价 | BigDecimal | (18,2) | 单位:$(美元) |
| maxStockPrice | 最大库存单价 | BigDecimal | (18,2) | 单位:$(美元) |
| warehouseQuantityInfoList | 仓库库存列表 | list | 字段同4.2.1 |
# 4.2.3 查询私有库存SKU明细分页 (POST)
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuDetailPage
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuDetailPage' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"pageNum": 1,
"pageSize": 20,
"sku": "CJNS000000101AZ",
"productId": "1234567890",
"storageIds": ["US"],
"availableStock": true
}'
| 参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
|---|---|---|---|---|---|
| pageNum | 页码 | integer | 否 | 20 | 默认1 |
| pageSize | 每页条数 | integer | 否 | 20 | 默认20 |
| sku | SKU | string | 否 | 200 | |
| productId | 商品ID | string | 否 | 200 | |
| keyword | 搜索关键字 | string | 否 | 200 | 可按SKU/商品名称等模糊搜索 |
| orderCode | 备货订单号 | string | 否 | 200 | 私有库存来源订单号 |
| storageIds | 仓库ID列表 | list | 否 | 200 | 如 CN、US |
| availableStock | 是否仅查询有可用库存SKU | boolean | 否 | 1 | true-仅有库存 |
| pack | 是否包装商品 | boolean | 否 | 1 | true-是 |
| serviceProd | 是否服务商品 | boolean | 否 | 1 | true-是 |
| pod | 是否POD商品 | boolean | 否 | 1 | true-是 |
| skuList | SKU列表 | list | 否 | 多SKU精确查询 |
# 返回字段
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| pageSize/pageNumber/totalRecords/totalPages | 分页字段 | long | 20 | 同4.2.1 |
| content | SKU明细列表 | list | ||
| merchantId | 商户ID | string | 200 | |
| sku | SKU | string | 200 | |
| variantId | 变体ID | string | 200 | |
| productId | 商品ID | string | 200 | |
| productName | 商品名称 | string | 500 | |
| storageId | 仓库ID | string | 100 | |
| clientTransitQuantity | 在途数量 | long | 20 | |
| clientAvailableQuantity | 可用数量 | long | 20 | |
| clientLockQuantity | 锁定数量 | long | 20 | |
| clientUseQuantity | 已使用数量 | long | 20 | |
| clientDisputeQuantity | 纠纷数量 | long | 20 | |
| clientDisputeCompleteQuantity | 纠纷完成数量 | long | 20 | |
| clientFreezeQuantity | 冻结数量 | long | 20 | |
| variantKey | 变体属性 | string | 500 | |
| bigImage | 变体图片 | string | 500 |
# 4.2.4 根据SKU查询私有库存批次明细 (POST)
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuDetailListBySku
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuDetailListBySku' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"sku": "CJNS000000101AZ",
"orderCode": "SY230101000001",
"storageIds": ["US"],
"availableStock": true
}'
| 参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
|---|---|---|---|---|---|
| sku | SKU | string | 是 | 200 | 查询SKU |
| keyword | 搜索关键字 | string | 否 | 200 | 模糊搜索 |
| orderCode | 备货订单号 | string | 否 | 200 | 私有库存来源订单号 |
| storageIds | 仓库ID列表 | list | 否 | 200 | 如 CN、US |
| availableStock | 是否仅查询有可用库存批次 | boolean | 否 | 1 | true-仅有库存 |
# 返回字段
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| data | SKU批次明细列表 | list | ||
| merchantId | 商户ID | string | 200 | |
| sku | SKU | string | 200 | |
| orderCode | 备货订单号 | string | 200 | 私有库存来源订单号 |
| storage | 仓库名称 | string | 200 | |
| storageId | 仓库ID | string | 100 | |
| unitPrice | 库存单价 | integer | 20 | 单位以接口返回为准 |
| productId | 商品ID | string | 200 | |
| orderQuantity | 订单数量 | long | 20 | |
| clientTransitQuantity | 在途数量 | long | 20 | |
| clientAvailableQuantity | 可用数量 | long | 20 | |
| clientLockQuantity | 锁定数量 | long | 20 | |
| clientUseQuantity | 已使用数量 | long | 20 | |
| clientDisputeQuantity | 纠纷数量 | long | 20 | |
| clientDisputeCompleteQuantity | 纠纷完成数量 | long | 20 | |
| clientFreezeQuantity | 冻结数量 | long | 20 |
# 4.2.5 查询私有库存SKU流水分页 (POST)
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuFlowByCondition
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuFlowByCondition' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"pageNum": 1,
"pageSize": 20,
"sku": "CJNS000000101AZ",
"orderCode": "SY230101000001",
"eventOrderCode": "ORDER230101000001",
"storageId": "US",
"recordId": "REC123456",
"clientVisible": 1
}'
| 参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
|---|---|---|---|---|---|
| pageNum | 页码 | integer | 否 | 20 | 默认1 |
| pageSize | 每页条数 | integer | 否 | 20 | 默认20 |
| sku | SKU | string | 否 | 200 | 查询SKU流水 |
| orderCode | 备货订单号 | string | 否 | 200 | 私有库存来源订单号 |
| eventOrderCode | 业务单号 | string | 否 | 200 | 产生库存变更的订单/业务单号 |
| storageId | 仓库ID | string | 否 | 100 | 如 CN、US |
| unitPrice | 库存单价 | integer | 否 | 20 | 单位以接口返回为准 |
| recordId | 流水记录ID | string | 否 | 200 | 精确查询流水记录 |
| clientVisible | 客户端可见标识 | integer | 否 | 1 | 1-可见,0-不可见 |
# 返回
success
{
"code": 200,
"result": true,
"message": "Success",
"data": {
"pageSize": 20,
"pageNumber": 1,
"totalRecords": 1,
"totalPages": 1,
"content": [
{
"clientRecordId": "REC123456",
"eventDesc": "Stock in",
"changeQuantity": 10,
"createDate": 1704067200000,
"eventOrderCode": "ORDER230101000001",
"orderCode": "SY230101000001",
"storage": "US Warehouse",
"storageId": "US",
"clientAvailableQuantity": 100,
"clientAvailableChangeQuantity": "+10"
}
]
},
"requestId": "2b97f15603384fe4832e85617cf07d9c"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| pageSize/pageNumber/totalRecords/totalPages | 分页字段 | long | 20 | 同4.2.1 |
| content | SKU流水列表 | list | ||
| clientRecordId | 客户端流水记录ID | string | 200 | |
| eventDesc | 流水事件描述 | string | 500 | |
| changeQuantity | 变更数量 | long | 20 | 正数增加,负数减少 |
| createDate | 创建时间 | long | 20 | 时间戳 |
| eventOrderCode | 业务单号 | string | 200 | 产生库存变更的订单/业务单号 |
| eventOrderCodeType | 业务单号类型 | integer | 20 | 以接口返回枚举为准 |
| clientVisible | 客户端可见标识 | integer | 1 | 1-可见,0-不可见 |
| orderCode | 备货订单号 | string | 200 | 私有库存来源订单号 |
| storage | 仓库名称 | string | 200 | |
| storageId | 仓库ID | string | 100 | |
| unitPrice | 库存单价 | integer | 20 | 单位以接口返回为准 |
| clientTransitQuantity | 在途数量 | long | 20 | |
| clientAvailableQuantity | 可用数量 | long | 20 | |
| clientLockQuantity | 锁定数量 | long | 20 | |
| clientUseQuantity | 已使用数量 | long | 20 | |
| clientDisputeQuantity | 纠纷数量 | long | 20 | |
| clientDisputeCompleteQuantity | 纠纷完成数量 | long | 20 | |
| clientFreezeQuantity | 冻结数量 | long | 20 | |
| clientTransitChangeQuantity | 在途数量变更值 | string | 50 | 如 +1、-1 |
| clientAvailableChangeQuantity | 可用数量变更值 | string | 50 | 如 +1、-1 |
| clientLockChangeQuantity | 锁定数量变更值 | string | 50 | 如 +1、-1 |
| clientUseChangeQuantity | 已使用数量变更值 | string | 50 | 如 +1、-1 |
| clientDisputeChangeQuantity | 纠纷数量变更值 | string | 50 | 如 +1、-1 |
| clientDisputeChangeCompleteQuantity | 纠纷完成数量变更值 | string | 50 | 如 +1、-1 |
| clientFreezeChangeQuantity | 冻结数量变更值 | string | 50 | 如 +1、-1 |
| skuDetailInfo | SKU库存快照 | object | 包含各库存维度的变更后数量 |
error
{
"code": 1600100,
"result": false,
"message": "Param error",
"data": null,
"requestId": "2b97f15603384fe4832e85617cf07d9c"
}
# 4.2.6 查询订单在仓库操作图片(POST)
查询订单在仓库中的操作照片。
# URL
https://developers.cjdropshipping.com/api2.0/v1/storehouseCenterWeb/syncStorehouseVideoRequests
# CURL
curl --location 'https://developers.cjdropshipping.com/api2.0/v1/storehouseCenterWeb/syncStorehouseVideoRequests' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"orderIdList": ["ORDER001", "ORDER002"]
}'
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| orderIdList | 订单ID列表 | List<String> | Y | - |
# 返回
成功
{
"code": 200,
"data": [
{
"orderId": "ORDER001",
"pictureJson": [
{
"url": "https://example.com/pic1.jpg",
"type": "packing"
}
]
}
],
"message": "success",
"success": true
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| orderId | 订单ID | string | 200 | |
| pictureJson | 图片JSON列表 | Array | - |
错误
{
"code": 1600100,
"result": false,
"message": "Param error",
"data": null,
"requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| code | 错误码 | int | 20 | 返回错误码标准表 |
| result | 是否正常返回 | boolean | 1 | |
| message | 返回信息 | string | 200 | |
| data | object | 接口数据返回 | ||
| requestId | 请求Id | string | 48 | 用于日志查询错误 |