# 6 物流

# 1 物流

# 1.1 物流试算 (POST)

下单前的物流费用试算. 需要特殊注明的是, 普通商品和供应商商品, 规则不一样, 供应商商品一般供应商指定了物流. 所以, 下单前需要 特别留意商品类型. 同时也是强烈建议还是将不同商品分开计算, 以规避很多不必要的麻烦, 比如不同物流对于重量、尺寸、大小、商品属性等等问题.

这是简单模式的物流试算,如果要使用更准确的物流试算,请使用接口:Freight Calculation Tip

# URL

https://developers.cjdropshipping.com/api2.0/v1/logistic/freightCalculate

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/logistic/freightCalculate' \
                --header 'Content-Type: application/json' \
                --data-raw '{
                    "startCountryCode": "US",
                    "endCountryCode": "US",
                    "products": [
                        {
                            "quantity": 2,
                            "vid": "439FC05B-1311-4349-87FA-1E1EF942C418"
                        }
                    ]
                }'
参数名称 参数意义 参数类型 是否必传 长度 备注
startCountryCode 发货地 string 200
endCountryCode 目的地 string 200
zip 邮编 string 200
taxId 税号 string 200
houseNumber 门牌号 string 200
iossNumber IOSS号码 string 200
quantity 数量 int 10
vid CJ 变体id string 50

# 返回

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": [
        {
            "logisticAging": "2-5",
            "logisticPrice": 4.71,
            "logisticPriceCn": 30.54,
            "logisticName": "USPS+"
        }
    ],
    "requestId": "0242ad78-eea2-481d-876a-7cf64398f07f"
}
返回字段 字段意思 字段类型 长度 备注
logisticPrice 物流费用 BigDecimal (18, 2) 单位:$(美元)
logisticPriceCn 物流费用 BigDecimal (18, 2) 单位:¥(人民币)
logisticAging 物流时间 string 20
logisticName 物流名称 string 20
taxesFee 税费 BigDecimal (18, 2) 单位:$(美元)
clearanceOperationFee 清关手续费 BigDecimal (18, 2) 单位:$(美元)
totalPostageFee 总费用 BigDecimal (18, 2) 单位:$(美元)

error

{
    "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 接口数据返回
requestId 请求Id string 48 用于日志查询错误

# 1.2 Freight Calculation Tip(POST)

下单前的物流费用试算. 需要特殊注明的是, 普通商品和供应商商品, 规则不一样, 供应商商品一般供应商指定了物流. 所以, 下单前需要 特别留意商品类型. 同时也是强烈建议还是将不同商品分开计算, 以规避很多不必要的麻烦, 比如不同物流对于重量、尺寸、大小、商品属性等等问题.

# URL

https://developers.cjdropshipping.com/api2.0/v1/logistic/freightCalculateTip

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/logistic/freightCalculateTip' \
                --header 'Content-Type: application/json' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
                --data-raw '{
                    "reqDTOS": [
                        {
                            "srcAreaCode": "CN",
                            "destAreaCode": "US",
                            "length": 0.3,
                            "width": 0.4,
                            "height": 0.5,
                            "volume": 0.06,
                            "totalGoodsAmount":123.2,
                            "productProp": [
                                "COMMON"
                            ],
                            "freightTrialSkuList": [
                                {
                                    "skuQuantity": 1,
                                    "sku": "CJCF104237201AZ"
                                }
                            ],
                            "skuList": [
                                "CJCF104237201AZ"
                            ],
                            "platforms": [
                                "Shopify"
                            ]
                        }
                    ]
                }'
