创建/更新订单
POST
/external/order/import
更新时只支持更新订单状态(状态不能回退,比如不能从已支付改为待支付)、订单金额、订单自定义字段
请求参数
Header 参数
appId
string
应用 appId
默认值:
{{appId}}
timestamp
string
请求时间戳
默认值:
{{timestamp}}
sign
string
请求消息签名值
默认值:
{{sign}}
appKey
string
应用 appKey
默认值:
{{appKey}}
Body 参数application/json
order
object
订单信息
channelId
string
平台id
channelName
string
平台名称
shopId
string
店铺id
shopName
string
店铺名称
unionId
string
unionId 如果不存在,采用mobile字段关联客户信息
mobile
string
客户电话
qwUserId
string
负责人企微id
orderId
string
订单编号
orderPrice
number
订单金额
orderStatus
integer
订单状态
orderTime
string
下单时间
payTime
string
支付时间
customDefine
array [object {2}]
自定义内容
goods
array [object {4}]
商品列表
goodName
string
商品名称
imageUrl
string
商品图片连接
goodPrice
number
商品单价
num
integer
购买商品个数
示例
{
"order": {
"channelId": "12306",
"channelName": "12306",
"shopId": "TEST",
"shopName": "测试店铺",
"unionId": "o9ATRwQFTGcc5oYonrcfQJdDTbI4",
"mobile": "18188888888",
"orderId": "TEST_12345678",
"orderPrice": 0.01,
"orderStatus": 2,
"orderTime": "2021-12-10 15:53:29",
"customDefine": [
{
"key": "1191",
"value": "xxx"
},
{
"key": "1190",
"value": "1"
}
]
},
"goods": [
{
"goodName": "测试商品",
"imageUrl": "https://xxx",
"goodPrice": 0.01,
"num": 1
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/external/order/import' \
--header 'appId;' \
--header 'timestamp;' \
--header 'sign;' \
--header 'appKey: {{appKey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"order": {
"channelId": "12306",
"channelName": "12306",
"shopId": "TEST",
"shopName": "测试店铺",
"unionId": "o9ATRwQFTGcc5oYonrcfQJdDTbI4",
"mobile": "18188888888",
"orderId": "TEST_12345678",
"orderPrice": 0.01,
"orderStatus": 2,
"orderTime": "2021-12-10 15:53:29",
"customDefine": [
{
"key": "1191",
"value": "xxx"
},
{
"key": "1190",
"value": "1"
}
]
},
"goods": [
{
"goodName": "测试商品",
"imageUrl": "https://xxx",
"goodPrice": 0.01,
"num": 1
}
]
}'
返回响应
🟢200成功
application/json
Body
code
integer
示例:0
message
string
必需
示例
{
"code": 0,
"message": "success"
}