创建订单--createOrder
POST
/default/svc/web-service
createOrder
2.如无特殊说明,重量单位为kg,长度单位为cm
3.如果响应结果中的track_status为2,表示需要调用获取跟踪号接口异步获取跟踪号
4.请求参数里面如果包含>、&,需要转义成对应的实体>、&,或者paramsJson节点的内容使用<![CDATA[ ]]>标签忽略解析
请求参数
Body 参数application/xml
reference_no
string
客户单号
<= 50 字符
示例值:
TEST123456
shipping_method
string
运输方式
country_code
string
国家代码
<= 2 字符
示例值:
US
extra_service
string | null
额外服务
order_weight
number
必需
shipping_method_no
string | null
跟踪号
order_pieces
integer
必需
insurance_value
number | null
保险金额
mail_cargo_type
enum<string> | enum<null>
申报类型
枚举值:
1234
默认值:
4
cargo_type
enum<string> | enum<null>
包裹类型
枚举值:
WDL
默认值:
W
is_COD
enum<string> | enum<null>
可选
>= 0 字符<= 1 字符
枚举值:
YN
示例值:
Y
sales_amount
number | null
COD订单金额
sales_currency
string | null
COD订单金额币种
<= 3 字符
示例值:
USD
seller_id
string | null
卖家ID
buyer_id
string | null
买家ID
invoice_fee
number | null
发票运费
other_fee
number | null
其他费用
warehouse_code
string
FBA仓库代码
platform_number
string | null
平台单号
<= 50 字符
ioss
string | null
可选
customs_declaration_type
string | null
可选
customs_clearance_type
string | null
可选
Consignee
object
收件人节点
consignee_company
string | null
收件人公司名
consignee_name
string
收件人姓名
consignee_doorplate
string | null
收件人门牌号
consignee_street
string
收件人地址1
consignee_street2
string | null
收件人地址2
consignee_street3
string | null
收件人地址3
consignee_district
string | null
收件人县区
consignee_city
string
收件人城市
consignee_province
string | null
可选
consignee_postcode
string
必需
consignee_telephone
string | null
收件人电话
consignee_mobile
string | null
收件人手机
consignee_email
string | null
收件人邮箱
consignee_certificatetype
enum<string> | enum<null>
收件人证件类型
<= 2 字符
枚举值:
IDPP
consignee_certificatecode
string | null
收件人证件号码
consignee_credentials_period
string | null
收件人证件有效期
示例值:
2024-12-31
consignee_passport_address
string | null
收件人护照签发地
consignee_taxno
string | null
收件人税号
consignee_taxno_type
enum<string> | enum<null>
收件人税号类型
枚举值:
1234
consignee_eori
string | null
收件人EORI
Shipper
object | null
发件人节点
shipper_name
string
发件人姓名
shipper_company
string | null
发件人公司名
shipper_doorplate
string | null
发件人门牌号
shipper_street
string
发件人地址1
shipper_street2
string | null
发件人地址2
shipper_street3
string | null
发件人地址3
shipper_city
string
发件人城市
shipper_province
string | null
发件人省份
shipper_postcode
string
发件人地址邮编
shipper_telephone
string | null
发件人电话
shipper_mobile
string | null
发件人手机
shipper_email
string | null
发件人邮箱
shipper_fax
string | null
发件人传真
shipper_tax_number
string | null
发件人税号
shipper_tax_number_type
enum<string> | enum<null>
发件人税号类型
枚举值:
1234
shipper_eori
string | null
发件人EORI
shipper_certificatecode
string | null
发件人证件号码
shipper_certificatetype
enum<string> | enum<null>
发件人证件类型
枚举值:
IDPP
ItemArr
array [object {27}]
申报信息节点
box_number
string | null
可选
invoice_enname
string
英文品名
invoice_cnname
string | null
中文品名
invoice_weight
number
申报单重,单位kg
invoice_quantity
integer
申报数量
>= 1
unit_code
enum<string> | enum<null>
申报单位
枚举值:
PCEPCSSETMTR
invoice_unitcharge
number
申报单价
invoice_currencycode
string | null
申报币种
示例值:
USD
hs_code
string | null
海关编码
invoice_note
string | null
配货信息
invoice_url
string | null
销售链接
sku
string | null
SKU
material
string | null
中文材质
material_enture
string | null
英文材质
product_id
string | null
产品ID
transaction_id
string | null
交易ID
use
string | null
用途
invoice_brand
string | null
品牌
invoice_brand_type
enum<string> | enum<null>
品牌类型
枚举值:
NBTTBTABTPBTOBT
invoice_category
string | null
品类
invoice_model
string | null
型号
is_magnetoelectric
enum<string> | enum<null>
是否带磁带电
枚举值:
NYEM
note
string | null
备注1
note2
string | null
备注2
deal_price
number | null
成交价
deal_currencycode
string
成交价币种
<= 3 字符
示例值:
USD
country_of_origin
string | null
原产国
示例值:
US
Volume
array [object {7}]
必需
box_number
string | null
可选
<= 50 字符
child_number
string | null
子单号
<= 50 字符
reference_id
string | null
可选
<= 50 字符
shipment_id
string | null
可选
<= 50 字符
length
number | null
长度,单位cm
width
number | null
宽度,单位cm
height
number | null
高度,单位cm
示例
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/">
<SOAP-ENV:Body>
<ns1:callService>
<paramsJson>
<![CDATA[
{
"reference_no": "{{reference_no}}",
"shipping_method": "{{shipping_method}}",
"country_code": "CA",
"extra_service": "",
"order_weight": 18.51,
"shipping_method_no": "",
"order_pieces": 2,
"insurance_value": "",
"mail_cargo_type": 4,
"cargo_type": "W",
"is_COD": "N",
"sales_amount": "",
"sales_currency": "",
"seller_id": "",
"buyer_id": "",
"payment_type": "",
"invoice_fee": null,
"other_fee": null,
"reference_id": "",
"shipment_id": "",
"POANumber": "",
"warehouse_code": "",
"platform": "",
"platform_number": "",
"ioss": "",
"Consignee": {
"consignee_company": "consignee company",
"consignee_province": "BC",
"consignee_city": "RICHMOND",
"consignee_street": "14967 Salt Lake Ave",
"consignee_street2": "",
"consignee_postcode": "V7C4V7",
"consignee_name": "consignee name",
"consignee_telephone": "+6584884901",
"consignee_mobile": "+6584884901",
"consignee_email": "test@qq.com",
"buyer_id": ""
},
"ItemArr": [
{
"box_number":"U001",
"invoice_enname": "3D printer filament",
"invoice_cnname": "3D打印线材",
"invoice_weight": 1.390,
"invoice_quantity": 1,
"unit_code": "PCE",
"invoice_unitcharge": 15.99,
"invoice_currencycode": "USD",
"deal_price": 14.0000,
"deal_currencycode": "USD",
"hs_code": "39169090",
"invoice_note": "",
"invoice_url": "",
"sku": "A01-W2-1.75-1000-SPL",
"shop_sku": "",
"box_number": "",
"material": "",
"material_enture": "",
"product_id": "",
"transaction_id": "",
"use": "",
"invoice_brand": "",
"invoice_brand_type": "",
"invoice_category": "",
"invoice_model": "",
"is_magnetoelectric": "N",
"country_of_origin": "CN",
"note": "",
"note2": ""
},
{
"box_number":"U002",
"invoice_enname": "3D printer filament",
"invoice_cnname": "3D打印线材",
"invoice_weight": 1.394,
"invoice_quantity": "1",
"unit_code": "PCE",
"invoice_unitcharge": 15.99,
"invoice_currencycode": "USD",
"deal_price": 14.0000,
"deal_currencycode": "USD",
"hs_code": "39169090",
"invoice_note": "",
"invoice_url": "",
"sku": "A00-D0-1.75-1000-spl",
"shop_sku": "",
"box_number": "",
"material": "",
"material_enture": "",
"product_id": "",
"transaction_id": "",
"use": "",
"invoice_brand": "",
"invoice_brand_type": "",
"invoice_category": "",
"invoice_model": "",
"is_magnetoelectric": "N",
"country_of_origin": "CN",
"note": "",
"note2": ""
}
],
"Shipper": {
"shipper_countrycode": "JP",
"shipper_province": "",
"shipper_city": "Tokyo",
"shipper_street": "10 FedEx Parkway",
"shipper_doorplate": "5/F",
"shipper_telephone": "13800138000",
"shipper_name": "shipper name",
"shipper_company": "shipper company",
"shipper_postcode": "1690051",
"shipper_email": "test@gmail.com"
},
"Volume": [
{
"box_number":"U001",
"length": 50,
"width": 37,
"height": 23,
"weight": 14.01
},
{
"box_number":"U002",
"length": 25,
"width": 25,
"height": 23,
"weight": 4.5
}
]
}
]]>
</paramsJson>
<appToken>{{appToken}}</appToken>
<appKey>{{appKey}}</appKey>
<service>createOrder</service>
</ns1:callService>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://8.129.234.2:8085/default/svc/web-service' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/">
<SOAP-ENV:Body>
<ns1:callService>
<paramsJson>
<![CDATA[
{
"reference_no": "{{$string.alphanumeric}}",
"shipping_method": "PK0231",
"country_code": "CA",
"extra_service": "",
"order_weight": 18.51,
"shipping_method_no": "",
"order_pieces": 2,
"insurance_value": "",
"mail_cargo_type": 4,
"cargo_type": "W",
"is_COD": "N",
"sales_amount": "",
"sales_currency": "",
"seller_id": "",
"buyer_id": "",
"payment_type": "",
"invoice_fee": null,
"other_fee": null,
"reference_id": "",
"shipment_id": "",
"POANumber": "",
"warehouse_code": "",
"platform": "",
"platform_number": "",
"ioss": "",
"Consignee": {
"consignee_company": "consignee company",
"consignee_province": "BC",
"consignee_city": "RICHMOND",
"consignee_street": "14967 Salt Lake Ave",
"consignee_street2": "",
"consignee_postcode": "V7C4V7",
"consignee_name": "consignee name",
"consignee_telephone": "+6584884901",
"consignee_mobile": "+6584884901",
"consignee_email": "test@qq.com",
"buyer_id": ""
},
"ItemArr": [
{
"box_number":"U001",
"invoice_enname": "3D printer filament",
"invoice_cnname": "3D打印线材",
"invoice_weight": 1.390,
"invoice_quantity": 1,
"unit_code": "PCE",
"invoice_unitcharge": 15.99,
"invoice_currencycode": "USD",
"deal_price": 14.0000,
"deal_currencycode": "USD",
"hs_code": "39169090",
"invoice_note": "",
"invoice_url": "",
"sku": "A01-W2-1.75-1000-SPL",
"shop_sku": "",
"box_number": "",
"material": "",
"material_enture": "",
"product_id": "",
"transaction_id": "",
"use": "",
"invoice_brand": "",
"invoice_brand_type": "",
"invoice_category": "",
"invoice_model": "",
"is_magnetoelectric": "N",
"country_of_origin": "CN",
"note": "",
"note2": ""
},
{
"box_number":"U002",
"invoice_enname": "3D printer filament",
"invoice_cnname": "3D打印线材",
"invoice_weight": 1.394,
"invoice_quantity": "1",
"unit_code": "PCE",
"invoice_unitcharge": 15.99,
"invoice_currencycode": "USD",
"deal_price": 14.0000,
"deal_currencycode": "USD",
"hs_code": "39169090",
"invoice_note": "",
"invoice_url": "",
"sku": "A00-D0-1.75-1000-spl",
"shop_sku": "",
"box_number": "",
"material": "",
"material_enture": "",
"product_id": "",
"transaction_id": "",
"use": "",
"invoice_brand": "",
"invoice_brand_type": "",
"invoice_category": "",
"invoice_model": "",
"is_magnetoelectric": "N",
"country_of_origin": "CN",
"note": "",
"note2": ""
}
],
"Shipper": {
"shipper_countrycode": "JP",
"shipper_province": "",
"shipper_city": "Tokyo",
"shipper_street": "10 FedEx Parkway",
"shipper_doorplate": "5/F",
"shipper_telephone": "13800138000",
"shipper_name": "shipper name",
"shipper_company": "shipper company",
"shipper_postcode": "1690051",
"shipper_email": "test@gmail.com"
},
"Volume": [
{
"box_number":"U001",
"length": 50,
"width": 37,
"height": 23,
"weight": 14.01
},
{
"box_number":"U002",
"length": 25,
"width": 25,
"height": 23,
"weight": 4.5
}
]
}
]]>
</paramsJson>
<appToken>a106eb7a118d78f92cabbc91586caa84</appToken>
<appKey>a106eb7a118d78f92cabbc91586caa8401ac591bb285b42966f035d8d49a7b5c</appKey>
<service>createOrder</service>
</ns1:callService>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>'
返回响应
🟢200成功
application/xml
Body
ask
enum<string>
结果状态
枚举值:
SuccessFailure
message
string
结果提示信息
reference_no
string
客户单号
shipping_method_no
string | null
尾程跟踪号
agent_number
string | null
渠道转单号
order_code
string
系统运单号
system_number
string
第三方系统单号
track_status
integer
必需
sender_info_status
enum<integer>
公共发件人分配状态
枚举值:
01
ODA
enum<string> | enum<null>
可选
枚举值:
YNnull
tracking_number_list
object
必需
xxx
string | null
可选
yyy
string | null
子单跟踪号
time_cost(s)
string
耗时,单位秒
示例
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","reference_no":"e9W0ftAdbpEkTe2zZDn7","shipping_method_no":"794813650212","order_code":"CR36600006","track_status":1,"sender_info_status":0,"ODA":null,"agent_number":"","system_number":null,"tracking_number_list":{"U001":"794813650212","U002":"794813650223"},"time_cost(s)":11.210399866104}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
🟢200失败
修改于 2025-01-02 03:13:00