参数名称 参数意义 参数类型 是否必传 长度 备注
srcAreaCode 发货区域code string 200
destAreaCode 目的区域code string 200
customerCode 客户code string 200
zip 邮编 string 200
houseNumber 门牌号 string 100
iossNumber ioss编号 string 200
storageIdList 分区仓库 string[] 100
recipientAddress 收件地址(地址1+地址2) string 200
city 城市 string 50
recipientName 收件人姓名 String 200
skuList sku列表 String[] 200
town String 100
phone 电话 String 50
wrapWeight 含包装重量,单位g int 200
volume 体积,单位:立方厘米 BigDecimal 200
station 站点 二子码 String 200 参照:国家信息, 请使用二字码
platforms 平台列表 String[] 200 平台类型, 参考 平台列表
dutyNo 税号 String 200
email 邮箱 String 100
province 省/州 String 100
recipientAddress1 地址1 String 200
uid uid 订单ID标识 String 200
recipientId 收件人id String 200
recipientAddress2 收获地址2 String 200
amount 销售金额 BigDecimal 50
productTypes 商品类型 String[] 0:正常商品,1:服务商品,3:包装商品,4:供应商商品,5:供应商自发货商品,6:虚拟商品,7:pod个性商品
weight 重量 int 100
productProp 商品属性 String[] 100
optionName 选项名称 String 200
volumeWeight 体积重量 BigDecimal 100
orderType 订单类型 0-代发单 1-直发单 2-odm定制 String 100
totalGoodsAmount 总货值-单位美元 BigDecimal 100
freightTrialSkuList 试算sku列表(抛货组合+折扣) Object[]
- productCode 商品编码 String 100
- sku sku String 100
- productPropList 商品属性 String[] 100
- productTypeList 商品类型 String[] 100 0:正常商品,1:服务商品,3:包装商品,4:供应商商品,5:供应商自发货商品,6:虚拟商品,7:pod个性商品
- vid 变体ID String 100
- skuQuantity sku的下单数量 int 50
- skuWeight sku的单个重量, 单位:克 BigDecimal 100
- skuVolume sku的单个体积, 单位:立方厘米 BigDecimal 100
- combinationType 是否组合商品 0-非组合商品 1-组合sku int 50
- parentVid 组合主sku id String 50

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": [
        {
            "arrivalTime": "12-50",
            "discountFee": 4.09,
            "discountFeeCNY": 25.30,
            "volumeWeight": null,
            "option": {
                "arrivalTime": "12-50",
                "cnName": "CJ航空挂号小包",
                "enName": "CJPacket Postal",
                "id": "1564849338719199233"
            },
            "ruleTips": [
                {
                    "expression": "^[\\s\\d\\-()()+]{6,32}$",
                    "interceptType": "0",
                    "max": null,
                    "min": null,
                    "msgCode": "1001",
                    "msgEn": "Must be a 6-32 digit number (only numbers, symbols and spaces are supported).",
                    "type": "phone"
                }
            ],
            "ruleTipTypes": [
                "phone"
            ],
            "channelId": "1564543005939785730",
            "error": "",
            "errorEn": "",
            "optionId": "1564849338719199233",
            "postage": 3.55,
            "postageCNY": 22.00,
            "priceIncreases": "115",
            "reSort": "62",
            "remoteFee": 0,
            "remoteFeeCNY": 0,
            "tip": "",
            "uid": "",
            "orderId": null,
            "unWeightChargeTarget": null,
            "floatMaxPrice": null,
            "floatMinPrice": null,
            "logisticsParamRespDTO": null,
            "message": "Hi, CJ will not accept any disputes when you choose the shipping method, which is not trackable when orders arrived at some countries, states, or cities.",
            "wrapPostage": 4.09,
            "wrapPostageCNY": 25.30,
            "wrapWeight": 0,
            "stopWords": [],
            "channel": {
                "cnName": "促佳燕文航空挂号小包特货",
                "enName": "燕文航空挂号小包特货",
                "id": "1564543005939785730"
            },
            "cjRespDTO": {
                "postage": "3.55",
                "postageCNY": "22.00",
                "remoteFee": "0.00",
                "remoteFeeCNY": "0"
            },
            "destArea": {
                "cnName": "美国",
                "countryId": "233",
                "enName": "United States of America (the)",
                "id": "233",
                "parentId": null,
                "postCode": "",
                "shortCode": "US"
            },
            "srcArea": {
                "cnName": "中国",
                "countryId": "48",
                "enName": "China",
                "id": "48",
                "parentId": null,
                "postCode": "",
                "shortCode": "CN"
            },
            "dump": false,
            "zonePrice": [],
            "allRuleTips": [
                {
                    "expression": "^[\\s\\d\\-()()+]{6,32}$",
                    "interceptType": "0",
                    "max": null,
                    "min": null,
                    "msgCode": "1001",
                    "msgEn": "Must be a 6-32 digit number (only numbers, symbols and spaces are supported).",
                    "type": "phone"
                }
            ],
            "taxesFee": null,
            "clearanceOperationFee": null
        }
    ],
    "requestId": "55c4708d15d44a499f061582ddbd989b",
    "success": true
}
返回字段 字段意思 字段类型 长度 备注
arrivalTime 时效 string 200
discountFee 折扣费用(物流费用美金) BigDecimal (18,2) Unit: $ (USD)
discountFeeCNY 人民币折扣费用(物流费用人民币) BigDecimal (18,2)
volumeWeight 抛重 BigDecimal (18,2) Unit: $ (USD)
channelId 渠道ID String 200
error 错误信息 String 200
errorEn 错误信息(En) String 200
optionId 选项ID String 100
postage 物流费用(不包括折扣) BigDecimal (18,2) Unit: $ (USD)
postageCNY 人民币物流费用(不包括折扣) BigDecimal (18,2) Unit: $ (USD)
priceIncreases 物流折扣 String 100
reSort 排序字段 String 100
remoteFee 偏远费 BigDecimal (18,2) Unit: $ (USD)
remoteFeeCNY 偏远费 CNY BigDecimal (18,2) Unit: $ (USD)
tip 提示 string 200
uid uid 订单标识 String 200
orderId 订单id String 100
unWeightChargeTarget unWeightChargeTarget BigDecimal (18,2) Unit: $ (USD)
floatMaxPrice floatMaxPrice BigDecimal (18,2) Unit: $ (USD)
floatMinPrice floatMinPrice BigDecimal (18,2) Unit: $ (USD)
logisticsParamRespDTO 推荐物流相关参数 String 200
message 消息通知 String 200
wrapPostage 含包装物流费用 BigDecimal (18,2) Unit: $ (USD)
wrapPostageCNY 含包装物流费用 CNY BigDecimal (18,2) Unit: $ (USD)
stopWords 禁用词提示(校验未通过) String[] 200
channel 物流渠道 Object
- cnName 中文名 String 200
- enName 英文名 String 200
- id id String 200
option 物流选项 Object
- arrivalTime 妥投天数 String 100
- cnName 中文名 String 100
- enName 英文名 String 100
- id id String 100
taxesFee 税费 BigDecimal (18,2) Unit: $ (USD)
clearanceOperationFee 清关操作费 BigDecimal (18,2) Unit: $ (USD)
totalPostageFee 总费用 BigDecimal (18, 2) 单位:$(美元)
allRuleTips 全部规则提示 object[]
- expression 表达式 string 20
- interceptType 拦截类型 0-强拦截 1-非强拦截 string 20
- max 范围最大值(姓名、地址) string 20
- min 范围最小值(姓名、地址) string 20
- msgCode 提示code string 20
- type 规则类型 string 20
- msgEn 英文描述 string 20
destArea 目的地区域信息 object 20
- cnName 国家名称(中文) string 20
- enName 国家名称(英文) string 20
- countryId 国家id string 20
- parentId 父类id string 20
- postCode 邮编 string 20
- shortCode 简码 string 20
- id Id string 20
srcArea 原始区域信息 object 20
- cnName 国家名称(中文) string 20
- enName 国家名称(英文) string 20
- countryId 国家id string 20
- parentId 父类id string 20
- postCode 邮编 string 20
- shortCode 简码 string 20
- id Id string 20

