Click Pay ApiClick Pay Api
  • en-US
  • 简体中文
  • en-US
  • 简体中文

Version1.0.0


Before You Start

1️⃣ Basic Information

ItemDetails
BaseURLhttps://pay.clickpay.lol
Response Formatapplication/json
Time UnitUnix Timestamp (seconds)
Array Sort OrderAscending by time (earlier first)

2️⃣ Common Status Codes

HTTP CodeMeaning
200Request succeeded
400Invalid request parameters or headers
401Access denied
403Invalid signature
404Request URL not found
500Internal system error
503Business failure (check business error code returned)

3️⃣ Error Response Format

{
    "code": "Error Code",
    "message": "Error Message"
}

4️⃣ API Rate Limits and Timeouts

ItemRule
PayIN API rate limit150 requests per second per merchant, with a burst capacity of 150 requests
Payout API rate limit60 requests per second per merchant, with a burst capacity of 60 requests
PayIN API timeout60 seconds
Payout API timeout60 seconds
Merchant callback timeout10 seconds each for connection, read, and write

If a PayIN or Payout request takes unusually long, treat it as an exception and contact support with the relevant request and order details. The callback is the authoritative source of the final transaction result.


5️⃣ Security Mechanism - Signature Verification Rules

📌 General Instructions

  • All requests must include a signature in the header.
  • Header parameter name: Signature
  • Header names are case-insensitive; Base64 signature values are case-sensitive and must not be modified.
  • Merchant: sign with private key.
  • Platform: signs returned data with private key, merchant verifies with platform's public key.

Use lowercase hexadecimal SHA-512 digests and RSA PKCS#1 v1.5. Serialize JSON once and sign the exact UTF-8 bytes sent over HTTP. Never sort, format or re-serialize a received callback before verification. See the shared contract in each language example for supported key formats and diagnostic logging.


📌 Signature Algorithm Process

POST / PUT Requests
1️⃣ SHA512 body content -> Digest A
2️⃣ Concatenate path + Digest A + timestamp -> Text B
3️⃣ Use RSA private key to sign Text B with SHA512withRSA
GET / DELETE Requests
1️⃣ No body, Digest A is an empty string
2️⃣ Concatenate path + Digest A + timestamp -> Text B
3️⃣ Use RSA private key to sign Text B with SHA512withRSA

📌 Required Headers

Header NameDescription
TimestampCurrent timestamp (seconds)
Merchant-CodeMerchant Code
SignatureSignature value

6️⃣ API Example: Place Order API

Request URL

POST /v1/merchant/pay

Header Example

HeaderValue
Merchant-Code003
Timestamp1699447297
Signature[Signature String]

Request Parameters (JSON Body)

{
    "amount": "2",
    "method": "gee",
    "phone": "1",
    "name": "1",
    "merchantSerialNo": "T1699447296",
    "remark": "1",
    "email": "1"
}

Signature Example Process (Pseudo Code)

Step 1: SHA512 Digest A
    {"amount":"2","method":"gee",...} -> Digest A = 7e28... (128 lowercase hex characters, no timestamp)

Step 2: Concatenate
    /v1/merchant/pay + Digest A + timestamp
    -> /v1/merchant/pay7e28...1699447297

Step 3: RSA Signature
    SHA512WithRSA(concatenated result) -> signature result

curl Example

curl -X POST 'https://pay.clickpay.lol/v1/merchant/pay' -H "Content-Type: application/json" -H "Merchant-Code: 003" -H "Timestamp: 1699447297" -H "Signature: [signature]" -d '{"amount":"2","method":"gee","phone":"1","name":"1","merchantSerialNo":"T1699447296","remark":"1","email":"1"}'

Success Response

