主题
在线支付下单
简述
- 商户在线 Payin 下单接口
请求 URL
/pay/merchant/createOrder
请求参数
- body
| 参数名 | 必选 | 类型 | 长度 | 说明 |
|---|---|---|---|---|
| merchantId | 是 | String | 32 | 商户编码(平台分配) |
| merOrderId | 是 | String | 64 | 商户订单号,在商户系统保证唯一 |
| subMerId | 否 | String | 32 | 二级商户号 如存在则上送 |
| orderType | 是 | String | 32 | 交易类型 固定值:online_payin |
| paymentType | 否 | String | 100 | 支付方式,非必填(商户可指定支付方式)可多值,","(英文输入法)隔开。 取值内容:附录-支付方式 |
| orderAmt | 是 | String | 12 | 交易金额 两位小数 格式:100.00 |
| orderCurrency | 是 | String | 10 | 交易币种 例如:SAR |
| expireTime | 是 | String | 4 | 订单有效时间 单位:min 默认 30min |
| serverNotifyUrl | 否 | String | 255 | 服务端支付结果通知地址。商户如果传该字段,以此 URL 为准给商户服务端回调;如果未传该字段,以后端配置的 URL 给商户服务端回调 |
| frontRedirectUrl | 是 | String | 255 | 前端支付结果跳转地址 |
| productInfo | 是 | List<Object> | 订单商品信息 可以多种商品。对象格式,(Object:productInfo) | |
| customerInfo | 是 | Object | 客户信息,对象格式,(Object:customerInfo) | |
| deliveryInfo | 条件 | Object | 物流信息,对象格式,(Object:deliveryInfo)当 productInfo.productType=physical 必填 | |
| orderDesc | 否 | String | 128 | 订单说明 |
| cashierIsSdk | 否 | String | 2 | 收银台接入方式,不传默认为 00:统一收银台1:SDK 方式 |
Object:productInfo
| 参数名 | 必选 | 类型 | 长度 | 说明 |
|---|---|---|---|---|
| productType | 是 | String | 32 | 商品类型virtual:虚拟商品physical:实体商品 |
| productName | 是 | String | 128 | 商品名称 |
| productSku | 否 | String | 100 | 商品编码 |
| productQuantity | 是 | String | 5 | 商品数量 |
| productUnitPrice | 是 | String | 12 | 商品单价 如:1.00 |
| productCurrency | 是 | String | 10 | 币种 如:SAR |
| productDesc | 否 | String | 128 | 商品描述 |
| productAvatarUrl | 是 | String | 255 | 商品图片链接 |
Object:customerInfo
| 参数名 | 必选 | 类型 | 长度 | 说明 |
|---|---|---|---|---|
| customerUid | 是 | String | 40 | 客户在商户的 uid,需要保证每个用户 uid 唯一 |
| customerName | 是 | String | 128 | 客户姓名 |
| customerPlatform | 是 | String | 128 | 客户在购买商品的 APP 平台名称 |
| customerPhone | 条件 | String | 18 | 客户手机号 当 productType=physical 必填 |
| customerEmail | 是 | String | 64 | 客户邮箱 |
Object:deliveryInfo
| 参数名 | 必选 | 类型 | 长度 | 说明 |
|---|---|---|---|---|
| firstName | 是 | String | 64 | 收货人:名 |
| lastName | 是 | String | 64 | 收货人:姓 |
| phone | 是 | String | 18 | 收货人手机号 |
| country | 是 | String | 128 | 收货地址:国家 |
| city | 是 | String | 128 | 收货地址:城市 |
| address | 是 | String | 128 | 收货地址:详细地址 |
| zipCode | 是 | String | 10 | 邮编 |
请求示例
json
{
"merchantId": "M12345678",
"merOrderId": "202412131543011234578",
"subMerId": "",
"orderType": "online_payin",
"paymentType": "stcpay,cardpay,applepay",
"orderAmt": "100.00",
"orderCurrency": "SAR",
"expireTime": "30",
"serverNotifyUrl": "https://xxxxx.com",
"frontRedirectUrl": "https://xxxxx.com",
"productInfo": [
{
"productType": "physical",
"productName": "huawei phone",
"productSku": "12345689",
"productQuantity": "2",
"productUnitPrice": "50.00",
"productCurrency": "SAR",
"productDesc": "abc",
"productAvatarUrl": "www.xxxx.com"
}
],
"customerInfo": {
"customerUid": "abce_2323_2323",
"customerName": "Mr balck",
"customerPlatform": "hongkong sg",
"customerPhone": "5001999921",
"customerEmail": "abcdef@163.com"
},
"deliveryInfo": {
"firstName": "alfa",
"lastName": "zhang",
"phone": "5001999921",
"country": "Saudi Arabia",
"city": "Riyadh",
"address": "chaoyang road xxxxx",
"zipCode": "100000"
},
"orderMemo": "123457xxxxx",
"cashierIsSdk": "0"
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
响应参数
- data
| 参数名 | 类型 | 说明 |
|---|---|---|
| merchantId | String | 商户编码 |
| orderId | String | 平台交易订单号 |
| merOrderId | String | 商户订单号,原值返回 |
| subMerId | String | 二级商户编号 |
| orderType | String | 支付类型 online_payin |
| paymentType | String | 支付方式 可多值,"," 隔开。 取值内容: 附录-支付方式 |
| paymentUrl | String | 支付链接 跳转地址 |
| orderStatus | String | 交易状态:init:初始化pending:处理中success:成功fail:失败expired:已过期 |
响应示例
json
{
"code": 10000,
"message": "success",
"data": {
"merchantId": "M12345678",
"orderId": "TRD20241213154012000995",
"merOrderId": "202412131543011234578",
"subMerId": "",
"orderType": "online_payin",
"paymentType": "applepay,stcpay,cardpay",
"paymentUrl": "https://api-dev.gccpay.cn/en-US/order/TRD20241213154012000995",
"orderStatus": "init"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