error

{
    "code": 1600100, 
    "result": false,
    "message": "Param error",
    "data": null,
    "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
返回字段 字段意思 字段类型 长度 备注
code error code int 20 Reference error code
result Whether or not the return is normal boolean 1
message return message string 200
data return data object interface data return
requestId requestId string 48 Flag request for logging errors

# 1.3 商家物流试算(POST)

# URL

https://developers.cjdropshipping.com/api2.0/v1/logistic/partnerFreightCalculate

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/logistic/partnerFreightCalculate' \
                --header 'Content-Type: application/json' \
                 --data-raw '{
                    "orderNumber": "1234",
                    "shippingZip": "123",
                    "shippingCountryCode": "US",
                    "shippingCountry": "123",
                    "shippingProvince": "123",
                    "shippingCity": "132",
                    "shippingAddress": "123213",
                    "shippingCustomerName": "123",
                    "shippingPhone": "111",
                    "remark": "note",
                    "fromCountryCode": "CN",
                    "logisticName": "PostNL",
                    "houseNumber": "123",
                    "iossType": 税ioss申报方式:1-不使用IOSS申报 2-使用我的IOSS号申报 3-使用CJ的IOSS号申报
                    "iossNumber": ""
                    "products": [
                        {
                            "vid": "92511400-C758-4474-93CA-66D442F5F787",
                            "quantity": 1
                        }
                    ]
                }'
参数名称 参数意义 参数类型 是否必传 长度 备注
orderNumber 订单编号 String 40
shippingCountryCode 交易国家简码 string 200
shippingCountry 交易国家 string 200
shippingProvince 交易省 string 200
shippingCity 交易城市 string 200
shippingAddress 交易地址 string 200
shippingCustomerName 交易接收人 string 200
shippingZip 交易邮编 string 200
shippingPhone 交易电话 string 200 收货人, 电话号码一定要准确
houseNumber 门牌号 string 20
remark 订单备注 string 500
logisticName 物流名称 string 200
fromCountryCode 发货地 string 200 发货仓库
email 邮箱 string 200
consigneeID 收货人id string 200
iossType 税费申报方式 int 20 税ioss申报方式:1-不使用IOSS申报 2-使用我的IOSS号申报 3-使用CJ的IOSS号申报
iossNumber ioss号 string 20
products list 200
vid 变体 id string 200
quantity 变体 数量 string 200

# 返回

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": [
        {
            "postageAmount": 1.69,
            "logisticsModel": "YTGN",
            "logisticsName": "YTO China Domestic"
            "arrivalTime": "2-3",
            "iossList": [
                {
                   "iossNumber": "",
                   "iossType": "",
                   "serviceAmount": "",
                   "taxAmount": ""
                }
            ]
         }
    ],
    "requestId": "0242ad78-eea2-481d-876a-7cf64398f07f"
}
返回字段 字段意思 字段类型 长度 备注
postageAmount 物流金额 BigDecimal (18, 2) 单位:$(美元)
logisticsModel 物流渠道 string 200
logisticsName 物流名称 string 200
arrivalTime 物流时效 string 20
isSupportIoss 是否支持ioss boolean
iossList list
iossNumber ioss号 string
iossType 是否默认,1-不使用IOSS申报 2-使用我的IOSS号申报 3-使用CJ的IOSS号申报
serviceAmount 手续费(美分) BigDecimal (18, 2) 单位:$(美元)
taxAmount 税费(美分) BigDecimal (18, 2) 单位:$(美元)