{
    "code": 0,
    "msg": null,
    "sign": "[returned signature]",
    "timestamp": "1699448046",
    "data": {
        "merchantId": "618918202310181957279",
        "merchantSerialNo": "T1699447296",
        "method": "gee",
        "amount": 2,
        "transactionId": "6189182023110820540519",
        "payUrl": "https://openapi.kypays.com/pix/6189182023110820540519",
        "fee": "0.42000000",
        "status": "10",
        "payData": {"qrcode":"000201..."}
    }
}

7️⃣ API Example: Query Balance

📍 Request URL

GET /v1/merchant/account

📌 Header Example

HeaderValue
Merchant-Code003
Timestamp1699447297
Signature[Signature]

🔐 Signature Process Example (Pseudocode)

Step 1: Parameter string (empty for GET without query params)
  paramStr = ""

Step 2: Construct the string to sign
  /v1/merchant/account + paramStr + Timestamp
  -> /v1/merchant/account1699447297

Step 3: Generate RSA signature using SHA512WithRSA
  Signature = SHA512WithRSA(concatenated string)

🧪 curl Example

curl -X GET 'https://pay.clickpay.lol/v1/merchant/account' \
  -H "Merchant-Code: 003" \
  -H "Timestamp: 1699447297" \
  -H "Signature: [Signature]"

✅ Successful Response

{
    "code": 0,
    "sign": "[Response Signature]",
    "timestamp": "1699448200",
    "data": {
        "currency": "[currency]",
        "id": "263940537239867393",
        "memberId": "618918202501161501465",
        "memberCode": "UPITEST",
        "memberName": "UPITEST",
        "accountType": "11",
        "cash": 112.0,
        "freeze": 0.0,
        "security": 0.0,
        "unSettlement": 0.0,
        "credit": 0.0,
        "createTime": "2025-01-16 15:01:46"
    }
}

8️⃣ Platform Callback Signature Rules ✅ (Important)

⚠️ Different from request signatures: callback signatures do not include the path, only the digest + timestamp are concatenated

📌 Signature Algorithm (Platform → Merchant)

1️⃣ Compute SHA512 of the callback Body -> Digest A  
2️⃣ Concatenate Digest A + Timestamp (from Header)  
3️⃣ Use the platform's RSA private key to sign the concatenated string using SHA512withRSA  

📌 Header Example

HeaderValue
Timestamp1699447297
Signature[Signature Value]

📌 Body Example

{
    "merchantId": "618918202310181957279",
    "merchantSerialNo": "T1699447296",
    "method": "gee",
    "amount": 2,
    "transactionId": "6189182023110820540519",
    "payUrl": "https://openapi.kypays.com/pix/6189182023110820540519",
    "fee": "0.42000000",
    "status": "10"
}

📌 Signature Procedure Example

Step 1: SHA512 Digest A  
    -> 7e28...

Step 2: Concatenate  
    7e28... + 1699447297

Step 3: Sign  
    SHA512withRSA(concatenated string) -> Signature Value

📌 Merchant Verification Process

After receiving the callback, the merchant should:

  1. Extract the callback JSON Body, and compute the SHA512 digest using UTF-8 encoding.
  2. Concatenate the digest with the Timestamp from the Header.
  3. Use the platform's public key and SHA512withRSA to verify the signature.

9️⃣ RSA Key Example

The complete runnable Python callback verification example includes a test platform public key, raw body, Timestamp, Signature and expected output. No private key is required to verify it.

The example uses a 2048-bit test key and a 256-byte Base64-decoded signature; it is not the production platform public key. Use the platform public key from the corresponding merchant account, not the merchant public key. A 1024-bit public key does not match a 256-byte signature; changing key formatting cannot resolve that mismatch.


🔟 Signature Value Reference Table

StepExample Value
SHA512 Digest A7e28... (128 lowercase hex characters)
RSA SignatureHpPa41g0aK4zP...==

11. Code Examples

Java Integration Guide

For detailed SDK integration methods and sample code, please refer to the Java Example Documentation.

PHP Integration Guide

For detailed SDK integration methods and sample code, please refer to the PHP Example Documentation.

