创建运单
简要描述
- 创建运单接口
请求URL
https://www.37-express.com/qyfr/api/parcel/v2/
请求方式
- POST
设置头部(HEADER)
- Content-Type: application/json
参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
account | 是 | object | 账号信息 |
account/email | 是 | string | 用户名 |
account/password | 是 | string | 密码 |
createShipment | 是 | object | 正文数据 |
createShipment/carrier | 是 | string | 派送商的ID号或者代码。可参见派送商代码和ID文档 |
createShipment/platformOrderNumber | 是 | string | 您的唯一参考单号 |
createShipment/createTrackingNumber | 否 | string | 是否需要接口返回运单号和快递单。可取值为:true,false,1,0,如果没有该节点或者什么都不填就认为是true |
createShipment/getPdfFile | 否 | string | 是否返回快递单文件,由于面单PDF文件较大,不返回面单文件可以加快数据传输速度,如果createTrackingNumber参数为0或false,则该参数无效。可取值为:true,false,1,0,如果没有该节点或者什么都不填就认为是true |
createShipment/category | 否 | int | 包裹类别,是一个整数值,默认值是3:<br/>1 礼品<br/>2 商业样板<br/>3 商业快件<br/>4 文件<br/>5 其它<br/>6 个人物品<br/>注:以公司名义寄件不允许提交个人物品的包裹类别 |
createShipment/invoiceFile | 否 | string | 发票文件(*.pdf),必须是BASE64编码字符串 |
createShipment/originCountry | 否 | string | 包裹中物品的原产国,填写的是国家代码,例如:US |
createShipment/invoiceNumber | 否 | string | 发票号 |
createShipment/invoiceDate | 否 | string | 发票日期,格式必须是:YYYY-MM-DD |
createShipment/parcels | 是 | array | 包裹明细 |
createShipment/parcels/weight | 是 | float | 包裹重量,单位:kg |
createShipment/parcels/length | 否 | float | 包裹长度,单位:cm |
createShipment/parcels/width | 否 | float | 包裹宽度,单位:cm |
createShipment/parcels/height | 否 | float | 包裹高度,单位:cm |
createShipment/parcels/articles | 否 | array | 包裹里的物品信息 |
createShipment/parcels/articles/description | 是 | string | 物品名称 |
createShipment/parcels/articles/quantity | 是 | int | 这种物品的数量 |
createShipment/parcels/articles/value | 是 | float | 单件物品的价值,单位:EUR |
createShipment/parcels/articles/weight | 是 | float | 单件物品的重量,单位:KG |
createShipment/parcels/articles/hsCode | 是 | string | 物品的海关税号。这里可以查询 |
createShipment/parcels/articles/brand | 否 | string | 物品的品牌 |
createShipment/parcels/articles/spec | 否 | string | 物品的规格 |
createShipment/parcels/articles/barcode | 否 | string | 物品的条形码 |
createShipment/senderAddress | 是 | object | 寄件人地址 |
createShipment/senderAddress/prefix | 否 | string | 寄件人称呼 |
createShipment/senderAddress/firstName | 否 | string | 寄件人名字 |
createShipment/senderAddress/lastName | 否 | string | 寄件人姓氏 |
createShipment/senderAddress/companyName | 否 | string | 寄件人公司,如果没有填写姓名,则公司必须填写 |
createShipment/senderAddress/countryCode | 是 | string | 寄件地址国家代码,例如:FR |
createShipment/senderAddress/region | 否 | string | 寄件地址州/省 |
createShipment/senderAddress/city | 是 | string | 寄件地址城市 |
createShipment/senderAddress/street | 是 | string | 寄件街道地址 |
createShipment/senderAddress/street2 | 否 | string | 寄件附加街道地址 |
createShipment/senderAddress/postalCode | 是 | string | 寄件地址邮编 |
createShipment/senderAddress/phoneNumber | 是 | string | 寄件人电话 |
createShipment/senderAddress/email | 否 | string | 寄件人邮箱 |
createShipment/receiverAddress | 是 | object | 收件人地址 |
createShipment/receiverAddress/prefix | 否 | string | 收件人称呼 |
createShipment/receiverAddress/firstName | 否 | string | 收件人名字 |
createShipment/receiverAddress/lastName | 否 | string | 收件人姓氏 |
createShipment/receiverAddress/companyName | 否 | string | 收件人公司,如果没有填写姓名,则公司必须填写 |
createShipment/receiverAddress/countryCode | 是 | string | 收件地址国家代码,例如:US |
createShipment/receiverAddress/region | 否 | string | 收件地址州/省 |
createShipment/receiverAddress/city | 是 | string | 收件地址城市 |
createShipment/receiverAddress/district | 否 | string | 城市的区/县。如果是中国,这是必填的 |
createShipment/receiverAddress/street | 是 | string | 收件街道地址 |
createShipment/receiverAddress/street2 | 否 | string | 收件附加街道地址 |
createShipment/receiverAddress/postalCode | 是 | string | 收件地址邮编 |
createShipment/receiverAddress/phoneNumber | 是 | string | 收件人电话 |
createShipment/receiverAddress/email | 否 | string | 收件人邮箱 |
createShipment/receiverAddress/idCard | 否 | string | 收件人证件号码 |
createShipment/upsAccessPointAddress | 否 | object | UPS驿站地址 |
createShipment/upsAccessPointAddress/name | 是 | string | UPS驿站名称 |
createShipment/upsAccessPointAddress/countryCode | 是 | string | UPS驿站地址国家代码,例如:FR |
createShipment/upsAccessPointAddress/city | 是 | string | UPS驿站地址城市 |
createShipment/upsAccessPointAddress/street | 是 | string | UPS驿站街道地址 |
createShipment/upsAccessPointAddress/street2 | 否 | string | UPS驿站附加街道地址 |
createShipment/upsAccessPointAddress/postalCode | 是 | string | UPS驿站地址邮编 |
createShipment/mondialrelayPointAddress | 否 | object | Mondial Relay驿站地址 |
createShipment/mondialrelayPointAddress/id | 是 | string | Mondial Relay驿站ID |
createShipment/mondialrelayPointAddress/name | 是 | string | Mondial Relay驿站名称 |
createShipment/mondialrelayPointAddress/countryCode | 是 | string | Mondial Relay驿站地址国家代码,例如:FR |
createShipment/mondialrelayPointAddress/city | 是 | string | Mondial Relay驿站地址城市 |
createShipment/mondialrelayPointAddress/street | 是 | string | Mondial Relay驿站街道地址 |
createShipment/mondialrelayPointAddress/street2 | 否 | string | Mondial Relay驿站附加街道地址 |
createShipment/mondialrelayPointAddress/postalCode | 是 | string | Mondial Relay驿站地址邮编 |
createShipment/appointmentPickup | 否 | object | 预约上门取件 |
createShipment/appointmentPickup/pickupDate | 是 | date | 预约上门取件日期,格式必须是:YYYY-MM-DD |
createShipment/appointmentPickup/company | 否 | string | 您的公司名 |
createShipment/appointmentPickup/name | 是 | string | 联系人 |
createShipment/appointmentPickup/countryCode | 是 | string | 国家,目前只允许FR |
createShipment/appointmentPickup/city | 是 | string | 上门城市 |
createShipment/appointmentPickup/street | 是 | string | 上门街道地址 |
createShipment/appointmentPickup/room | 否 | string | 门牌号 |
createShipment/appointmentPickup/floor | 否 | string | 楼层 |
createShipment/appointmentPickup/postalCode | 是 | string | 上门地址的邮编 |
createShipment/appointmentPickup/phoneNumber | 是 | string | 联系电话 |
createShipment/appointmentPickup/isHome | 否 | string | 是否家庭地址。是用Y,否用N |
createShipment/appointmentPickup/remarks | 否 | string | 其它特别说明 |
请求示例
{
&quot;account&quot;: {
&quot;email&quot;: &quot;test@test.com&quot;,
&quot;password&quot;: &quot;test_test_test_test&quot;
},
&quot;createShipment&quot;: {
&quot;carrier&quot;:&quot;ups_access_point&quot;,
&quot;platformOrderNumber&quot;:&quot;A-12345678&quot;,
&quot;createTrackingNumber&quot;:true,
&quot;getPdfFile&quot;:true,
&quot;parcels&quot;: [
{&quot;weight&quot;: 2,&quot;length&quot;: 12,&quot;width&quot;: 32,&quot;height&quot;: 23,&quot;articles&quot;:[
{&quot;description&quot;:&quot;Cadeaux Personnels&quot;,&quot;quantity&quot;:2,&quot;value&quot;:12,&quot;weight&quot;:1,&quot;hsCode&quot;:&quot;38000000&quot;}
]},
{&quot;weight&quot;: 3,&quot;length&quot;: 11,&quot;width&quot;: 33,&quot;height&quot;: 88,&quot;articles&quot;:[
{&quot;description&quot;:&quot;Vêtements&quot;,&quot;quantity&quot;:1,&quot;value&quot;:10,&quot;weight&quot;:1.5,&quot;hsCode&quot;:&quot;61000000&quot;},
{&quot;description&quot;:&quot;Vêtements&quot;,&quot;quantity&quot;:1,&quot;value&quot;:20,&quot;weight&quot;:1.5,&quot;hsCode&quot;:&quot;61000000&quot;}
]}
],
&quot;senderAddress&quot;: {
&quot;firstName&quot;: &quot;Jessica&quot;,
&quot;lastName&quot;: &quot;La plus belle&quot;,
&quot;companyName&quot;: &quot;Cindy H&quot;,
&quot;countryCode&quot;: &quot;FR&quot;,
&quot;city&quot;: &quot;AUBERVILLIERS&quot;,
&quot;street&quot;: &quot;8-10 RUE DE LA HAIE COQ&quot;,
&quot;postalCode&quot;: &quot;93300&quot;,
&quot;phoneNumber&quot;: &quot;0148340955&quot;,
&quot;email&quot;: &quot;cindyhbyazalee@gmail.com&quot;
},
&quot;receiverAddress&quot;: {
&quot;firstName&quot;: &quot;yangyang&quot;,
&quot;lastName&quot;: &quot;xiao&quot;,
&quot;companyName&quot;: &quot;TEST COMPANY&quot;,
&quot;countryCode&quot;: &quot;DK&quot;,
&quot;city&quot;: &quot;COPENHAGEN&quot;,
&quot;street&quot;: &quot;OSTERBROGAGE 114 2ND&quot;,
&quot;postalCode&quot;: &quot;2100&quot;,
&quot;phoneNumber&quot;: &quot;004531905171&quot;,
&quot;email&quot;: &quot;xiaoyangyang@ftl-express.com&quot;
},
&quot;upsAccessPointAddress&quot;:{
&quot;name&quot;:&quot;TABAC PRESSE CARPE DIEM&quot;,
&quot;countryCode&quot;:&quot;FR&quot;,
&quot;city&quot;:&quot;AJACCIO&quot;,
&quot;street&quot;:&quot;27 BOULEVARD DOMINIQUE PAOLI&quot;,
&quot;postalCode&quot;:&quot;20090&quot;
}
}
}
返回示例
{
&quot;success&quot;: true,
&quot;createShipment&quot;:{
&quot;incrementId&quot;: 78284091,
&quot;pdfUrlToken&quot;: &quot;jdfhjdf84387hs7shdjk82h83jad0oe5&quot;,
&quot;pdfUrl&quot;: &quot;https://www.37-express.com/qyfr/api/parcel/print/increment_id/78284091/token/jdfhjdf84387hs7shdjk82h83jad0oe5/&quot;,
&quot;trackingNumber&quot;: [&quot;1Z6660YVYZ96488032&quot;,&quot;1Z6660YVYZ98316053&quot;],
&quot;pdfContent&quot;: &quot;BASE64编码&quot;
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
incrementId | string | 唯一运单编号 |
pdfUrlToken | string | 用于打印面单的token |
pdfUrl | string | 用于打印面单的URL |
trackingNumber | array | 派送商的跟踪单号,只有createShipment/createTrackingNumber参数为true时才有 |
pdfContent | string | 快递单PDF文件内容,BASE64编码,只有createShipment/createTrackingNumber参数为true时才有 |
出错返回示例
{
&quot;success&quot;: false,
&quot;message&quot;: &quot;Invalid login or password.&quot;
}