error

{
    "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 接口数据返回
requestId 请求Id string 48 用于日志查询错误

# 1.4 供应商自发货物流试算(POST)

# URL

https://developers.cjdropshipping.com/api2.0/v1/logistic/getSupplierLogisticsTemplate

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/logistic/getSupplierLogisticsTemplate' \
                --header 'Content-Type: application/json' \
                 --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
                 --data-raw '{
                    "skuList": ""
                }'
参数名称 参数意义 参数类型 是否必传 长度 备注
skuList 商品sku String[] 200 商品sku(不是变体Sku)

# 返回

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": [
        {
            "skuList": [],
            "logisticsInfoList": [
                {
                    "id": "123",
                    "logisticsName": "fdd",
                    "postage": "",
                    "startCountryCode": "",
                    "destCountryCode": ""
                }
            ]
        }
    ],
    "requestId": "0242ad78-eea2-481d-876a-7cf64398f07f"
}
返回字段 字段意思 字段类型 长度 备注
skuList 商品sku String[]
logisticsInfoList 物流信息 Object[]
- id 模板id string 100
- logisticsName 模板名称 string 200
- postage 运费 BigDecimal (18,2) 单位:$(美元)
- startCountryCode 发货国家编码 string 100
- destCountryCode 目的国家编码 string 100