C# Integration Guide

For detailed SDK integration methods and sample code, please refer to the C# Example Documentation.

Go Integration Guide

For detailed SDK integration methods and sample code, please refer to the Go Example Documentation.

Python Integration Guide

For detailed SDK integration methods and sample code, please refer to the Python Example Documentation.

Node.js Integration Guide

For detailed SDK integration methods and sample code, please refer to the Node.js Example Documentation.


Public API Parameters

Enum Definitions

Order Status

Parameter Name (status)

Payment

StatusDescription
00Pending merchant matching
10Awaiting payment
11Payment in progress
12Payment timeout
20Payment completed
30Payment refunded
31Payment failed

Payout

StatusDescription
00Pending Merchant Match
10Pending Processing
11Pending Payout
12Payout in Progress
20Payout Completed
30Payout Refunded
31Payout Failed
Fee Types

Parameter Name (feeType)

Fee TypeDescription
0Deducted from payout amount
1Deducted from balance

Collection Payment Methods

Parameter Name (method)

Payment MethodDescription
QRQR Code
TRANSFERBank Transfer

Payout Payment Methods

Parameter Name (method)

Payment MethodDescription
BANKBank Transfer
WALLETWallet Payment

Collection

Place Order

POST /v1/merchant/pay

Request

{
  "amount": "500",
  "method": "QR",
  "phone": null,
  "name": "1",
  "merchantSerialNo": "T1699447296",
  "remark": "1",
  "description": "1",
  "title": "1",
  "email": null
}

Parameter List

Parameter NameTypeNullableDescription
amountstringNoAmount
methodstringNoSee enum Payment Methods
phonestringYesPhone number
namestringNoName
merchantSerialNostringNoMerchant order number
remarkstringYesRemark
titlestringYesTitle
descriptionstringNoDescription
emailstringYesEmail address
notifyUrlstringYesCallback URL. If this value is not empty, the callback will be sent to this URL; otherwise, it will be sent to the callback address configured in the backend.
redirectUrlstringYesRedirect URL. If this value is not empty, the user will be redirected to this URL after payment is completed.
directConnectbooleanYesDirect connect flag. true = direct connect, false = non-direct (default false).

Response

{
    "code": 0,
    "sign": "glOvHa8zstiAG6/6fZ/fhECYH64j4rdFj9uHW9qks5Vvdke1imEvmeMcImDrb1l+EDFYrGV/ovJ5SuEnmPZtmy1Gyeh1f3NlL9Y5N/PKvlMZn9CrGEmRHwn2hzFuNuYiYCHbYwPr2e5llMpojGF/ySNvUvPJXD7G3ouLQdSSIUE=",
    "timestamp": "1754387547",
    "data": {
        "merchantCode": "M",
        "currency": "myr",
        "merchantSerialNo": "74769685-b602-4a85-a306-1c64aa627e22",
        "method": "QR",
        "amount": 500,
        "transactionId": "122",
        "payUrl": "https://cashier2.clickpay.lol/pay/v1/idr/php/122"
        "fee": 60.0,
        "status": "10"
    }
}

Parameter List

Parameter NameTypeNullableDescription
codeintNoSee error codes
msgstringYesError message
signstringYesSignature
timestampstringYesTimestamp
dataobjectYesOrder data

data

Parameter NameTypeNullableDescription
merchantSerialNostringNoMerchant order number
methodstringNoPayment method
amountstringNoAmount
transactionIdstringNoPlatform transaction ID
payUrlstringYesPayment URL
statusstringNoSee enum Order Status; must check status as network delays may affect polling
feestringNoFee
payDataobjectNoPayment data

Query Collection Order

POST /v1/merchant/pay/order/info

Request

{
  "transactionId": "61891820250719160658208575",
  "merchantSerialNo": "T1699447296"
}

Parameter List

Parameter NameTypeNullableDescription
transactionIdStringYesPlatform Order ID, at least one of the two must be provided
merchantSerialNoStringYesMerchant Order ID

