版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

描述

运费测算

路径

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

...


请求字段

字段名数据类型最大长度必填描述
warehouseCodeString50M仓库代码
countryString2M国家二字代码(CN, US ...)
stateString50M州(省)
cityString50M城市
districtString50M
postCodeString30M邮编
parcelList
String

Array

20M包裹列表

parceList参数

字段名数据类型最大长度必填描述
parcelWeight
decimal
Decimal
O包裹重量(productList为空时必填)
parcelLength
decimal
Decimal
O包裹长(productList为空时必填)
parcelWidth
decimal
Decimal
O包裹宽(productList为空时必填)
parcelHeight
decimal
Decimal
O包裹高(productList为空时必填)
productListArray
O

包裹下商品列表(包裹长,宽,高,重量任一为空时必填,使用商品实际长宽高重量计算出包裹长宽高)

productList参数

字段名数据类型最大长度必填描述
skuString50M商品编码
productQtyInteger
M商品数量

请求样例

代码块

返回样例

...

字段名

...

数据类型

...

最大长度

...

描述

...

仓库代码

代码块
themeEclipse
linenumberstrue
collapsetrue
{
    "warehouseCode": "CanadaWarehouse",
    "country": "CA",
    "state": "AB",
    "city": "HAYNES",
    "district": "",
    "postCode": "T0C0Y0",
    "parcelList": [
        {
            "parcelWeight": 2,
            "parcelLength": 11,
            "parcelWidth": 12,
            "parcelHeight": 13,
            "productList": [
                {
                    "sku": "CATESTSKU",
                    "productQty": 2
                },
                {
                    "sku": "CATESTSKU_001",
                    "productQty": 2
                }
            ]
        },
        {
            "parcelWeight": 2,
            "parcelLength": 11,
            "parcelWidth": 12,
            "parcelHeight": 13,
            "productList": [
                {
                    "sku": "CATESTSKU_002",
                    "productQty": 2
                },
                {
                    "sku": "CATESTSKU_003",
                    "productQty": 2
                }
            ]
        }
    ]
}



响应字段


字段名

数据类型

最大长度

描述

channelName

String

服务名称

channelIdLong
服务id
lastMileBillingWeightDecimal
派送费计费重量
feeItemListArray
费用列表

feeItemList参数

字段名

数据类型

最大长度

描述

costTypeInteger
费用类型(1:出库处理费(Outbound Handling Fee);8:尾程运费(Last Mile Fee))
costTypeNameString
费用名称
billingWeightDecimal
计费重量

fee

Decimal

费用金额

currencyString
币种
feeDetailListArray
费用明细

feeDetailList参数

字段名

数据类型

最大长度

描述

costTypeNameString
费用名称(中文)
costTypeNameEnString
费用名称(英文)

fee

Decimal

费用金额

currencyString
币种
discountInteger
折扣(%Off)
zoneItemNameString
费用分区

响应样例


代码块
linenumberstrue
collapsetrue

成功响应:
{
    "code": "0",
    "data": [
        {
            "serviceList": [],channelName": "CA Domestic CPC FOR OVERSEAS WH",
            "feeItemList": [
                {
                    "billingWeight": "",
                    "costType": 1,
                    "costTypeName": "Outbound Handling Fee",
                    "currency": "CAD",
                    "discount": 0,
               "warehouseCode     "fee": 81.000,
                    "feeDetailList": "DE"
"
                }
            ]
        },
        {
            "serviceListchannelName": "加拿大运输",
            "feeItemList": [
                {
                    "billingWeight": "",
                    "activecostType": 1,
                    "costTypeName": "Outbound Handling Fee",
                    "currency": "CAD",
                    "discount": 0,
                    "fee": 81.000,
                    "feeDetailList": ""
                },
                {
                    "billingWeight": 10.000,
                    "activeMsg": "Active"costType": 8,
                    "costTypeName": "Last Mile Fee",
                    "currency": "CAD",
                    "discount": 0,
                    "fee": 256.700,
                    "serviceCodefeeDetailList": [
                        {
                            "costTypeName": "catest尾程基本运费",
                    "serviceName        "costTypeNameEn": "testcaLast Mile Basic Fee",
                            "serviceTypecurrency": 5"CAD",
                     "serviceTypeName       "discount": "Fulfillment",
                }             ]"fee": 42.00000000,
            "warehouseCode                "zoneItemName": "shopify"加拿大分区"
                        },
                        {
                            "costTypeName": "偏远地区附加费",
                            "costTypeNameEn": "Remote Area Surcharge",
                            "currency": "CAD",
                   "serviceList": [         "discount": "",
                            "fee": 65.0000000,
                            "zoneItemName": ""
                        },
                        {
                    "active        "costTypeName": 1"燃油附加费",
                    "activeMsg        "costTypeNameEn": "ActiveFuel Surcharge",
                    "serviceCode": "UBI.CN2WW.GENERAL",        "currency": "CAD",
                            "discount": "",
                            "fee": 10.70000000000000,
                            "zoneItemName": ""
                        },
                        {
                            "costTypeName": "安全管理费",
                            "costTypeNameEn": "Security Surcharge",
                            "serviceNamecurrency": "CN-WW Direct Injection-General","CAD",
                            "discount": "",
                            "serviceTypefee": 510.00000,
                     "serviceTypeName       "zoneItemName": "Fulfillment""
                        },
                        {
                     "active       "costTypeName": 1"其它附加费",
                      "activeMsg      "costTypeNameEn": "ActiveOther Surcharge",
                            "serviceCodecurrency": "Melbourne serviceCAD",
                    "serviceName        "discount": "墨尔本服务",
                            "serviceTypefee": 510.00000,
                    "serviceTypeName        "zoneItemName": "Fulfillment"
                        },
                        {
                            "costTypeName": "住宅地址附加费",
                            "costTypeNameEn": "Residential Surcharge",
                            "currency": "CAD",
                            "discount": "",
                         "active": 1,   "fee": 100.00000000,
                            "zoneItemName": ""
                        },
                        {
                            "activeMsgcostTypeName": "Active电池附加费",
                            "serviceCodecostTypeNameEn": "测试-服务Battery Surcharge",
                            "serviceNamecurrency": "TEST Service 001","CAD",
                            "discount": "",
                            "serviceTypefee": 510.00000,
                      "serviceTypeName      "zoneItemName": "Fulfillment"
                        },
                        {
                            "activecostTypeName": 1,"加拿大海运费",
                            "activeMsgcostTypeNameEn": "ActiveCanadaseafee",
                    "serviceCode        "currency": "b2cfwCAD",
                    "serviceName        "discount": "【B2C服务",
                     "serviceType       "fee": 5,9.0000000,
                            "serviceTypeNamezoneItemName": "Fulfillment"
                        }
                    ]
                }
            ]
        }
    ],
    "errors": "",
    "message": "",
    "warehouseCodemessageId": "CNwharehouse",
    "success": true,
    "warnList": ""
}


失败响应:
{
    "code": "3",
    "data": "",
    "errors": [
        {
            "code": "800357",
            "message": "Field parcelList[1].productList[1].productQty cannot be less than 1"
        },
        {
            "code": "800357",
            "errorsmessage": "Field parcelList[0].productList[0].productQty cannot be less than 1"
        }
    ],
    "message": "parameters error, please contact your administrator",
    "messageId": "",
    "success": truefalse,
    "warnList": ""
}


Field parcelList[0]这里的0代表第一个包裹,以此类推
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";