# 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.1.2 子仓列表 (GET)

列出 CJ 自营的全部子仓(仓库)及其所属区域仓,用于按仓库名找到 storageId / areaId,再到 订单列表 按子仓或区域仓筛选订单。

  • 仓库清单与 storageId 以 CJ 仓储中心为准:storageId 与订单列表 / 订单详情返回的 storageId 写法完全一致(有的带短横线、有的不带,均原样返回),可直接作为订单列表的子仓筛选条件。
  • name 与订单列表返回的 storageName 同口径(如 Cranbury, NJ, US);city / province 取自仓库资料,某个仓暂无资料时为 null。
  • 某区域的仓库资料暂时取不到时,该区域的仓库照常返回(city / province 为 null),并在 locationUnavailableAreas 中列出该区域。
  • 只列 CJ 自营仓;供应商仓不在列表中,其 storageId 可从订单列表 / 订单详情的返回值获取。
  • 仓库清单数据源暂时不可用时返回 1608002,请稍后重试(不会返回空列表)。

# URL

https://developers.cjdropshipping.com/api2.0/v1/warehouse/list

# CURL

curl --location 'https://developers.cjdropshipping.com/api2.0/v1/warehouse/list?countryCode=US' \
     --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
参数名称 参数意义 参数类型 是否必传 长度 备注
areaId 区域仓 ID int 否 20 只列该区域的子仓;取值为全球仓库列表 /product/globalWarehouseList 返回的 areaId(如 1=中国仓、2=美国仓),须为正整数
countryCode 国家二字码 string 否 2 只列该国家的子仓,不区分大小写,如 US、CN

不传参数时返回全部 CJ 自营子仓。结果按 areaId 升序、区域内按名称排序。

# 返回

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": {
        "list": [
            {
                "storageId": "2991a224-737b-42a3-a1d9-8ccd2936b341",
                "name": "Dongguan, GD, CN",
                "city": "Dongguan",
                "province": "Guangdong",
                "areaId": 1,
                "areaName": "China Warehouse",
                "countryCode": "CN"
            },
            {
                "storageId": "201e67f6ba4644c0a36d63bf4989dd70",
                "name": "Cranbury, NJ, US",
                "city": "Cranbury",
                "province": "New Jersey",
                "areaId": 2,
                "areaName": "US Warehouse",
                "countryCode": "US"
            }
        ],
        "locationUnavailableAreas": []
    },
    "requestId": "2b97f15603384fe4832e85617cf07d9c",
    "success": true
}
返回字段 字段意思 字段类型 长度 备注
list 子仓列表 list
- storageId 子仓 ID string 64 可直接作为订单列表的子仓筛选条件
- name 仓库名称 string 200 与订单列表返回的 storageName 同口径
- city 城市 string 200 取不到时为 null
- province 州 / 省 string 200 取不到时为 null
- areaId 区域仓 ID int 20 可直接作为订单列表的 areaId 筛选条件
- areaName 区域仓名称 string 200 如 US Warehouse
- countryCode 区域国家二字码 string 2
locationUnavailableAreas 城市 / 州信息暂时取不到的区域 list 这些区域的仓库仍在 list 中,只是 city / province 为 null
- areaId 区域仓 ID int 20
- areaName 区域仓名称 string 200
- reason 原因 string 200

error

{
    "code": 1608002,
    "result": false,
    "message": "Warehouse data source is temporarily unavailable, please retry later. This does NOT mean the warehouse does not exist.",
    "data": null,
    "requestId": "c5d92fbc9c794c5caa0ce453dd9c9236",
    "success": false
}

areaId 不是正整数、countryCode 不是两位字母时返回参数错误。

# 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 用于日志查询错误

# 库存流水创建时间

POST /api2.0/v1/product/stock/privateInventory/querySkuFlowByCondition 新增可选整数参数 createDateStart、createDateEnd,单位为 UTC Unix 毫秒。必须成对传入,起点不晚于终点,跨度不超过 90 天,两端均包含边界。不传时保留原有筛选,查询范围仍限定为当前认证客户。

创建时间筛选完整示例(替换令牌、SKU和日期范围):

curl --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/stock/privateInventory/querySkuFlowByCondition' \
  --header "CJ-Access-Token: ${CJ_ACCESS_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data-raw '{"pageNum":1,"pageSize":20,"sku":"CJNS000000101AZ","createDateStart":1785542400000,"createDateEnd":1785628799999}'