Response

{
  "code": 0,
  "sign": "DKeoiWNFEByMQsRFix2dC7f7jA8GGXQOBTYVsRpmYtJXMA/Vd5j06M74Q23215kwjuuzBWRfiiQbZDKNq/kJRz1WMpsomyCL/TKsqzAhMX7JBXWCGYLql5WS0sIG2pNB4mSxKUVtOxqErEUf8V4e1ozrQBHfdtydDueegGK+rjUaQGLSM/KzPygwDN6X0n/egN1rYQwJ6yfafwAIDVH7cW3hrnzG0b2UToC6SaxWsxCRnGh2JUsHgT+xfrzjwtROSq311tuxLlNtu4nFTacyvk7xlYsF+NZKgeMe5RAzvFU1eAxncuqqqCrOyIGiOGZHjFlJmCmoiHmNb2bxgYieDg==",
  "timestamp": "1737088697",
  "data": {
    "merchantId": "618918202501161501465",
    "merchantSerialNo": "T1737088694387",
    "method": "[method]",
    "amount": 200,
    "orderAmount": 200,
    "transactionId": "61891820250117123815588",
    "payUrl": "https://h5.simplypay.vip/payment/d1bab78392a941d4b4f570dbd0728303?cashUrl=https://pay.wepaytm.xyz/upi/checkout/4I6w",
    "fee": 20.0,
    "status": "10"
  }
}

Parameter List

Parameter NameTypeNullableDescription
codeintNoSee Error Codes
msgstringYesError Message
signstringYesSignature
timestampstringYesTimestamp
dataobjectYesOrder Data

data Fields

Parameter NameTypeNullableDescription
merchantSerialNostringNoMerchant Order No.
methodstringNoPayment Method
amountstringNoActual paid amount
orderAmountstringNoOrder amount
transactionIdstringNoPlatform Order ID
payUrlstringNoPayment URL
payDatastringYesPayment Content
statusstringNoSee enum Order Status
feestringNoService Fee
channelBankSerialNostringYesBank Transaction No.
messagestringYesFailure Reason

Collection Asynchronous Notification

POST to the merchant's configured collection callback URL

Request

HEADERS

ParameterDescription
SignatureSignature
TimestampTimestamp

BODY

{
  "transactionId": "2",
  "amount": "1",
  "orderAmount": "1",
  "method": "gee",
  "currency": "",
  "merchantSerialNo": "T1699447296",
  "status": "20",
  "payUrl": "http://",
  "fee": "0.1"
}

Parameter List

Parameter NameTypeNullableDescription
merchantSerialNostringNoMerchant Order No.
methodstringNoPayment Method
currencystringNoCurrency
amountstringNoActual paid amount
orderAmountstringNoOrder amount
transactionIdstringNoPlatform Order ID
payUrlstringNoPayment URL
statusstringNoSee enum Order Status
feestringNoService Fee
channelBankSerialNostringYesBank Transaction No.
messagestringYesFailure Reason

Response

SUCCESS

Merchants must return SUCCESS. The first notification is sent immediately. Failed notifications are checked again every 60 seconds, with a maximum of 10 delivery attempts in total.

Payout

Place Order

POST /v1/merchant/payout

Request

{
  "bankCode": "affinbank",
  "bankName": "AffinBank",
  "amount": "2",
  "method": "BANK",
  "bankCard": "03123456789",
  "accountEmail": null,
  "accountMobile": null,
  "accountName": "1",
  "merchantSerialNo": "T1701344062",
  "bankName": "1",
  "remark": "1",
  "feeType": "1"
}

Parameter List

