# 创建订单
# 简要描述
- 创建订单接口,如果需要关联土豆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 | 用户令牌 |
nonce | 否 | string | 随机字符串(当开启V3验签此参数必传,且2分钟内不允许重复) |
# 请求方式
- 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
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
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
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 | 折扣 |
# 备注
- 更多返回错误代码请看首页的错误代码描述