运费查询
#####
Method POST /quote
Query 参数
limit, skip, keywords, sort
Body 参数
| 参数 | 说明 | 类型 | 必填 | 默认值 |
|---|---|---|---|---|
| serviceCode | 服务代码 (service 接口), 可查询指定服务价格 | String | 否 | |
| initiation | 发件人信息 | Object | 是 | |
| initiation/regionCode | 国家/地区代码 例: CA | String | 是 | |
| initiation/stateCode | 省/州代码 例: On, BC | String | 是 | |
| initiation/state | 省/州名称 例: Ontaria | String | 是 | |
| initiation/city | 城市名称 例: Toronto | String | 是 | |
| initiation/postalCode | 邮编: a1b2c3 | String | 是 | |
| initiation/addressLine1 | 地址 行-1 | String | 否 | |
| initiation/addressLine2 | 地址 行-2 | String | 否 | |
| destination | 收件人信息 | Object | 是 | |
| destination/regionCode | 国家/地区代码 例: CA | String | 是 | |
| destination/stateCode | 省/州代码 例: On, BC | String | 是 | |
| destination/state | 省/州名称 例: Ontaria | String | 是 | |
| destination/city | 城市名称 例: Toronto | String | 是 | |
| destination/postalCode | 邮编: a1b2c3 | String | 是 | |
| destination/addressLine1 | 地址 行-1 | String | 否 | |
| destination/addressLine2 | 地址 行-2 | String | 否 | |
| destination/addressType | 地址类型 (resident:普通民宅,commercial:商业住宅) |
String | 是 | |
| shipmentType | 货品类型 : parcel (包裹), env (文件) | String | 是 | |
| pak | 包裹信息 | Object | 是 | |
| pak/isKilo | 重量单位 ( true:公斤, false:磅 ) |
Boolean | 否 | true |
| pak/weight | 重量 | Float (.000) | 是 | |
| pak/isCentimeter | 长度单位 ( true:厘米, false:英寸 ) |
Boolean | 否 | True |
| pak/size | 长度规格 | Object | 是 | |
| pak/size/length | 长度 | Float (.00) | 是 | |
| pak/size/width | 宽度 | Float (.00) | 是 | |
| pak/size/height | 高度 | Float (.00) | 是 | |
| pak/insurance | 保险 | Float (.00) | 否 | |
| additional | 附加信息 | Object | 否 | |
| additional/options | 附加服务 | Object | 否 | |
| additional/options/ | 附加服务, 详情见service 接口 | |||
| additional/options//state | true |
Boolean | 是 | |
| additional/options//type | 附加服务选项 例:当使用SO附件服务时 可复选PA18, PA19 | String | 条件 | |
| additional/options//optionAmount | Float(.00) | 条件 | ||
| additional/options//optionQualifier1 | Boolean | 条件 | ||
| additional/options//optionQualifier2 | String | 条件 |
Request Example
POST /quote?limit=10&skip=0&keyword=america,canada&sort[]=regionName:desc&sort[]=countryCode:asc
Request Body
{
"initiation": {
"regionCode": "ca",
"stateCode": "on",
"state": "Ontaria",
"postalCode": "A1b2c3",
"city": "Toronto",
"addressLine1": "",
"addressLine2": "",
},
"destination": {
"regionCode": "ca",
"state": "Ontaria",
"stateCode": "on",
"city": "Toronto",
"postalCode": "a1b2c3",
"addressType": "resident",
"addressLine1": "",
"addressLine2": "",
},
"shipmentType": "env",
"pak": {
"isKilo": true,
"isCentimeter": true,
"size": {
"length": 0.3,
"width": 10,
"height": 10
},
"weight": 0.002,
"insurance": 100
},
"additional": {
"options": {
"DC": {
"state": true
},
"SO": {
"state": true,
"type": "PA18"
},
"D2PO": {
"state":true
}
}
}
}
Response
| 参数 | 说明 | 类型 |
|---|---|---|
| quotes | 运费组合 | Array |
| service | 服务信息 | Object |
| serviceName | 服务名称 例: 加国信件 | |
| serviceCode | 服务代码 例: cp.dom.ep.env | |
| carrierName | 货运商名称 | |
| carrierCode | 货运商代码 | |
| carrierServiceName | 货运商服务名称 | |
| shipmentType | 货品类别 | |
| restriction | 货品规格限制 | |
| restriction/size | 尺寸 | |
| restriction/size/girth | 周长 | |
| restriction/size/sum | 三边长总和 | |
| restriction/size/length | 单边长度 | |
| restriction/size/weight | 重量 | |
| quote | 运费报价 | |
| quote/base | Float(.00) | |
| quote/due | 总价 | Float(.00) |
| quote/taxes | Object | |
| quote/priceDetails | Array | |
| eta | 预计送达信息 | Object |
Reponse Example
{
"sucess": true,
"elapsed": "5703ms",
"query": {
"id": "7f16f1b0-61bf-11eb-ae75-75abac9d9f41",
"timestamp": "1612803691",
"signature": "5RF40NDLWQjukIzZ14nM3N7xG0KEHyPgXdTGOhkgjfA=",
"api": "/quote"
},
"result": [
{
"service": {
"id": "768e5510-6de1-11ea-9915-67c1ceea3279",
"serviceName": "加国信件",
"serviceCode": "cp.dom.ep.env",
"carrierName": "Canada Post",
"carrierCode": "canPost",
"carrierServiceName": "Expedited Parcel",
"shipmentType": "env",
"restriction": {
"weight": {
"max": {
"kg": 1,
"lb": 2.2
}
}
}
},
"quote": {
"base": 14.74,
"due": 13.09,
"taxes": {
"gst": {
"amount": 0,
"rate": 0
},
"pst": {
"amount": 0,
"rate": 0
},
"hst": {
"amount": 1.7,
"rate": 15
},
"tax": {
"amount": 0,
"rate": 0
}
},
"priceDetails": [
{
"code": "COV",
"name": "Coverage",
"price": 0
},
{
"code": "DC",
"name": "Delivery confirmation",
"price": 0
},
{
"code": "FUELSC",
"name": "Fuel surcharge",
"price": 0.74
},
],
"msrp": 0,
"msrpSaving": 4.09
},
"eta": {
"amDelivery": false,
"guaranteedDelivery": true,
"expectedTransitTime": 2,
"expectedDeliveryDate": "2021-02-03"
},
"token": "757b5b38cccd101bcb1fc3576f8f916d889ec8fa35b9377d16f9315df815ac64"
}
]
}