Integrate NationalPay Payment Gateway into your website or application using our secure REST APIs. Create payment orders, receive webhook notifications and manage transactions with ease.
Integrate NationalPay Payment Gateway within minutes.
Use your API Key to create payment orders.
| Base URL | https://gateway.nationalpay.co/api |
|---|---|
| Request Type | POST |
| Content-Type | application/json |
Every request requires your API Key.
apikey : YOUR_API_KEY
Endpoint
https://gateway.nationalpay.co/api/pg/create-request
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | String | Yes | Your API Key |
| mobile | String | Yes | Customer Mobile Number |
| amount | Decimal | Yes | Payment Amount |
| request_id | String | Yes | Unique Request ID |
| redirect_url | URL | Yes | Customer Redirect URL |
| remark1 | String | No | Optional |
| remark2 | String | No | Optional |
{
"apikey":"YOUR_API_KEY",
"mobile":"9876543210",
"amount":"100",
"request_id":"ORD10001",
"redirect_url":"https://yourwebsite.com/payment-response",
"remark1":"Test",
"remark2":"Demo"
}
{
"status":true,
"message":"Request Created Successfully",
"result":{
"request_id":"ORD10001",
"payment_url":"Payment_link"
}
After the payment status changes, NationalPay sends a POST request to your configured webhook URL.
{
"status": true,
"order_id": "ORD123456",
"amount": "100.00",
"utr": "123456789012",
"status_text": "SUCCESS"
}
{
"status": false,
"order_id": "ORD123456",
"amount": "100.00",
"status_text": "FAILED"
}
Endpoint
https://gateway.nationalpay.co/api/pg/payout/create-request
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | String | Yes | Your API Key |
| request_id | String | Yes | Unique Request ID |
| mobile | String | Yes | Customer Mobile Number |
| amount | Decimal | Yes | Payout Amount |
| holder_name | String | Yes | Beneficiary Name |
| bank_name | String | Yes | Beneficiary Bank Name |
| account_number | String | Yes | Beneficiary Account Number |
| ifsc | String | Yes | Bank IFSC Code |
{
"apikey":"YOUR_API_KEY",
"request_id":"PAYOUT10001",
"mobile":"XXXXXXXXXX",
"amount":"500",
"holder_name":"XXXXXXXX",
"bank_name":"State Bank of India",
"account_number":"XXXXXXXX",
"ifsc":"XXXXXXXX"
}
{
"success":true,
"message":"The payout request has been successfully initiated.",
"amount":"1000",
"request_id":"PAYOUT10001",
"transaction_id":"TXN20260708123456"
}
NationalPay sends a callback whenever the payout status changes.
{
"status": true,
"message": "Payout successful. The amount has been transferred.",
"data": {
"status": "success",
"request_id": "PAYOUT10001",
"transaction_id": "TXN20260708123456",
"amount": 500.00,
"charge": 10.00,
"total_amount": 510.00,
"transfer_mode": "IMPS",
"utr": "123456789012"
}
}
{
"status": false,
"message": "Payout failed.",
"data": {
"status": "failed",
"request_id": "PAYOUT10001",
"transaction_id": "TXN20260708123456",
"amount": 500.00,
"charge": 10.00,
"total_amount": 510.00,
"transfer_mode": "IMPS",
"utr": null
}
}
The following error codes may be returned by the NationalPay API.
| HTTP Code | Status | Message |
|---|---|---|
| 200 | Success | Request Created Successfully |
| 401 | Unauthorized | Invalid API Key |
| 404 | Not Found | Order Not Found |
| 422 | Validation Failed | Required parameters missing or invalid. |
| 500 | Server Error | Internal Server Error. |
Contact our technical team for API integration assistance.