Authentication: Get Access Token
POST
/api/loginApi
Exchange your merchant credentials for a bearer token. Use this token in the Authorization: Bearer <token> header for subsequent API calls.
username(string, required)password(string, required)
Request
POST https://payment.kelantanpay.com/api/loginApi
Content-Type: application/json
{
"username": "merchant_username",
"password": "yourStrongPassword"
}
Successful response
{
"status": "true",
"description": "Successfully login",
"token": "eyJ0eXAiOiJKV1QiLCJh...example",
"code": 200
}
Notes
- Use the returned token as a bearer token for protected payment endpoints.
- Renew the token when it expires or when your API calls return 401.
- Keep credentials and tokens secure; never expose them in client-side code.
Try it (Postman-lite)
Response
// Response will appear here
Generate Payment
POST
/api/payment-generator
Create a payment session and receive a KelantanPay checkout URL to redirect the user.
Testing callbacks? Generate a bin at postb.in and paste the unique URL into returnurl and callbackurl to inspect the payloads.
token(string, required) — bearer from loginvia(string, required) —WeborAppamount(number, required)name,email,mobile,description,country,account,provider(required)userid,returnurl,callbackurl,ref_1,ref_2,ref_3(optional)
Request
POST https://payment.kelantanpay.com/api/payment-generator
Content-Type: application/json
{
"token": "your_login_token",
"via": "App",
"amount": 2,
"userid": "96080700000",
"name": "Test User",
"email": "testuser@example.com",
"mobile": "0123456789",
"description": "testing pembayaran",
"country": "MY",
"account": "432345",
"provider": "testing",
"returnurl": "https://yourapp.com/return",
"callbackurl": "https://yourapp.com/callback",
"ref_1": "",
"ref_2": "",
"ref_3": ""
}
Successful response
{
"status": "true",
"description": "No Error",
"url": "https://payment.kelantanpay.com/kelantanpay/96080700000/9ag3nssva60wsk0o40o8w80ocggook",
"reference": "96080700000",
"token": "9ag3nssva60wsk0o40o8w80ocggook",
"amount": 2,
"orderid": "KPAY25121110353048",
"code": 200
}
Try it
Response
// Response will appear here
KelantanPay Requery (direct DB)
GET
/api/kelantan-requery/{username}/{ref_no}
Fetch the transaction status directly from KelantanPay (not via iPay88) using the username and reference number you sent.
Paramsusername(path, required) — merchant usernameref_no(path, required) — reference you supplied when creating payment
Request
GET https://payment.kelantanpay.com/api/kelantan-requery/merchant_user/ORDER123
Example response
Notes
status: "00"— Payment successfulstatus: "11"— Payment pendingstatus: "22"— Payment failed- If you receive
"22"in early phase, retry the requery after a few seconds as the gateway may not have a pending status yet.
Try it
Response
// Response will appear here