error

{
    "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 接口数据返回
requestId 请求Id string 48 用于日志查询错误

# 2 追踪单

# 2.1 查询物流信息 (GET) 已过期

订单生成后, 根据追踪号, 查询订单物流. 同样也可以在 CJ 查询物流平台 (opens new window) 查询

已在2024年6月1日弃用, 请使用新接口查询物流轨迹

# URL

https://developers.cjdropshipping.com/api2.0/v1/logistic/getTrackInfo?trackNumber=CJPKL7160102171YQ

# CURL

curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/logistic/getTrackInfo?trackNumber=CJPKL7160102171YQ
                                                                                                    &trackNumber=CJPKL7160102171YQ
                                                                                                    &trackNumber=CJPKL7160102171YQ
                                                                                                    &trackNumber=CJPKL7160102171YQ
参数名称 参数意义 参数类型 是否必传 长度 备注
trackNumber 追踪单号 string 200 支持批量

# 返回

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": [
        {
            "trackingNumber": "CJPKL7160102171YQ",
            "logisticName": "CJPacket Sensitive",
            "trackingFrom": "CN",
            "trackingTo": "US",
            "deliveryDay": "13",
            "deliveryTime": "2021-06-17 07:04:04",
            "trackingStatus": "In transit",
            "lastMileCarrier": "CJPacket",
            "lastTrackNumber": "926112903032124"
        }
    ],
    "requestId": "3426e927-8c50-4687-9ced-623e77d55bd0"
}
返回字段 字段意思 字段类型 长度 备注
trackingNumber 追踪单号 string 200
trackingFrom 起始地 string 20
trackingTo 目的地 string 20
deliveryDay 交付天数 string 200
deliveryTime 交付时间 string 200
trackingStatus 追踪单状态 string 200
lastMileCarrier 最后一公里承运商 string 200
lastTrackNumber 最后一公里追踪号 string 200

error

{
    "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 接口数据返回
requestId 请求Id string 48 用于日志查询错误

# 2.2 查询物流信息 (GET)

订单生成后, 根据追踪号, 查询订单物流. 同样也可以在 CJ 查询物流平台 (opens new window) 查询

# URL

https://developers.cjdropshipping.com/api2.0/v1/logistic/trackInfo?trackNumber=CJPKL7160102171YQ

# CURL

curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/logistic/trackInfo?trackNumber=CJPKL7160102171YQ
                                                                                                    &trackNumber=CJPKL7160102171YQ
                                                                                                    &trackNumber=CJPKL7160102171YQ
                                                                                                    &trackNumber=CJPKL7160102171YQ
参数名称 参数意义 参数类型 是否必传 长度 备注
trackNumber 追踪单号 string 200 支持批量

# 返回

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": [
        {
            "trackingNumber": "CJPKL7160102171YQ",
            "logisticName": "CJPacket Sensitive",
            "trackingFrom": "CN",
            "trackingTo": "US",
            "deliveryDay": "13",
            "deliveryTime": "2021-06-17 07:04:04",
            "trackingStatus": "In transit",
            "lastMileCarrier": "CJPacket",
            "lastTrackNumber": "926112903032124"
        }
    ],
    "requestId": "3426e927-8c50-4687-9ced-623e77d55bd0"
}
返回字段 字段意思 字段类型 长度 备注
trackingNumber 追踪单号 string 200
trackingFrom 起始地 string 20
trackingTo 目的地 string 20
deliveryDay 交付天数 string 200
deliveryTime 交付时间 string 200
trackingStatus 追踪单状态 string 200
lastMileCarrier 最后一公里承运商 string 200
lastTrackNumber 最后一公里追踪号 string 200

error

{
    "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 接口数据返回
requestId 请求Id string 48 用于日志查询错误