Native API Integration
Introduction
Create order after user scan the QRcode.
API Description
Request Method:POST
Request Path:open/api/scan/payment
Parameters
Request Parameters
Parameter | Sign | Mandatory | Type | Length | Description |
---|---|---|---|---|---|
appId | Y | Y | string | 64 | AppId is unique for merchant |
sign | N | Y | string | 256 | Sign |
merchantOrderNo | Y | Y | string | 64 | Merchant order number (must be unique) |
qrCode | Y | Y | string | 256 | QR Code string |
amount | Y | Y | string | 20 | Order amount |
currency | Y | Y | string | 20 | Fiat currency (unit of amount) |
userId | Y | Y | string | 64 | UserId is unique for user (email / phone number) |
userIp | Y | Y | string | 32 | User IP address |
callbackUrl | Y | Y | string | 128 | The address receiving order webhook |
customParam | N | N | string | 1024 | Custom fields |
└expireTime | N | N | int | Expire time in second | |
└returnUrl | N | N | string | The redirection address after the successful purchase | |
└cancelUrl | N | N | string | The redirection address after the order cancel | |
└goods | N | N | object | Goods information | |
└─goodsId | N | N | object | Goods ID | |
└─goodsName | N | N | int | Goods name | |
└─goodsDesc | N | N | string | Goods description |
Example
{
"appId": "TEST000001",
"sign": "TEST000001",
"merchantOrderNo": "11126",
"amount": "100000",
"currency": "VND",
"feeType","INNER_BUCKLE",
"qrCode": "00020101021138580010A000000727012800069704070114190360421800120208QRIBFTTA53037045802VN830084006304EDC5",
"userId": "505*****78@qq.com",
"userIp": "127.0.0.1",
"callbackUrl": "http://127.0.0.1:8022/open/api/callback",
"customParam": {
"expireTime": 360000,
"returnUrl": "http://www.kucoinpay.com/order/success",
"cancelUrl": "http://www.kucoinpay.com/order/cancel",
"goods": [
{
"goodsId": "1",
"goodsName": "Gift card",
"goodsDesc": "Gift card product"
}
]
}
}
Response Parameters
Parameter | Type | Description |
---|---|---|
success | boolean | Success |
error | boolean | Error |
code | long | Response code |
msg | string | Response message |
traceId | string | Trace id |
model | object | Response content |
Model Response Parameters
Parameter | Type | Description |
---|---|---|
requestId | string | The unique Merchant Trade No generated by merchants |
payOrderId | string | KuCoin Pay unique order ID |
expireTime | string | Order expiration time |
qrcode | string | QR code image link |
appPayUrl | string | Checkout page URL hosted by KuCoin Pay |
Example
{
"code": "0",
"msg": "success",
"model":{
"requestId": "0a5f77dd-5679-48d1-8872-2fb9a35cc969",
"payOrderId": "kpt_2024120306484849000911110112",
"expireTime": 1733210327961,
"qrcode": "https://nginx-web-01.sit.kucoin.net/pay/checkout/kpt_2024120306484849000911110112",
"appPayUrl": "https://nginx-web-01.sit.kucoin.net/pay/checkout/kpt_2024120306484849000911110112"
},
"traceId": "6668024eeb989c77a375967aded5d646",
"success": true,
"error": false
}
Updated 3 days ago