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

ParameterSignMandatoryTypeLengthDescription
appIdYYstring64AppId is unique for merchant
signNYstring256Sign
merchantOrderNoYYstring64Merchant order number (must be unique)
qrCodeYYstring256QR Code string
amountYYstring20Order amount
currencyYYstring20Fiat currency (unit of amount)
userIdYYstring64UserId is unique for user (email / phone number)
userIpYYstring32User IP address
callbackUrlYYstring128The address receiving order webhook
customParamNNstring1024Custom fields
└expireTimeNNintExpire time in second
└returnUrlNNstringThe redirection address after the successful purchase
└cancelUrlNNstringThe redirection address after the order cancel
└goodsNNobjectGoods information
└─goodsIdNNobjectGoods ID
└─goodsNameNNintGoods name
└─goodsDescNNstringGoods 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

ParameterTypeDescription
successbooleanSuccess
errorbooleanError
codelongResponse code
msgstringResponse message
traceIdstringTrace id
modelobjectResponse content

Model Response Parameters

ParameterTypeDescription
requestIdstringThe unique Merchant Trade No generated by merchants
payOrderIdstringKuCoin Pay unique order ID
expireTimestringOrder expiration time
qrcodestringQR code image link
appPayUrlstringCheckout 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
}