运费查询
查询可使用的服务
Method POST /shipment/create
Query 参数
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/reference | 自定义单号 | String | 否 | |
| additional/options | 附加服务 | Object | 否 | |
| additional/options/ | 附加服务, 详情见service 接口 | Object | 否 | |
| 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 /shipment/create
Request Body
{
"serviceCode": "vp.ups.standard",
"initiation": {
"regionCode": "ca",
"stateCode": "qc",
"city": "Saint-Constant",
"addressLine1": "5-35 Rue Leriger",
"phone": "1111111111",
"postalCode": "J5A1C4",
"name": "Li Lei"
},
"destination": {
"regionCode": "ca",
"stateCode": "QC",
"city": "Gatineau",
"addressLine1": "102 Rue de la vaudaire",
"addressLine2": "",
"postalCode": "J9A0E2",
"addressType": "resident",
"name": "Han Meimei",
"phone": "1111111111"
},
"shipmentType": "parcel",
"pak": {
"isKilo": true,
"isCentimeter": true,
"size": {
"length": 0.3,
"width": 10,
"height": 10
},
"weight": 0.002,
"insurance": 100
},
"additional": {
"reference": "ecommercial-order-123xxxx",
"options": {
"DC": {
"state": true
},
"SO": {
"state": true,
"type": "PA18"
},
"D2PO": {
"state":true
}
}
}
}
Response
| 参数 | 说明 | 类型 |
|---|---|---|
| orderNumber | 订单号 | String |
| waybillNumber | 货运商物流单号 | String |
| serviceCode | 服务代码 例: vp.ups.standard | String |
| shipmentType | 货品类别 | String |
| initiation | 发件人信息 | Object |
| destination | 收件人信息 | Object |
| pak | 包裹信息 | Object |
| price | 订单运费 | Object |
Reponse Example
{
"sucess": true,
"elapsed": "19670ms",
"query": {
"id": "7f16f1b0-61bf-11eb-ae75-75abac9d9f41",
"timestamp": "1612829023",
"signature": "PH2WKrm5AuIaVWkbqKbEd5Wvbxo/q/dCWCgAdlTkcSA=",
"api": "/shipment/create"
},
"result": {
"orderNumber": "U0210209455650",
"waybillNUmber": "1Z9W403F2012339141",
"serviceCode": "vp.ups.standard",
"shipmentType": "parcel",
"initiation": {
"regionCode": "ca",
"stateCode": "qc",
"city": "Saint-Constant",
"addressLine1": "5-35 Rue Leriger",
"phone": "1111111111",
"postalCode": "J5A1C4",
"name": "Li lei"
},
"destination": {
"regionCode": "ca",
"stateCode": "QC",
"city": "Gatineau",
"addressLine1": "102 Rue de la vaudaire",
"addressLine2": "",
"postalCode": "J9A0E2",
"addressType": "resident",
"name": "Han Meimei",
"phone": "1111111111"
},
"pak": {
"weight": {
"kg": 0.2,
"lb": 0.441,
"isKilo": true,
"unit": "kg"
},
"size": {
"cm": {
"length": 0.3,
"width": 10,
"height": 10,
"girth": 30.6,
"sum": 20.3
},
"in": {
"length": 0.1,
"width": 3.9,
"height": 3.9,
"girth": 11.9,
"sum": 7.9
},
"isCentimeter": true,
"unit": "cm"
},
"insurance": 100
},
"price": {
"currency": "CAD",
"base": 87.31,
"due": 100,
"taxes": {
"gst": {
"amount": 2.46,
"rate": 5
},
"pst": {
"amount": 0,
"rate": 0
},
"hst": {
"amount": 0,
"rate": 0
},
"tax": {
"amount": 2.3,
"rate": 5
}
},
"priceDetails": [
{
"code": "270",
"name": "RESIDENTIAL ADDRESS",
"price": 2.67,
"cost": 2.05,
"isRate": true
},
{
"code": "375",
"name": "FUEL SURCHARGE",
"price": 5.27,
"cost": 4.051,
"isRate": true
},
{
"code": "400",
"name": "INSURANCE",
"price": 0,
"cost": 0,
"isRate": false
}
]
}
}
}