创建订单
POST
/pb/mp/order/v2/create创建多平台店铺手工单,包含自定义平台订单,对应系统中订单类型为“手工订单”类型
| API Path | 请求协议 | 请求方式 | 令牌桶容量 |
|---|---|---|---|
/pb/mp/order/v2/create | HTTPS | POST | 10 |
请求参数
platform_codeinteger必填store_idstring必填ordersarray<object>必填隐藏子属性
platform_order_nostring必填site_codestringbuyer_notestringreceiver_country_codestring必填customer_shipping_amountnumbercustomer_tax_amountnumberorder_total_amountnumberwidstringglobal_purchase_timenumberglobal_payment_timenumberremarkstringlogistics_type_idstringreceiver_namestring必填address_typeintegerbuyer_choose_expressstringreceiver_company_namestringcitystring必填address_line1string必填amount_currencystringorder_custom_fieldsobjectitemsarray<object>必填隐藏子属性
skustringquantityinteger必填unit_pricenumber必填mskustringstock_deduction_typestringitem_custom_fieldsobjectshipping_infoobject隐藏子属性
tms_waybill_nostring必填tms_tracking_nostring必填file_namestring必填base64Filestring必填sender_tax_typeintegersender_tax_nostring请求示例
{
"platform_code": 10009,
"store_id": "110283406273996288",
"orders": [
{
"buyer_note": "xxx",
"customer_shipping_amount": "20.00",
"customer_tax_amount": "2.00",
"order_total_amount": "20.80",
"platform_order_no": "10379511104466944",
"receiver_country_code": "CN",
"wid": "1",
"logistics_type_id": "1",
"items": [
{
"sku": "xhp004",
"quantity": 1,
"unit_price": "10.00",
"stock_deduction_type": 1
}
]
}
]
}
返回结果
Json Object
codeinteger必填messagestring必填request_idstring必填response_timestring必填dataarray<object>必填隐藏子属性
error_detailsarray<object>必填隐藏子属性
error_messagestring必填platform_order_nostring必填success_detailsarray<object>必填隐藏子属性
global_order_nointeger必填platform_order_nostring必填返回成功示例
{
"code": 0,
"message": "操作成功",
"request_id": "2ecb8a09-275e-4773-9399-ebfbb17c1804.1689906739215",
"response_time": "2023-07-21 10:32:19",
"data": {
"error_details": [],
"success_details": [
{
"platform_order_no": "263407812560417017",
"global_order_no": "103336708973801472"
}
]
}
}
附加说明
以对象名为custom_fields举例
创建入参:
| 参数名 | 说明 | 必填 | 类型 |
|---|---|---|---|
custom_fields | 自定义字段,键为自定义字段标识id,值为对象 | 否 | [object] |
custom_fields>>id | 字段Id | 是 | [string] |
custom_fields>>val | 字段值 | 是 | [array] [string] |
custom_fields>>character | 字段额外属性(单位、币种等) | 是 | [string] |
查询反参:
自定义字段custom_fields字段格式如下:
| 参数名 | 说明 | 类型 |
|---|---|---|
custom_fields | 自定义字段,键为自定义字段标识id,值为对象 | [object] |
custom_fields>>id | 字段Id | [string] |
custom_fields>>name | 字段名称 | [string] |
custom_fields>>val | 字段值 | [array] [string] |
custom_fields>>val_text | 字段值文本描述 | [string] |
custom_fields>>character | 字段属性 | [string] |
案例:
传参格式以字段类型为准,可在对应手工单创建页面查看所有预设自定义入参
{
"custom_fields": {
"207625221713657857": {
"id": "207625221713657857",
"name": "自定义文本字段1",
"val": "自定义值1",
"val_text": "自定义值1",
"character": ""
},
"207628319154110465": {
"id": "207628319154110465",
"name": "自定义金额字段",
"val": "1",
"val_text": "¥1",
"character": "CNY"
},
"207628315704386049": {
"id": "207628315704386049",
"name": "自定义多选框",
"val": ["207628364666183680","207628724481196032"],
"val_text": "",
"character": ""
}
}
}