Order Create

POST /open/order/create

application/json

Header
-apiKey

请求参数 Request

参数名(Parameter Name) 变量(Variable) 类型[长度限制] Type [Length Limit] 必填 (Required) 描述(Description)
发件人地址 (Sender Address) from Object 是(yes)
- 名 firstName string(1,32) 是(yes) 发件人名(Sender First Name)
- 姓 lastName string(1,32) 否(no) 发件人姓(Sender Last Name)
- 公司 company string(1,32) 否(no) 发件人公司(Sender First Company)
- 电话 phone string(1,32) 是(yes) 发件人电话(Sender Phone No.)
- 邮箱 email string(1,32) 否(no) 发件人邮箱(Sender E-mail)
- 地址1 address1 string(1,100) 是(yes) 发件人地址1(Sender Address 1)
- 地址2 address2 string(1,100) 否(no) 发件人地址2(Sender Address 2)
- 城市 city string(1,100) 是(yes) 发件人城市(Sender City)
- 州 state string(1,32) 是(yes) 发件人州,缩写(Sender State,Abbreviation)
- 国家 country string(1,100) 是(yes) 发件人国家,默认US(Sender Country,default us)
- 邮编 postcode string(1,100) 是(yes) 美国邮政编号(US post doce), 5-4
收件人地址 to Object 是(yes)
- 名 firstName string(1,32) 是(yes) 收件人名(Receiver first name)
- 姓 lastName string(1,32) 否(no) 收件人姓(Receiver last name)
- 公司 company string(1,32) 否(no) 收件人公司(Receiver Company)
- 电话 phone string(1,32) 是(yes) 收件人电话(Receiver phone No.)
- 邮箱 email string(1,32) 否(no) 收件人邮箱(Receiver E-mail)
- 地址1 address1 string(1,100) 是(yes) 收件人地址1(Receiver Address 1)
- 地址2 address2 string(1,100) 否(no) 收件人地址2(Receiver Address 2)
- 城市 city string(1,100) 是(yes) 收件人城市(Receiver City)
- 州 state string(1,32) 是(yes) 收件人州,缩写 (Receiver State,Abbreviation)
- 国家 country string(1,100) 是(yes) 收件人国家,默认US(Receiver State,Abbreviation)
- 邮编 postcode string(1,100) 是(yes) 美国邮政编号(US post doce), 5-4
服务商 carrier Object 是(yes)
- 名称 name string(1,100) 是(yes) 例如(For Example)USPS,Fedex
- 服务 service string(1,100) 是(yes) 例如(For Example)First Class Mail, Ground
服务商 packages Array 是(yes) 至少一个包裹,USPS只支持1个包裹(At least one package is required)
- 重量 weight number 是(yes) 必须大于0( must be greater than 0 )
- 重量单位 weightUnit string(1,100) 是(yes) 支持单位(support unit)oz,lb,kg,g
- 长 length number 是(yes) 必须大于0 ( must be greater than 0 )
- 宽 width number 是(yes) 必须大于0( must be greater than 0 )
- 高 height number 是(yes) 必须大于0( must be greater than 0 )
- 尺寸单位 dimensionUnit string(1,100) 是(yes) 尺寸单位,支持单位(Size Unit)inch, cm
- 包装 packageType string(1,100) 是(yes) 例如(For Example)Parcel
- sku sku string(1,100) 是(yes) 客户商品sku,务必填写,面单上显示,方便物流操作。例如包中有sku1商品数量1个,sku2商品数量2个,这里填sku1,sku2(Customer Product SKU: This field is mandatory and will be displayed on the shipping label to facilitate logistics operations. For example, if the package contains 1 unit of SKU1 and 2 units of SKU2, enter “SKU1, SKU2” here.)
- sku数量 skuQty string(1,100) 是(yes) 数量,逗号分隔,例如,小包中有sku1商品数量1个,sku2商品数量2个,这里填对应数量1,2(Quantity should be separated by commas. For example, if the package contains 1 unit of SKU1 and 2 units of SKU2, enter the corresponding quantities as 1,2)
客户系统订单号 customOrderId string(1,100) 是(yes) 务必填写,面单上显示,物流操作需要用到(This field is mandatory and will be displayed on the shipping label, as it is required for logistics operations.)
客户订单价格 customOrderPrice string(0,100) 否(no) 单位美金(Unit USD)
服务商(Carrier) 服务(Service) 包装(Package)
USPS
- First Class Mail Parcel
- Priority Mail Parcel,Cubic,Flat Rate Envelope,Legal Flat Rate Envelope,Padded Flat Rate Envelope,Small Flat Rate Box,Medium Flat Rate Box,Large Flat Rate Box,Regional Rate Boxes A,Regional Rate Boxes B
- Media Mail Parcel
- Express Mail Parcel,Flat Rate Envelope,Legal Flat Rate Envelope,Padded Flat Rate Envelope
- Library Mail Parcel
- First Class EVS Parcel
UPS
- Ground Parcel
Fedex
- Ground Parcel
- Home Delivery Parcel
- Smartpost Parcel
- Smartpost Parcel Select Parcel
- Smartpost Parcel Select Lightweight Parcel
- Smartpost Media Mail Parcel
DHL
- DHL Parcel Plus Ground Parcel
- DHL Parcel Expedited Parcel
- DHL Parcel Expedited Max Parcel
- DHL Parcel Ground Parcel

