GWPAY API 对接文档
API 基础信息
- 所有 API 请求都应在请求正文中以 JSON 格式 发送(对于 POST)。
- 所有回复都将采用 JSON 格式。
- 字符编码采用 UTF-8 编码。
- 发送的 POST 请求 Content-Type 采用 Content-Type: application/json; charset=utf-8
- 参数规范 唤醒金额:默认为 INR 1:1
- API 基本 URL https://jueapi.gwpay.org
- 我方回调IP : 13.207.235.33
加密签名
- 将所有需要签名的字段按 ASCII 码升序排序,并按 a=b&c=d 的格式连接成一个字符串
- 然后使用 &secret=secret(secret 是商户的api-secret)拼接商户的api-secret,生成待签名的字符串。
- 除了 sign 以外不为空的参数都需要参与签名
- 使用 MD5 对 待签名的字符串 进行加密,生成 小写签名字符串 sign
1. 支付下单接口
请求URL:
POST /gw/api/order/payin
Request Format:
所有请求都应以 JSON 格式发送。
请求参数 (JSON Body):
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| merchant_uid | String | Yes | 商户UID |
| merchant_order_id | String | Yes | 商户单号唯一 |
| amount | Integer | Yes | 金额-单位元(INR) |
| notify_url | String | Yes | 回调地址 |
| signature | String | Yes | 签名 |
请求示例:
POST https://jueapi.gwpay.org/gw/api/order/payin
Content-Type: application/json
{
"merchant_uid": "9001",
"amount": 100,
"merchant_order_id": "111111111111",
"signature": "xxxxxxxxxxx",
"notify_url": "http://jxjxjxjx.com/notify",
}
成功返回:
{
"code": 0,
"message": "success",
"payment_url": "https://translate.google.com/",
"order_id": "111111111111"
}
失败返回:
{
"code": 5001,
"message": "xxxxx"
}
2. 支付查单接口
唤醒请求URL:
POST /gw/api/order/payin/query
Request Format:
所有请求都应以 JSON 格式发送。
请求参数 (JSON Body):
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| merchant_uid | String | Yes | 商户UID |
| signature | String | Yes | 签名 |
| merchant_order_id | String | Yes | 商户单号 |
请求示例:
POST https://jueapi.gwpay.org/gw/api/order/payin/query
Content-Type: application/json
{
"merchant_uid": "9001",
"merchant_order_id": "1234567890",
"signature": "xxxxxxxxxxxx"
}
成功返回:
{
"code": 0,
"message": "success",
"utr": "5656565656",
"payment_status": "success", //failed success pending
"order_id": "2222222222222",
"amount": 100,
"pay_amount": 100,
}
失败返回:
{
"code": 5001,
"message": "reasoxxxxn"
}
返回参数说明:
| 参数 | 类型 | 描述 |
|---|---|---|
| code | Int | 响应状态:0=成功,不为0失败 |
| message | String | 描述 |
| payment_status | String | 订单状态-failed- success- pending |
| order_id | String | 平台单号 |
| pay_amount | int | 实际支付金额 |
| amount | int | 订单金额 |
| utr | String | UTR |
3. 支付回调通知
请求URL:
POST 你的回调地址
Request Format:
所有请求都应以 JSON 格式发送。
请求参数 (JSON Body):
| 参数 | 类型 | 描述 |
|---|---|---|
| payment_status | String | 订单状态-failed- success- pending |
| merchant_uid | String | 商户UID |
| order_id | Integer | 平台单号 |
| merchant_order_id | String | 商户单号 |
| order_amount | int | 订单金额 |
| pay_amount | int | 实际支付金额 |
| utr | String | UTR |
| sign | String | 签名 |
请求示例:
POST 你的回调地址
Content-Type: application/json
{
"utr": "5656565656",
"payment_status": "success", //failed success pending
"merchant_order_id": "1111111111111111",
"order_id": "2222222222222",
"merchant_uid": "321000",
"order_amount": 100,
"pay_amount": 100,
"sign": "xxxxxxxxxxxxxxxxxxx",
}
收到参数处理返回:
成功返回 success
失败返回 wrong
4. 代付下单请求
请求URL:
POST /gw/api/order/payout
Request Format:
所有请求都应以 JSON 格式发送。
请求参数 (JSON Body):
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| merchant_uid | String | Yes | 商户UID |
| signature | String | Yes | 签名 |
| merchant_order_id | String | Yes | 商户单号唯一 |
| amount | Integer | Yes | 金额 |
| account | String | Yes | 卡号 |
| ifsc_code | String | Yes | IFSC |
| customer_name | String | Yes | 姓名 |
| notify_url | String | Yes | 回调地址 |
请求示例:
POST https://jueapi.gwpay.org/gw/api/order/payout
{
"merchant_uid": "9001",
"amount": "100",
"merchant_order_id": "123456",
"account": "456456",
"ifsc_code": "SDSS84545101",
"customer_name": "Yuis ds",
"notify_url": "http://xxxx.com/notify",
"signature": "xxxxxxxxxxxxxx"
}
成功返回:
{
"code": 0,
"message": "pending",
"order_id": "TransactionId",
}
失败返回:
{
"code": 5001,
"message": "reason",
}
5. 代付查单接口
请求URL:
POST /gw/api/order/payout/query
Request Format:
所有请求都应以 JSON 格式发送。
请求参数 (JSON Body):
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| merchant_uid | String | Yes | 商户UID |
| signature | String | Yes | 签名 |
| merchant_order_id | String | Yes | 商户单号 |
请求示例:
POST https://jueapi.gwpay.org/gw/api/order/payout/query
Content-Type: application/json
{
"merchant_uid": "9001",
"merchant_order_id": "1234567890",
"signature": "xxxxxxxxxxxxxx"
}
成功返回:
{
"code": 0,
"message": "success",
"utr": "5656565656",
"payout_status": "success", //订单状态:success=成功,pending=处理中,failed=失败 ,reversal=冲正
"order_id": "2222222222222",
"amount": 100,
}
失败返回:
{
"code": 5001,
"message": "reason"
}
返回参数说明:
| 参数 | 类型 | 描述 |
|---|---|---|
| code | Int | 响应状态:0=成功,其他失败 |
| message | String | 描述 |
| payout_status | String | 订单状态:success=成功,pending=处理中,failed=失败 ,reversal=冲正 |
| order_id | String | 平台单号 |
| amount | int | 金额 |
| utr | String | UTR |
6. 代付回调通知
请求URL:
POST 你的回调地址
Request Format:
所有请求都应以 JSON 格式发送。
请求参数 (JSON Body):
| 参数 | 类型 | 描述 |
|---|---|---|
| payout_status | String | 订单状态:success=成功,pending=处理中,failed=失败 ,reversal=冲正 |
| merchant_uid | String | 商户UID |
| order_id | Integer | 平台单号 |
| merchant_order_id | String | 商户单号 |
| order_amount | int | 金额 |
| utr | String | UTR |
| message | String | 描述 |
| sign | String | 签名 |
请求示例:
POST 你的回调地址
Content-Type: application/json
{
"utr": "5656565656",
"payout_status": "success",
"merchant_order_id": "1111111111111111",
"order_id": "2222222222222",
"merchant_uid": "9001",
"order_amount": 100,
"message": "success",
"sign": "xxxxxxxxxxxxxxxxxxxx"
}
收到参数处理返回:
成功返回 success
失败返回 wrong
7. 接口余额查询
请求URL:
POST /gw/api/balance/check
参数 (Body - JSON):
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| signature | String | Yes | 签名 |
| merchant_uid | String | Yes | 商户UID |
请求示例:
POST https://jueapi.gwpay.org/gw/api/balance/check
Content-Type: application/json
{
"merchant_uid": "30121212",
"signature":"xxxxxxxxxxxxxxxxxxx"
}
成功返回:
{
"balance": 0,
"code":0,
"message":"success"
}
失败返回:
{
"code":5001,
"message":"reason"
}
返回参数说明:
| 参数 | 类型 | 描述 |
|---|---|---|
| status | String | 响应状态:0=成功,其他失败 |
| message | String | 描述 |
| balance | Integer | 可用余额 |