POST print 打单 / 下单
地址:/api/order/print · 说明:提交下单请求并获取面单,返回订单信息与面单地址。
⚠ 重要:print 包含
rate 的全部参数(地址 / 包裹 / 单位 / 附加服务等完全一致),
且在 rate 基础上新增下列必填项:shipping_code、shipping_service。
参数说明(= rate 全部参数 + 以下新增/必填)
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
shipping_code |
是 | string | 渠道编码(rate 中选填,print 中必填) |
shipping_service |
是 | string | 渠道服务编码(rate 中选填,print 中必填) |
reference |
选填 | string | 订单参考号 |
remark |
选填 | string | 订单备注 |
label_type |
选填 | string | 面单类型;仅部分渠道 / 接口支持,不传时按渠道默认格式返回。 可选值: PDF / ZPL / ZPL203DPI(超出枚举范围返回参数错误;注:zpl 为 ZPL300DPI 的简写) |
| 其余参数(发货地址 / 收货地址 / 包裹 / unit / currency / is_signature / is_insurances / vendor_address_id / vendor_address_label)与 rate 完全相同,必填规则一致,详见 rate 参数表与公共参数。 | |||
请求示例(含 rate 全部参数)
# 与 rate 相比仅多了必填的渠道参数 + reference/remark
POST /api/order/print
Header: vendor-token: xxxxx
Content-Type: application/json
{
"shipping_code": "iusps",
"shipping_service": "zdgj",
"reference": "ORDER-20260921-001",
"remark": "please handle carefully",
"label_type": "PDF", // 选填:面单类型(PDF / ZPL / ZPL203DPI),仅部分渠道支持
"is_signature": 0,
"is_insurances": 0,
"shipper_name": "John",
"shipper_company": "Piggyship",
"shipper_telphone": "+1 213 555 0100",
"shipper_street1": "123 Main St",
"shipper_city": "Los Angeles",
"shipper_state": "CA",
"shipper_country": "US",
"shipper_zipcode": "90001",
"recipient_name": "Jane",
"recipient_company": "ABC Inc",
"recipient_telphone": "+1 212 555 0199",
"recipient_street1": "456 Oak Ave",
"recipient_city": "New York",
"recipient_state": "NY",
"recipient_country": "US",
"recipient_zipcode": "10001",
"packages": [
{
"name": "dress",
"length": 12,
"width": 10,
"height": 5,
"weight": 3.3,
"weight_unit": "lb",
"length_unit": "in"
}
]
}
返回示例(data 为下单结果)
{
"success": true,
"message": "下单成功!",
"code": 200,
"data": {
"success": true,
"message": "success",
"fee": 15.05, // 扣款金额
"zone": "zone8",
"billing_weight": 3.3069,
"currency_id": 1,
"order_id": 1024, // 系统订单ID
"label": "https://cdn.xxx.com/label/123_1699999999.pdf", // 面单 PDF 地址
"tracking": "20260921153000_ab12cd", // 系统订单号(注意:非面单号)
"ext_tracking": "9212345678901234567890", // 渠道面单号/跟踪号
"fee_detail": [{"code": "shipping_fee","name": "Shipping Fee","amount": 15.05}] // 费用明细
}
}
| data 字段 | 类型 | 说明 |
|---|---|---|
order_id |
int | 系统订单 ID |
fee / zone / billing_weight / currency_id |
- | 运费 / 分区 / 计费重量 / 货币 |
label |
string | 面单 PDF 地址(CDN),可直接下载打印 |
tracking |
string | 系统订单号 |
ext_tracking |
string | 渠道跟踪号/面单号(用于查询轨迹) |
fee_detail |
array | 费用明细列表 |