创建运单(已计费)

创建运单(已计费)

POST/v1/open-api/label

请求头部

标签必填说明
Api-KeyApi Key,请登录系统,在我的个人资料中找到
Api-SecretApi Secret,请登录系统,在我的个人资料中找到

Body请求参数

参数名类型必填说明
rate_id[string]服务id
custom_order_num[string]
shipment[object]-
﹂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
﹂﹂email[string]邮箱
﹂﹂addresses[array]地址详情
示例:5353 W ImperialHay unit 900
﹂﹂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
﹂﹂email[string]邮箱
﹂﹂addresses[array]地址详情
示例:5353 W ImperialHay unit 900
﹂﹂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]签名服务,点击查看服务商支持的签名服务
示例:Adult
﹂﹂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
﹂pickup_date[string]取件日期,格式[yyyymmdd]
示例:20221001
curl -X POST  \
  'https://api.sandbox.shipber.com/v1/open-api/label' \
  -H 'Content-Type:application/json' \
  -H 'Api-Key:2cn1wgmfidytin3jef3b' \
  -H 'Api-Secret:qRBYybjRch7BdTxO5NTyGUd6mBvowNbsjahnAnpdI-BXc5sCrRt15XGr-hc9oY7C' \
  -d '{
    "rate_id": "eyJjaGFpbklkIjo0MTksInNlcnZpY2VDb2RlIjoiZmVkZXhfZ3JvdW5kIiwicGFja2FnZVR5cGUiOiJQYWNrYWdlIn0",
    "custom_order_num": "cimy-977885",
    "shipment": {
        "ship_from": {
            "uuid": "7b572b8d-08a3-4cc7-a711-1aae28e9ffcf"
        },
        "ship_to": {
            "city": "Los Angeles",
            "name": "Test Company",
            "addresses": [
                "5353 W Imperial Hwy Unit 900"
            ],
            "postal_code": "90045",
            "country_code": "US",
            "state_province_code": "CA",
            "phone": "0123456789"
        },
        "packages": [
            {
                "dimension": {
                    "width": 7,
                    "height": 13,
                    "length": 4,
                    "code": "IN"
                },
                "weight": {
                    "code": "lb",
                    "value": 6
                },
                "confirmation": "None",
                "quantity": 1,
                "reference_numbers": [
                    {
                        "code": "reference #1",
                        "value": "1"
                    }
                ]
            }
        ],
        "package_type": {
            "type": "common",
            "name": "Package"
        },
        "pickup_date": "20211010"
    }
}'
{
    "data": {
        "status": "Printing",
        "order_num": "ST161853120081597000",
        "shipment": {
            "ship_from": {
                "city": "Los Angeles",
                "name": "Test Company",
                "email": "[email protected]",
                "addresses": ["5353 W Imperial Hwy Unit 900"],
                "postal_code": "90045",
                "country_code": "US",
                "is_residential": true,
                "state_province_code": "CA",
                "attention": "",
                "phone": "0123456789"
            },
            "ship_to": {
                "country_code": "US",
                "phone": "8888888888",
                "name": "Test Company",
                "addresses": ["3326 HEMLOCK WAY"],
                "city": "WINNABOW ",
                "state_province_code": "NC",
                "postal_code": "28479",
                "attention": ""
            },
            "packages": [{
                "dimension": {
                    "width": 7,
                    "height": 13,
                    "length": 4,
                    "code": "IN"
                },
                "weight": {
                    "code": "LBS",
                    "value": 6
                },
                "confirmation": "Delivery",
                "insurance": {
                    "code": "USD",
                    "value": 20
                },
                "quantity": 1
            }],
            "package_type": {
                "type": "common",
                "name": "Package"
            },
            "pickup_date": "20210416",
            "service_code": "fedex_ground"
        },
        "created_at": "2021-04-16T04:30:28.632Z",
        "custom_order_num": "cimy-15913"
    }
}

创建退货运单

可以通过将is_return_label设置为true来创建退货运单

curl -X POST  \
  'https://api.sandbox.shipber.com/v1/open-api/label' \
  -H 'Content-Type:application/json' \
  -H 'Api-Key:2cn1wgmfidytin3jef3b' \
  -H 'Api-Secret:qRBYybjRch7BdTxO5NTyGUd6mBvowNbsjahnAnpdI-BXc5sCrRt15XGr-hc9oY7C' \
  -d '{
    "is_return_label":true,
    "rma_number": "123",
    "rma_reason": "Other",
    "rate_id": "eyJjaGFpbklkIjo0MTksInNlcnZpY2VDb2RlIjoiZmVkZXhfZ3JvdW5kIiwicGFja2FnZVR5cGUiOiJQYWNrYWdlIn0",
    "custom_order_num": "cimy-977885",
    "shipment": {
        "ship_from": {
            "city": "Los Angeles",
            "name": "Test Company",
            "addresses": [
                "5353 W Imperial Hwy Unit 900"
            ],
            "postal_code": "90045",
            "country_code": "US",
            "state_province_code": "CA",
            "phone": "0123456789"
        },
        "ship_to": {
            "uuid": "7b572b8d-08a3-4cc7-a711-1aae28e9ffcf"
        },
        "packages": [
            {
                "dimension": {
                    "width": 7,
                    "height": 13,
                    "length": 4,
                    "code": "IN"
                },
                "weight": {
                    "code": "lb",
                    "value": 6
                },
                "confirmation": "None",
                "quantity": 1,
                "reference_numbers": [
                    {
                        "code": "reference #1",
                        "value": "1"
                    }
                ]
            }
        ],
        "package_type": {
            "type": "common",
            "name": "Package"
        },
        "pickup_date": "20211010"
    }
}'
{
    "data": {
        "status": "Printing",
        "order_num": "ST161853120081597000",
        "shipment": {
            "ship_from": {
                "country_code": "US",
                "phone": "8888888888",
                "name": "Test Company",
                "addresses": ["3326 HEMLOCK WAY"],
                "city": "WINNABOW ",
                "state_province_code": "NC",
                "postal_code": "28479",
                "attention": ""
            },
            "ship_to": {
                "city": "Los Angeles",
                "name": "Test Company",
                "email": "[email protected]",
                "addresses": ["5353 W Imperial Hwy Unit 900"],
                "postal_code": "90045",
                "country_code": "US",
                "is_residential": true,
                "state_province_code": "CA",
                "attention": "",
                "phone": "0123456789"
            },
            "packages": [{
                "dimension": {
                    "width": 7,
                    "height": 13,
                    "length": 4,
                    "code": "IN"
                },
                "weight": {
                    "code": "LBS",
                    "value": 6
                },
                "confirmation": "Delivery",
                "insurance": {
                    "code": "USD",
                    "value": 20
                },
                "quantity": 1
            }],
            "package_type": {
                "type": "common",
                "name": "Package"
            },
            "pickup_date": "20210416",
            "service_code": "fedex_ground"
        },
        "created_at": "2021-04-16T04:30:28.632Z",
        "custom_order_num": "cimy-15913"
    }
}