Appearance
批量下单 Create Order
接口说明
通过此接口可实现客户批量提交订单数据下单到系统。
接口地址
下单: http://tms.gateway.sc-express.cn/api/order/create
下单并预报: http://tms.gateway.sc-express.cn/api/order/createForecast
(注意:如果提交的运单客户参考号1系统中已存在则不允许重复提交)
请求方式: POST
请求参数
请求字段说明
字段名称 | 字段类型 | 字段长度 | 是否必需 | 字段说明 | ||
---|---|---|---|---|---|---|
authorization | JSONObject | 接口校验信息 | ||||
code | String | 5-20 | Y | 客户编码 | ||
token | String | 50 | Y | API授权码 | ||
datas | JSONOArray | 本次提交数据集 | ||||
order | JSONObject | 每个运单数据 | ||||
channelid | String | 20 | Y | 收货渠道 | ||
customernumber1 | String | 50 | Y | 客户参考号1 | ||
customernumber2 | String | 50 | 客户参考号2 | |||
fbanumber | String | 50 | FBA ID | |||
number | Integer | Y | 总件数 | |||
isbattery | Integer | Y | 是否带电(1:带电,2:不带电) | |||
isinsurance | Integer | 是否投保(1:投保,2:不投保) | ||||
insurancevalue | Double | 投保金额,投保则必需 | ||||
insurancetypepkid | Integer | 投保类型 投保则必需(2:货物运输险,3:意外险) | ||||
insurancecurrency | String | 投保币别 通过调用 [ 查询币别 ] 接口获取,投保则必需 | ||||
forecastweight | String | Y | 预报总重量(KG) | |||
packagetypecode | String | Y | 包裹类型 [ G:礼品,C:商品货样,D:文件,O:其它 ] | |||
goodstypecode | String | 3 | Y | 物品类型 [ WPX:包裹,DOC:文件,PAK:PAK袋 ] | ||
declaretypepkid | Integer | 3 | 报关类型 | |||
termsofsalecode | String | 3 | 销售条款 | |||
exportreasoncode | String | 20 | 出口原因 | |||
producttypepkid | String | 20 | 物品类别 通过调用 [ 查询物品类别 ] 接口获取 | |||
feepaytype | String | 2 | 运费支付方式 [ CC:到付,PP:预付,TP:第三方 ] | |||
feepayname | String | 100 | 运费支付公司或名称 | |||
feepayaccountnumber | String | 50 | 运费支付账号 | |||
feepaycountrycode | String | 5 | 运费支付账号对应国家 | |||
feepaypostcode | String | 20 | 运费支付账号对应邮编 | |||
taxpaytype | String | 2 | 税金支付方式 [ CC:到付,PP:预付,TP:第三方 ] | |||
taxpayname | String | 100 | 税金支付公司或名称 | |||
taxpayaccountnumber | String | 50 | 税金支付账号 | |||
taxpaycountrycode | String | 5 | 税金支付账号对应国家 | |||
taxpayzipcode | String | 20 | 税金支付账号对应邮编 | |||
note | String | 255 | 运单备注 | |||
countrycode | String | 2 | Y | 收件人国家编码 | ||
fbawarehousecode | String | 20 | FBA仓码 | |||
consigneeaddresstype | String | 20 | 收件人地址类型 | |||
consigneename | String | 100 | Y | 收件人名称 | ||
consigneecorpname | String | 100 | 收件人公司(有则填上) | |||
consigneeaddress1 | String | 100 | Y | 收件人地址1 | ||
consigneeaddress2 | String | 100 | 收件人地址2 | |||
consigneecity | String | 50 | Y | 收件人城市 | ||
consigneezipcode | String | 10 | Y | 收件人邮编 | ||
consigneeprovince | String | 50 | Y | 收件人省州 | ||
consigneearea | String | 50 | 收件人区 | |||
consigneetel | String | 50 | 收件人电话(手机 / 电话二选一) | |||
consigneemobile | String | 50 | 收件人手机(手机 / 电话二选一) | |||
consigneetaxnumber | String | 50 | 收件人税号 | |||
consigneeemail | String | 50 | Y | 收件人邮箱 | ||
senderaddresstype | String | 20 | 寄件人地址类型 | |||
sendercountrycode | String | 2 | Y | 寄件人国家编码 | ||
sendername | String | 100 | Y | 寄件人名称 | ||
sendercorpname | String | 100 | 寄件人公司 | |||
senderaddress1 | String | 100 | Y | 寄件人地址1 | ||
senderaddress2 | String | 100 | 寄件人地址2(当地址 1 长度超出,分拆填充地址2中) | |||
senderaddress3 | String | 100 | 寄件人地址3 | |||
sendercity | String | 50 | Y | 寄件人城市 | ||
senderzipcode | String | 10 | Y | 寄件人邮编 | ||
senderprovince | String | 50 | Y | 寄件人省州 | ||
senderarea | String | 50 | 寄件人区 | |||
sendertel | String | 50 | 寄件人电话(手机 / 电话二选一) | |||
sendermobile | String | 50 | 寄件人手机(手机 / 电话二选一) | |||
vatnumber | String | 50 | VAT/税号 | |||
eorinumber | String | 50 | EORI/企业号 | |||
vatcorpname | String | 100 | VAT公司名称 | |||
vataddress | String | 200 | VAT公司地址 | |||
freight | Double | 打单运费 | ||||
extrafees | Double | 打单杂费 | ||||
currencycode | String | 5 | 费用币别 | |||
residential | String | 1 | 是否住宅地址(0:否,1:是) | |||
tntoptions | String | 2 | TNToptions(IN,PR) | |||
tntsenddate | String | 寄件日期 | ||||
interfacefieldvalue | String | 其它扩展字段 "{\"fapiaohao\":\"发票号\",\"invoice_fee\":\"发票运费\",\"other_fee\":\"其他费用\"}" | ||||
volumes | JSONArray | 材积信息(传入该节点以下字段都必须传入) | ||||
customerchildnumber | String | 50 | 客户子单号 | |||
prenum | Integer | Y | 件数 | |||
prelength | Double | Y | 长(CM) | |||
prewidth | Double | Y | 宽(CM) | |||
preheight | Double | Y | 高(CM) | |||
prerweight | Double | Y | 单件重量(KG) | |||
number | String | 箱序号(一票一件时可默认填1) | ||||
items | JSONArray | 物品信息 | ||||
skucode | String | 50 | Y | 商品SKU | ||
cnname | String | 100 | Y | 物品中文名 | ||
enname | String | 100 | Y | 物品英文名 | ||
weight | Double | Y | 净重(KG) | |||
mweight | Double | Y | 毛重(KG) | |||
quantity | Integer | Y | 数量 | |||
quantityunit | String | 10 | Y | 数量单位 | ||
price | Double | Y | 申报单价 | |||
declarecurrency | String | 10 | Y | 申报币别 | ||
hscode | String | 50 | Y | 海关编码 | ||
norms | String | 50 | 规格 | |||
note | String | 20 | 配货信息 | |||
usage | String | 100 | 用途(英文) | |||
material | String | 100 | 材质(英文) | |||
salesllink | String | 200 | 销售链接 | |||
origin | String | 20 | Y | 产地(填写国家二字码,如:CN) | ||
brand | String | 50 | 品牌 | |||
model | String | 50 | 型号 | |||
image | String | 产品图片(Base64) | ||||
imgext | String | 产品图片格式(.gif、.jpg、.png、.jpeg) | ||||
number | String | 箱序号(与材积信息中的箱序号对应,如一票一件时,可默认为1) |
请求报文示例
json
{
"authorization": {
"code": "KJHB",
"token": "c60bf762-01f7-470e-8c8f-acde06c81fed"
},
"datas": [
{
"order": {
"channelid": "HK_TNT",
"customernumber1": "T620200611-1001",
"customernumber2": "",
"number": "1",
"isbattery": "0",
"isinsurance": "0",
"forecastweight": "1.54",
"packagetypecode": "O",
"goodstypecode": "WPX",
"countrycode": "RU",
"consigneename": "Nwabisa Mkaka",
"consigneecorpname": "Nwabisa Mkaka",
"consigneeaddress1": "nah Iskan 2 Khamis",
"consigneeaddress2": "Mushait 62444-8888",
"consigneecity": "Khamis Mushait",
"consigneezipcode": "13958",
"consigneeprovince": "Asir",
"consigneetel": "546102083",
"consigneemobile": "546102083",
"consigneetaxnumber": "A068-02",
"consigneeemail": "admin@Nwabisa.com"
},
"volumes": [
{
"customerchildnumber": "CH-85120-1001",
"prenum": "5",
"prewidth": "50",
"prelength": "50",
"preheight": "50",
"prerweight": "15.55",
"number":"1"
}
],
"items": [
{
"skucode": "PK-08-001",
"cnname": "手机壳",
"enname": "iphone case",
"hscode": "PK896732",
"quantity": "10",
"quantityunit": "PCS",
"price": "5.87",
"declarecurrency": "USD",
"weight": "1.15",
"origin": "CN",
"model": "P40",
"note": "华为 P40 手机壳",
"material": "http://xxx.xxx.xxx",
"brand": "华为",
"usage": "",
"number":"1"
}
]
}
]
}
{
"authorization": {
"code": "KJHB",
"token": "c60bf762-01f7-470e-8c8f-acde06c81fed"
},
"datas": [
{
"order": {
"channelid": "HK_TNT",
"customernumber1": "T620200611-1001",
"customernumber2": "",
"number": "1",
"isbattery": "0",
"isinsurance": "0",
"forecastweight": "1.54",
"packagetypecode": "O",
"goodstypecode": "WPX",
"countrycode": "RU",
"consigneename": "Nwabisa Mkaka",
"consigneecorpname": "Nwabisa Mkaka",
"consigneeaddress1": "nah Iskan 2 Khamis",
"consigneeaddress2": "Mushait 62444-8888",
"consigneecity": "Khamis Mushait",
"consigneezipcode": "13958",
"consigneeprovince": "Asir",
"consigneetel": "546102083",
"consigneemobile": "546102083",
"consigneetaxnumber": "A068-02",
"consigneeemail": "admin@Nwabisa.com"
},
"volumes": [
{
"customerchildnumber": "CH-85120-1001",
"prenum": "5",
"prewidth": "50",
"prelength": "50",
"preheight": "50",
"prerweight": "15.55",
"number":"1"
}
],
"items": [
{
"skucode": "PK-08-001",
"cnname": "手机壳",
"enname": "iphone case",
"hscode": "PK896732",
"quantity": "10",
"quantityunit": "PCS",
"price": "5.87",
"declarecurrency": "USD",
"weight": "1.15",
"origin": "CN",
"model": "P40",
"note": "华为 P40 手机壳",
"material": "http://xxx.xxx.xxx",
"brand": "华为",
"usage": "",
"number":"1"
}
]
}
]
}
响应数据
响应字段说明
字段名称 | 字段说明 | ||
---|---|---|---|
code | 接口请求是否通过 0:表示接口请求通过,其他表示失败 | ||
msg | 说明信息 | ||
data | |||
code | 下单是否成功 1:表示接口请求通过,-1:表示失败 | ||
msg | 说明信息 | ||
customernumber | 客户参考号1 | ||
systemnumber | 我方系统单号 | ||
waybillnumber | 运单号 ( 运单号为空时根据业务需求是否后续再调用 [ 获取单号 ] 接口获取单号 ) | ||
shortnumber | 短单号 | ||
childs | 子单号 | ||
systemnumber | 系统子单号 | ||
customernumber | 客户子单号 | ||
tracknumber | 转单子单号 |
响应数据示例
json
{
"code": 0,
"msg": "调用成功",
"data": [
{
"code": 0,
"msg": "下单成功",
"customernumber": "T620200611-1001",
"systemnumber": "1591857709631",
"waybillnumber": "EV2145664012CN",
"childs": [
{
"customernumber": "CH-85120-1001",
"systemnumber": "1591857709631-1",
"tracknumber": "1Z76V3R40448621361"
},
{
"customernumber": "CH-85120-1002",
"systemnumber": "1591857709631-2",
"tracknumber": "1Z76V3R40448621362"
},
{
"customernumber": "CH-85120-1003",
"systemnumber": "1591857709631-3",
"tracknumber": "1Z76V3R40448621363"
},
{
"customernumber": "CH-85120-1004",
"systemnumber": "1591857709631-4",
"tracknumber": "1Z76V3R40448621363"
},
{
"customernumber": "CH-85120-1005",
"systemnumber": "1591857709631-5",
"tracknumber": "1Z76V3R40448621363"
}
]
}
]
}
{
"code": 0,
"msg": "调用成功",
"data": [
{
"code": 0,
"msg": "下单成功",
"customernumber": "T620200611-1001",
"systemnumber": "1591857709631",
"waybillnumber": "EV2145664012CN",
"childs": [
{
"customernumber": "CH-85120-1001",
"systemnumber": "1591857709631-1",
"tracknumber": "1Z76V3R40448621361"
},
{
"customernumber": "CH-85120-1002",
"systemnumber": "1591857709631-2",
"tracknumber": "1Z76V3R40448621362"
},
{
"customernumber": "CH-85120-1003",
"systemnumber": "1591857709631-3",
"tracknumber": "1Z76V3R40448621363"
},
{
"customernumber": "CH-85120-1004",
"systemnumber": "1591857709631-4",
"tracknumber": "1Z76V3R40448621363"
},
{
"customernumber": "CH-85120-1005",
"systemnumber": "1591857709631-5",
"tracknumber": "1Z76V3R40448621363"
}
]
}
]
}