ParameterTypeNullableDescription
amountstringNoAmount
methodstringYesSee the enum Payment Method
bankCodestringYesBank code. See Bank List
bankCardstringNoBank withdrawal account
accountMobilestringYesPhone number
accountEmailstringYesEmail address
accountNamestringNoAccount name
bankNamestringNoBank name, can be a fixed value
merchantSerialNostringNoMerchant order number
remarkstringYesRemark
feeTypestringNoSee enum Fee Type
notifyUrlstringYesCallback URL; if not empty, callback will be sent here, otherwise to the default backend callback URL

Response

{
  "code": 0,
  "msg": null,
  "sign": "jTY5Z021R2J/ixsi1t6P4+sH0XoZ4La4YMEFTYe5MlxoEn5s4xcRwv4oZAM5Nk/+lqWyVSRCpKbqzCsyAFo27duJ+MxvzCyIweDSV1tDnyQ42j8IhaAoo61bSVHbmMS2UFMX0wCpiyFLyE0VsAza3hsqYk2Ad0RK043xsasyOrP3PA0x2LLdbY3XauW/Lh9U6VJ6yJyL646inPQ1WmahtZr2bWiL/ueTephTdv/JljwzphyJ3gnrm4a0F9lgMXQX8eborvMhhEQBPYYhpq6trxZ4nOmDQuTx/rHK3WlgTm19VY/IqxZtRcs368qQVe+gFuF3pgyjB4+M9bR5npRQ7w==",
  "timestamp": "1701344063",
  "data": {
    "merchantId": "618918202310181957279",
    "merchantSerialNo": "T1701344062",
    "method": "BANK",
    "amount": 2,
    "transactionId": "618918202311301934237",
    "fee": "10.20000000",
    "status": "10"
  }
}

Parameter List

ParameterTypeNullableDescription
codeintNoSee error codes
msgstringYesError message
signstringYesSignature
timestampstringYesTimestamp
dataobjectYesOrder data

data

ParameterTypeNullableDescription
merchantSerialNostringNoMerchant order number
methodstringNoPayment method
amountstringNoAmount
transactionIdstringNoPlatform order number
statusstringNoSee enum Order Status
feestringNoFee

Query Payout Order

POST /v1/merchant/payout/order/info

Request

{
  "transactionId": "61891820250719160658208575",
  "merchantSerialNo": "T1699447296"
}

Parameter List

Parameter NameTypeNullableDescription
transactionIdStringYesPlatform Order ID, at least one of the two must be provided
merchantSerialNoStringYesMerchant Order Number

Response

{
  "code": 0,
  "msg": null,
  "sign": "dZMsjIJd5JrH660JZVKmc3XTwnNOV9WxvvMcuMqIMmbdDXjYUXENL7vshZU965ilkBniBVs2MJEkpz3irB6CaiT7oCY/HirQXrzOrF4csxeBz00sr0fZr+Mv0lWRSgS4CS8ppMB9IYkwuzp8c7gEsRVIV/DaEX3nUdwCPRM1rqKK3M2QvRUvZYHuhof0ewfMRDs5CwTS5s8WL63z2wzChsM0Op5bidG8+Xfdzw8s9x0cphwa4kY8YG4tPfqJy7tcEi0JJerImjGfUyRWX8xR0dU9krwOyKCL5oh+y5eCnF4yKO5BLvQ9RHdz5vZxZc+nkfuXghmN4KmtZzj/Rr/PPw==",
  "timestamp": "1701350818",
  "data": {
    "merchantId": "618918202310181957279",
    "merchantSerialNo": "T1701348703",
    "method": "BANK",
    "amount": 2.0,
    "transactionId": "618918202311302051438",
    "fee": "10.20000000",
    "status": "10"
  }
}

Parameter List

Parameter NameTypeNullableDescription
codeintNoSee error codes
msgstringYesError message
signstringYesSignature
timestampstringYesTimestamp
dataobjectYesOrder data

data Fields

Parameter NameTypeNullableDescription
merchantSerialNostringNoMerchant Order Number
methodstringNoPayment Method
amountstringNoAmount
transactionIdstringNoPlatform Order Number
statusstringNoSee enum Order Status
feestringNoFee
channelBankSerialNostringYesBank transaction number
messagestringYesFailure Reason

