# 创建订单

# 简要描述
  • 创建订单接口,如果需要关联土豆api商品系统请在支付设置里面把(是否关联商品系统打开),如果不需要关联商品系统则关掉是否关联商品系统,打开这个开关则需要传商品id
# 请求URL
  • api/createOrder
# 请求头
参数名 必选 类型 说明
Content-Type string 此参数必传,当请求数据非json时此参数传对应格式如(multipartform-data,application/x-www-form-urlencoded,等)是json请传application/json
askKey string 此参数必传,验证app的令牌
sign string 此参数如果在app设置开启了验签是必传
time string 当开启验签时,此参数为必传
apiUserToken string 除了部分不验证用户令牌的接口以外此参数为必传(注册/登陆/发送验证码)不是必传,其余都是必传
# 请求方式
  • post
# 参数
参数名 必选 类型 说明
amount string 金额
payType int 支付方式2 微信电脑码支付,4微信码支付 5,支付宝码支付
count int 商品数
goodsId String 商品id
# 请求示例
{
    "amount":10,
    "payType":5,
    "count":1,
    "goodsId":"1"
}
1
2
3
4
5
6

#####CUL

curl --location --request POST 'https://api.potatocloud.cn/api/createOrder' \
--header 'askkey: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6Njk4MTU1MTQ2OTk3NzQ3NzEyLCJnZXRNYW5hZ2VtZW50SWQiOjY5ODExOTE5MzkxODc4NzU4NCwiVElNRSI6MTY1NTU2NDc2ODM3NX0.LaEFrhA1_i_hiWT-Xa0R9yo9dVi6K5xDQ7hb0WZlY_U' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount":10,
    "payType":5,
    "count":1,
    "goodsId":"1"
}'
1
2
3
4
5
6
7
8
9
# 返回示例
{
    "code": "200",
    "message": "",
    "status": true,
    "data": {
        "amount": 10,
        "orderNO": "AP708304019648962560",
        "payType": 5,
        "charge": 0.50,
        "count": 1,
        "discount": 0.00
    },
    "pc": null,
    "time": null,
    "sign": null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 返回参数说明
参数名 类型 说明
code string 状态码200成功403权限异常或登陆超时,500请求异常
status int 状态0删除1使用
data json 更新对象
amount BigDecimal 支付金额
orderNO string 订单号
payType int 支付方式2 微信电脑码支付,4微信码支付 5,支付宝码支付
charge BigDecimal 手续费
count int 商品数
discount BigDecimal 折扣
# 备注
  • 更多返回错误代码请看首页的错误代码描述
lastUpdate: 7/25/2024, 4:21:14 PM