注意 ATTENTION

接口from的参数postcode,必须在与自己账户地址簿中的发件人地址的postcode一致(The postcode parameter in the from field must match the postcode of the sender address in your account’s address book.)

Example Request

{
    "from": {
        "firstName": "Jenny",
        "lastName": "",
        "company": "",
        "phone": "+16267574418",
        "email": "",
        "address1": "3217 s. Garfield Ave",
        "address2": "",
        "city": "Commerce",
        "state": "CA",
        "country": "US",
        "postcode": "90040"
    },
    "to": {
        "firstName": "Yeahyoung",
        "lastName": "ray",
        "company": "",
        "phone": "6265548793",
        "email": "",
        "address1": "12368 Valley Blvd",
        "address2": "APT2",
        "city": "El Monte",
        "state": "CA",
        "country": "US",
        "postcode": "91732"
    },
    "carrier": {
        "name": "USPS",
        "service": "First Class Mail"
    },
    "packages": [
        {
            "weight": 4,
            "weightUnit": "oz",
            "length": 2.14,
            "width": 2.14,
            "height": 2.14,
            "dimensionUnit": "inch",
            "packageType": "Parcel",
            "sku": "X002JQMTXF,X002JQP5BX",
            "skuQty": "1,2"
        }
    ],
    "customOrderId": "fbb_uid_loc_111309",
    "customOrderPrice": "2.56"
}

返回参数 Return

参数名(Parameter Name) 变量(Variable) Type [Length Limit] 必填(Required) 描述(Description)
订单号 orderId string 是(yes) 请求参数的customOrderId(The request parameter customOrderId.)
费用 charge number 是(yes) 收取的费用,出单后收取(Charges,collected after the order is generated)
余额 balance number 是(yes) 账户的余额(Account Balance)
包装列表 packages Array 是(yes)
- 面单号 trackingNum string 是(yes) 物流单号(Tracking No.)
- 面单地址 labelUrl string 是(yes) 物流单号地址,png或者pdf格式(Label Url, in PNG or PDF format)

Example Response

{
    "code": "0",
    "msg": "SUCCESS",
    "data": {
        "orderId": "fbb_uid_loc_111309",
        "charge": 3.31,
        "packages": [
            {
                "trackingNum": "9214490221582765567560",
                "labelUrl": "https://testms.fbbship.com/label/fee9e55e6441412fb8b12c2624c89769.png"
            }
        ]
    }
}
作者:小谢  创建时间:2024-08-06 13:58
最后编辑:小谢  更新时间:2025-03-28 15:43