Payout Asynchronous Notification

POST to the merchant-configured payout callback URL

Request

HEADERS

ParameterDescription
SignatureSignature
TimestampTimestamp

BODY

{
  "transactionId": "2",
  "amount": "1",
  "currency": "",
  "method": "BANK",
  "merchantSerialNo": "T1699447296",
  "status": "20",
  "fee": "0.1"
}

Parameter List

Parameter NameTypeNullableDescription
merchantSerialNostringNoMerchant order number
methodstringNoPayment method
currencystringNoCurrency
amountstringNoAmount
transactionIdstringNoPlatform order number
statusstringNoSee enum Order Status
feestringNoFee
channelBankSerialNostringYesBank transaction number
messagestringYesFailure reason

Response

SUCCESS

The merchant must return SUCCESS. The first notification is sent immediately. Failed notifications are checked again every 60 seconds, with a maximum of 10 delivery attempts in total.


Query Balance

GET /v1/merchant/account

Response

{
  "code": 0,
  "sign": "C3i5JNPU7KLXOM8tWlbJM9pPmeHJ2ciE60VbTJBbfDhK+5hUEDOeqa32yYUX9m7hIgrNIj12Y8SNKctSxB5pw9BVUr2FzDrEb0DY8ppSuQ20KieLXX2xyxXmEAh288I1ikHlO36eWr7u/Plpi/3FEMnLGtHd8ma5T/hz86XIY41a7VwJUvEhwpihASUd4fYtqSRoI+9bFjuC6d92yfpyXo+i/M43lezLSbhOBJnj1pDjF3iBPZVbszOPIK+tsbZjdWPP+SjT59lCMjKtkCAtY/tO7/NQB69Yz/LrS3ar7Z1/Qzo+GYdikCqpi+oCDDZjVgE9IQRuw25NCm+yo5v9hw==",
  "timestamp": "1737090710",
  "data": {
    "currency": "[currency]",
    "id": "263940537239867393",
    "memberId": "618918202501161501465",
    "memberCode": "UPITEST",
    "memberName": "UPITEST",
    "accountType": "11",
    "cash": 112.0,
    "freeze": 0.0,
    "security": 0.0,
    "unSettlement": 0.0,
    "credit": 0.0,
    "createTime": "2025-01-16 15:01:46"
  }
}

Parameter List

Parameter NameTypeNullableDescription
codeintNoSee error codes
msgstringYesError message
signstringYesSignature
timestampstringYesTimestamp
dataobjectYesBalance data

data fields:

Parameter NameTypeNullableDescription
currencystringNoCurrency
cashstringNoCash balance
freezestringNoFrozen balance
unSettlementstringNoPending settlement balance

Bank List

Bank CodeBank Name
affinbankAffinBank
agrobankAgroBank
alliancebankAlliance Bank
ambankAmBank
bimbBank Islam Malaysia
bsnBSN
cimbCIMB
hongleongbankHong Leong Bank
maybankMaybank
mbsbMBSB
publicbankPublic Bank
rhbRHB
uob_myUOB Malaysia
bankrakyatBank Rakyat
ocbc_myOCBC Bank
hsbcHSBC

Wallet List

Wallet CodeWallet Name
touchngoTouch 'n Go

Error Code List

Error CodeDescription
0Success
400Invalid Request Parameters
1000Insufficient User Balance
403Signature verify failure
500Internal server error, please contact administrator.
9999Unknown exception
9000Invalid parameter
9002Unauthorized access
9008Duplicate request
8000Merchant is frozen
8001Merchant does not support this payment method
8003The requested payment method or amount is not supported. Use the documented method value with the exact case and no leading or trailing spaces, and check that amount meets the requirements of your enabled payment service. If both are correct, contact support.

Last Updated: 10/23/26, 7:33 AM
Contributors: aa, Copilot, aaa