描述
运费测算
路径
HTTP Verb | URL |
|---|---|
| POST | /api/supplier-service/v1/b2c/freightCalculation |
请求头样例
| 代码块 |
|---|
POST /api/supplier-service/v1/b2b/poList Host: http://cfs-qa.etowertech.com/ Content-Type: application/json Accept: application/json Authorization:WallTech etotest8xkIIphLnbkjRACNj4P:pc9H97D-_b2_TSCVvNj81A X-WallTech-Date:Tue, 02 Aug 2022 06:43:37 GMT |
...
请求字段
| 字段名 | 数据类型 | 最大长度 | 必填 | 描述 |
|---|---|---|---|---|
| warehouseCode | String | 50 | M | 仓库代码 |
| country | String | 2 | M | 国家二字代码(CN, US ...) |
| state | String | 50 | M | 州(省) |
| city | String | 50 | M | 城市 |
| district | String | 50 | M | 区 |
| postCode | String | 30 | M | 邮编 |
| parcelList | Array | 20 | M | 包裹列表 |
...
| 字段名 | 数据类型 | 最大长度 | 必填 | 描述 |
|---|---|---|---|---|
| sku | String | 50 | M | 商品编码 |
| productQty | Integer | M | 商品数量 |
请求样例
| 代码块 | ||||||
|---|---|---|---|---|---|---|
| ||||||
{
"warehouseCode": "CATESTWHCanadaWarehouse",
"country": "CNCA",
"state": "四川省AB",
"city": "广元市HAYNES",
"district": "利州区",
"postCode": "123432T0C0Y0",
"parcelList": [
{
"parcelWeight": 12,
"parcelLength": 311,
"parcelWidth": 412,
"parcelHeight": 513,
"productList": [
{
"sku": "SKGCATESTSKU",
"productQty": 2
},
{
"sku": "Red wineCATESTSKU_001",
"productQty": 12
}
]
},
{
"parcelWeight": null2,
"parcelLength": null11,
"parcelWidth": null12,
"parcelHeight": null13,
"productList": [
{
"sku": "SKGCATESTSKU_002",
"productQty": 2
},
{
"sku": "Red wineCATESTSKU_003",
"productQty": 12
}
]
},
{
"parcelWeight": 2,
"parcelLength": 3,
"parcelWidth": 4,
"parcelHeight": 5,
"productList": []
}
]
} |
返回样例
...
字段名
...
数据类型
...
]
} |
响应字段
字段名 | 数据类型 | 最大长度 | 描述 |
|---|---|---|---|
channelName | String | 服务名称 | |
| channelId | Long | 服务id | |
| lastMileBillingWeight | Decimal | 派送费计费重量 | |
| feeItemList | Array | 费用列表 |
...
字段名 | 数据类型 | 最大长度 | 描述 |
|---|---|---|---|
| costTypeName | String | 费用名称(中文) | |
| costTypeNameEn | String | 费用名称(英文) | |
fee | Decimal | 费用金额 | |
| currency | String | 币种 | |
| discount | Integer | 折扣(%Off) | |
| zoneItemName | String | 费用分区 |
...
响应样例
| 代码块 | ||||
|---|---|---|---|---|
| ||||
成功响应: { "code": "0", "data": [ { "channelName": "TESTCA PUROLATORDomestic GROUND",CPC FOR "feeItemList": [ OVERSEAS WH", { "billingWeight": "", "feeItemList": [ "costType": 8, { "costTypeNamebillingWeight": "Last Mile Fee", "currencycostType": "CAD"1, "discountcostTypeName": 0"Outbound Handling Fee", "feecurrency": 67.400"CAD", "feeDetailListdiscount": [0, "fee": 81.000, { "costTypeName"feeDetailList": "尾程基本运费", } "costTypeNameEn": "Last Mile] Basic Fee", }, { "currencychannelName": "CAD加拿大运输", "feeItemList": [ "discount": "", { "feebillingWeight": 67.40000000"", "costType": 1, "zoneItemName": "" "costTypeName": "Outbound Handling Fee", } "currency": "CAD", ] "discount": 0, } ] }"fee": 81.000, { "channelNamefeeDetailList": "易仓下单专用服务(勿动)", "feeItemList": [ }, { "billingWeight": ""10.000, "costType": 8, "costTypeName": "Last Mile Fee", "currency": "CAD", "discount": 0, "fee": 191256.370700, "feeDetailList": [ { "costTypeName": "尾程基本运费", "costTypeNameEn": "Last Mile Basic Fee", "currency": "CAD", "discount": "", "fee": 6742.4000000000000000, "zoneItemName": "加拿大分区" }, { "costTypeName": "偏远地区附加费", "costTypeNameEn": "Remote Area Surcharge", "currency": "CAD", "discount": "", "fee": 1965.0000000, "zoneItemName": "" }, { "costTypeName": "燃油附加费", "costTypeNameEn": "Fuel Surcharge", "currency": "CAD", "discount": "", "fee": 810.6400000000000070000000000000, "zoneItemName": "" }, { "costTypeName": "安全管理费", "costTypeNameEn": "Security Surcharge", "currency": "CAD", "discount": "", "fee": 1310.4800000000000000000, "zoneItemName": "" }, { "costTypeName": "其它附加费", "costTypeNameEn": "Other Surcharge", "currency": "CAD", "discount": "", "fee": 2010.2200000000000000000, "zoneItemName": "" }, { "costTypeName": "住宅地址附加费", "costTypeNameEn": "Residential Surcharge", "currency": "CAD", "discount": "", "fee": 26100.9600000000000000000000, "zoneItemName": """ }, { "costTypeName": "电池附加费", }, "costTypeNameEn": "Battery {Surcharge", "costTypeNamecurrency": "电池附加费CAD", "costTypeNameEndiscount": "Battery Surcharge", "currencyfee": "CAD"10.00000, "discountzoneItemName": "", }, "fee": 33.70000000000000, { "zoneItemNamecostTypeName": "加拿大海运费", }"costTypeNameEn": "Canadaseafee", { "currency": "CAD", "costTypeNamediscount": "保险", "costTypeNameEnfee": "Insurance Fee"9.0000000, "currencyzoneItemName": "CAD"," } ] "discount": "", } ] "fee": 1.970, } ], "errors": "", "message": "", "zoneItemNamemessageId": "", "success": true, "warnList": "" } 失败响应: { "code": "3", } "data": "", "errors": [ { ] "code": "800357", } "message": "Field parcelList[1].productList[1].productQty cannot be less than ]1" }, { "channelNamecode": "卡派(测试)800357", "feeItemList": [] }, { "message": "Field parcelList[0].productList[0].productQty cannot be less than 1" "channelName": "OFFLINE_PICKUP_EXPRESS", } ], "feeItemListmessage": []"parameters error, please contact your administrator", } "messageId": "", "success": false, { "warnList": "" } Field parcelList[0]这里的0代表第一个包裹,以此类推 "channelName": "OFFLINE_PICKUP_TRUCK", "feeItemList": [] }, { "channelName": "MINXI_C", "feeItemList": [] } ], "errors": "", "message": "", "messageId": "", "success": true, "warnList": "" }Field parcelList[0].productList[0]这里的0代表第一个包裹和第一个包裹下的第一个商品,以此类推 |
备注信息(需注意):
1、shipper仓库禁用,报错:"message": "shipperAddressCode:CanadaWarehouse,Relevant warehouse do not active in shipper";
2、shipper与仓库不匹配,报错:"message":"shipperAddressCode:CanadaWarehousetest,Relevant warehouse do not exist in shipper";
3、shipper商品禁用,报错:"message": "SKU:[CATESTSKU] has been disabled";
4、shipper与商品不匹配:报错:"message": "sku:CATESTSKUtest,Does not exist in the selected shippers commodity wareHouse";
5、国家不存在(只校验了国家二字码,全称也会直接报错):报错:"message": "Field country value:Canada is invalid";
6、sku信息为空,校验包裹重量、长、宽、高不能为空,不能为负数,不能为0,小数点前后位数无限制与界面的一致,否则报错:"message": "parcelList[0] parcelLength,parcelWidth,parcelHeight,parcelWeight must be filled in and positive"、"message": "Field parcelList[0].parcelWeight cannot be less than 0.001";parcelList[0]这里的0代表第一个包裹,以此类推
7、sku数量校验不能为空,不能为负数,不能为0,否则报错: "message": "parcelList[0].productList[0].productQty cant be null"、 "message": "Field parcelList[0].productList[0].productQty cannot be less than 1";
8、sku校验不能为空,否则报错: "message": "parcelList[0].productList[0].sku cant be null";