文档
测试

订单创建

POST
https://api.sooxie.com/Order/Creat

请求头

参数名
类型
描述
必填
Content-Type
string
application/json
必填
appid
string
应用id
必填
sign
string
签名
必填
timestamp
long
时间戳
必填
accesstoken
string
访问令牌
必填

请求参数

application/json
参数名
类型
描述
必填
shopings
array
数据列表
必填
stroe
string
商家 如:九龙鞋店
必填
artno
string
货号
必填
color
string
颜色
必填
size
string
尺码
必填
num
int
数量 如:1
必填
price
int
发价 如:100
必填
address
string
收货地址
必填
express
string
快递 如:中通快递 从快递列表获取
必填
gift
array
数据列表
可选
giftid
int
礼品id 从礼品列表获取
可选
count
int
数量
可选
remark
string
订单备注
可选

响应参数

application/json
参数名
类型
描述
必填
success
boolean
示例:false
必填
msg
string
示例:不存在的Token
必填

说明 / 示例

**请求参数** ```json { "shopings": [ { "stroe": "string", //商家名 "artno": "string", //货号 "color": "string", //颜色 "size": "string", //尺码 "num": 1, //数量 "price": 100 //价格 decimal } ], "address": "string", //收货地址 "express": "string", //发货快递 /Order/ExpressByAuth 接口获取 "gift": [ //礼品 没有可以不传 { "giftid": 0, //礼品id /Order/ExpressByAuth接口获取 传 ID "count": 1 //礼品数量 } ], "remark": "string" //可为空 } ``` ```json curl -X 'POST' \ 'https://api.sooxie.com/Order/Creat' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "shopings": [ { "stroe": "string", "artno": "string", "color": "string", "size": "string", "num": 100, "price": 5000 } ], "address": "string", "express": "string", "gift": [ { "giftid": 0, "count": 0 } ], "remark": "string" }' ``` **c#请求示例 Nuget Flurl Flurl.Http** ```cpp using Flurl.Http; namespace Demo { public class Test() { public async Task<dynamic> Creat() { var gift = new List<gift>(); gift.Add(new gift { giftid = 12345, count = 2 }); gift.Add(new gift { giftid = 3214, count = 1 }); var shoping = new List<shoping>(); shoping.Add(new shoping { stroe = "九龙鞋店", artno = "N128", color = "红色", size = "39", num = 2, price = 66 }); shoping.Add(new shoping { stroe = "涌哥网批", artno = "3658", color = "黑色", size = "42", num = 1, price = 88 }); var order = new Order { account = "test@sooxie.com", address = "张三,13888888888,福建省 泉州市 鲤城区 幸福街001号", express = "中通快递", gift = gift, remark = "备注", shopings = shoping }; string url = "https://api.sooxie.com/Order/Creat"; var result = url.PostJsonAsync(order).ReceiveJson(); return result; } } } ``` **C#实体** ```cpp public class Order { public List<shoping> shopings { get; set; } public string address { get; set; } public string express { get; set; } public List<gift>? gift { get; set; } public string? remark { get; set; } } public class shoping { public string stroe { get; set; } public string artno { get; set; } public string color { get; set; } public string size { get; set; } public int num { get; set; } public decimal price { get; set; } } public class gift { public int giftid { get; set; } public int count { get; set; } = 1; } ``` **参数错误返回400** ```json { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, "traceId": "00-4245113d06419dfb4ce6842f0576a560-9151fdcf3829151f-00", "errors": { "shopings[0].num": [ "The field num must be between 1 and 100." ] } } ```