创建运单
创建运单
POST | /open-api/v2/label |
请求头部
标签 | 必填 | 说明 |
---|---|---|
Api-Key | ✓ | Api Key,请登录系统,在我的个人资料中找到 |
Api-Secret | ✓ | Api Secret,请登录系统,在我的个人资料中找到 |
Body请求参数
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
custom_order_num | [string] | ✓ | |
shipment | [object] | ✓ | - |
﹂﹂carrier | [string] | 物流服务商编码,此字段会筛选出该服务商的服务,并创建面单。【如有多个,则使用最低价格的服务创建面单。】示例: ups,fedex | |
﹂﹂service_code | [string] | 服务代码,用于创建指定服务的运单【若存在多个,则自动选择最低价格的服务】,点击可查看所有服务代码。 示例:ups_ground | |
﹂ship_from | [object] | ✓ | 发件地址 |
﹂﹂uuid | [string] | 发件地址id, 此字段与ship from 详情二选一,若填了uuid,ship_from地址详情不用填。若没填,则必须填以下地址详情。 点击查看如何获取uuid 示例:22d953b7-24c4-4ae9-afb4-111cc227b01e | |
﹂﹂city | [string] | ✓ | 发件城市 示例:LOS ANGELES |
﹂﹂name | [object] | ✓ | 发件公司名或人名,限制长度:35 示例:Amazon |
[string] | 邮箱 | ||
﹂﹂addresses | [array] | ✓ | 地址详情 示例: 6925 Riverview Ave |
﹂﹂postal_code | [string] | ✓ | 发件邮编,格式[12345]或[12345-6789] 示例:90045-6275 |
﹂﹂country_code | [string] | ✓ | 发件国家二字代码 示例:US |
﹂﹂is_residential | [boolean] | 发件地址是否为住宅地址。true表示住宅地址,false表示商业地址 示例:false | |
﹂﹂state_province_code | [string] | ✓ | 发件州二字代码 示例:CA |
﹂﹂phone | [string] | ✓ | 发件人联系方式,至少10位数字 示例:1000000000 |
﹂﹂attention | [string] | 备注或发件人名,限制长度:35 示例:Ann | |
﹂ship_to | [object] | ✓ | 收件地址 |
﹂﹂city | [string] | ✓ | 收件地址,城市名 Example: PENFIELD |
﹂﹂name | [string] | ✓ | 收件公司名或人名,限制长度:35 示例:Ann |
[string] | 邮箱 | ||
﹂﹂addresses | [array] | ✓ | 地址详情 示例:6925 Riverview Ave |
﹂﹂postal_code | [string] | ✓ | 收件邮编,格式[12345]或[12345-6789] 示例:14526 |
﹂﹂country_code | [string] | ✓ | 收件国家二字代码 示例:US |
﹂﹂is_residential | [boolean] | 发件地址是否为住宅地址。true表示住宅地址,false表示商业地址 示例:false | |
﹂﹂state_province_code | [string] | ✓ | 收件州二字代码 示例:NY |
﹂﹂phone | [string] | ✓ | 发件人联系方式,至少10位数字 示例:(999)-999-9999 |
﹂﹂phone_ext | [string] | 联系方式分机号 限制:1-4位 示例:1234 | |
﹂﹂attention | [string] | 备注或发件人名,限制长度:35 | |
﹂packages | [array] | ✓ | 包裹详情 |
﹂﹂dimension | [object] | ✓ | 包裹尺寸 最大/最小尺寸值因服务和包装类型而异 |
﹂﹂﹂width | [number] | ✓ | 包裹宽度,输入数字并且最多输入小数点后两位 示例:20.01 |
﹂﹂﹂height | [number] | ✓ | 包裹高度,输入数字并且最多输入小数点后两位 示例:20.01 |
﹂﹂﹂length | [number] | ✓ | 包裹长度,输入数字并且最多输入小数点后两位 示例:20.01 |
﹂﹂﹂code | [string] | ✓ | 长度单位,有效值为:in/cm 示例:in |
﹂﹂weight | [object] | ✓ | 包裹重量 |
﹂﹂﹂code | [string] | ✓ | 重量单位,有效值为:lb/oz/kg/g 注意:输入大写字母会报错 示例:lb |
﹂﹂﹂value | [number] | ✓ | 输入数字并且最多输入小数点后两位 示例:68.25 |
﹂﹂confirmation | [string] | ✓ | 签名服务,点击查看服务商支持的签名服务 示例:None |
﹂﹂insurance | [object] | 保险服务 | |
﹂﹂﹂code | [string] | 货币单位 示例:USD | |
﹂﹂﹂value | [number] | 输入数字并且最多输入小数点后两位 示例:300.01 | |
﹂﹂quantity | [number] | ✓ | 包裹数量 示例:1 |
﹂﹂reference_numbers | [array] | ✓ | 包裹备注 |
﹂﹂﹂code | [string] | ✓ | 备注标题,点击查看服务商支持的备注信息 示例:INVOICE |
﹂﹂﹂value | [object] | ✓ | 备注内容,每个备注限制长度:40 示例:P84746-KMD |
﹂package_type | [object] | ✓ | 包裹类型。点击查看服务商支持的包裹类型 |
﹂﹂type | [string] | ✓ | 示例:common |
﹂﹂name | [string] | ✓ | 示例:Package |
﹂label_specification | [object] | 面单规格 | |
﹂﹂label_format | [string] | 示例:pdf 。可选参数:zpl , pdf | |
﹂pickup_date | [string] | ✓ | 取件日期,格式[yyyymmdd] 示例:20221001 |
curl -X POST \
'https://api.sandbox.shipber.com/open-api/v2/label' \
-H 'Content-Type:application/json' \
-H 'Api-Key:2cn1wgmfidytin3jef3b' \
-H 'Api-Secret:qRBYybjRch7BdTxO5NTyGUd6mBvowNbsjahnAnpdI-BXc5sCrRt15XGr-hc9oY7C' \
-d '{
"custom_order_num": "Test-20230113",
"shipment": {
"carrier": "fedex",
"service_code": "fedex_ground",
"ship_from": {
"uuid": "7b572b8d-08a3-4cc7-a711-1aae28e9ffcf"
},
"ship_to": {
"city": "Kansas City",
"name": "Test Company",
"addresses": [
"6925 Riverview Ave"
],
"postal_code": "66102",
"country_code": "US",
"state_province_code": "KS",
"phone": "0123456789"
},
"packages": [{
"dimension": {
"width": 7,
"height": 13,
"length": 4,
"code": "in"
},
"weight": {
"code": "lb",
"value": 6
},
"confirmation": "None",
"insurance": {
"code": "USD",
"value": 20
},
"quantity": 1,
"reference_numbers": [{
"code": "reference #1",
"value": "1"
}]
}],
"package_type": {
"type": "common",
"name": "Package"
},
"label_specification": {
"label_format": "pdf"
},
"pickup_date": "20230113"
}
}'
{
"data": {
"status": "Printing",
"tracking_num": "Tracking",
"order_num": "order",
"shipment": {
"service_code": "fedex_ground",
"ship_from": {
"city": "LOS ANGELES",
"name": "Test Company",
"email": "[email protected]",
"addresses": ["6925 Riverview Ave"],
"postal_code": "66102",
"country_code": "US",
"is_residential": false,
"state_province_code": "CA",
"phone": "0123456789"
},
"ship_to": {
"city": "Kansas City",
"name": "Test Company",
"addresses": [
"6925 Riverview Ave"
],
"postal_code": "66102",
"country_code": "US",
"state_province_code": "KS",
"phone": "0123456789"
},
"packages": [{
"dimension": {
"width": 7,
"height": 13,
"length": 4,
"code": "in"
},
"weight": {
"code": "lb",
"value": 6
},
"confirmation": "Not Required",
"insurance": {
"code": "USD",
"value": 20
},
"quantity": 1,
"reference_numbers": [{
"code": "reference #1",
"value": "1"
}],
"watermark": ""
}],
"package_type": {
"type": "common",
"name": "Package"
},
"label_specification": {
"label_format": "pdf"
},
"pickup_date": "20230113"
},
"created_at": "2023-01-13T06:26:31.028Z",
"custom_order_num": "Test-20230113",
"is_return_label": false,
"rma_number": "",
"rma_reason": ""
}
}