Test Environment (UAT): https://uatmerchant.harsittradelink.com.np
Live Environment: https://merchant.harsittradelink.com.np
POST /api/v1/payment/initialize
{
"amount": 10,
"transaction_uuid": "abcd123",
"return_url": "http://test.com/payment/return",
"secret_key": "4d6c8e75-48f3-4e28-9e41-0112f9ce4cca"
}
| Field | Type | Description | Required |
|---|---|---|---|
| amount | Number | Total payment amount | Yes |
| transaction_uuid | String | Unique identifier for the transaction | Yes |
| return_url | String | URL to which the user will be redirected after payment | Yes |
| secret_key | String | API secret key provided by Harsit Trade Link | Yes |
{
"pidx": "88540de7-5516-4768-ae76-229148947be4",
"payment_url": "https://uatmerchant.harsittradelink.com.np/payment/view?pmt=88540de7-5516-4768-ae76-229148947be4",
"expires_at": "2025-07-24T08:36:36+00:00",
"expires_in": 1800
}
{
"success": false,
"message": "Missing required fields."
}
{
"success": false,
"message": "Invalid or inactive API key or user."
}
After the user completes (or cancels/fails) the payment, they are redirected to the return_url you provided during payment initialization. The system appends query parameters to the URL based on the result of the transaction.
GET http://test.com/payment/return?pidx=88540de7-5516-4768-ae76-229148947be4&amount=10&total_amount=10&status=success&txnId=YXUXLNOM&transaction_uuid=abcd123
GET http://test.com/payment/return?pidx=88540de7-5516-4768-ae76-229148947be4&amount=10&status=fail
| Parameter | Type | Description |
|---|---|---|
| pidx | String | Unique payment identifier |
| amount | Number | The amount involved in the transaction |
| total_amount | Number | Total amount paid (only present on success) |
| status | String | Indicates if the payment was success or fail |
| txnId | String | Transaction ID (only on success) |
| transaction_uuid | String | Original transaction UUID (only on success) |
pidx, amount, and status=fail are returned. Other fields like txnId and transaction_uuid are not included.
POST /api/v1/payment/check
{
"txnId": "YXUXLNOM",
"secret_key": "4d6c8e75-48f3-4e28-9e41-0112f9ce4cca"
}
| Field | Type | Description | Required |
|---|---|---|---|
| txnId | String | Unique transaction identifier | Yes |
| secret_key | String | API secret key provided by Harsit Trade Link | Yes |
{
"success": true,
"status": "success",
"amount": "10",
"txnId": "YXUXLNOM",
"payment_id": "88540de7-5516-4768-ae76-229148947be4",
"transaction_uuid": "abcd123",
"gateway": "eSewa"
}
{
"success": false,
"status": "fail"
}
| Code | Description |
|---|---|
| 400 | Bad Request - Missing parameters or invalid input |
| 401 | Unauthorized - Invalid or inactive API key |
| 404 | Not Found - The requested resource could not be found |
| 500 | Internal Server Error - Something went wrong on the server side |
To integrate this payment gateway with your WordPress site, you can download the plugin below:
Download WordPress Plugin