Harsit Trade Link Payment Gateway API Documentation

Base URLs

Test Environment (UAT): https://uatmerchant.harsittradelink.com.np

Live Environment: https://merchant.harsittradelink.com.np

1. Payment Processing

Endpoint:

POST /api/v1/payment/initialize

Request Body

{
  "amount": 10,
  "transaction_uuid": "abcd123",
  "return_url": "http://test.com/payment/return",
  "secret_key": "4d6c8e75-48f3-4e28-9e41-0112f9ce4cca"
}

Parameters

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

Response

Success Response

{
  "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
}

Field Missing Response

{
  "success": false,
  "message": "Missing required fields."
}

Invalid Key Response

{
  "success": false,
  "message": "Invalid or inactive API key or user."
}

2. Payment Return Callback (Success & Fail)

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.

Success Example:

GET http://test.com/payment/return?pidx=88540de7-5516-4768-ae76-229148947be4&amount=10&total_amount=10&status=success&txnId=YXUXLNOM&transaction_uuid=abcd123

Failure Example:

GET http://test.com/payment/return?pidx=88540de7-5516-4768-ae76-229148947be4&amount=10&status=fail

Query Parameters

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)
Note: On failure, only pidx, amount, and status=fail are returned. Other fields like txnId and transaction_uuid are not included.

3. Payment Check (Lookup)

Endpoint:

POST /api/v1/payment/check

Request Body

{
  "txnId": "YXUXLNOM",
  "secret_key": "4d6c8e75-48f3-4e28-9e41-0112f9ce4cca"
}

Parameters

Field Type Description Required
txnId String Unique transaction identifier Yes
secret_key String API secret key provided by Harsit Trade Link Yes

Response

Success Response

{
  "success": true,
  "status": "success",
  "amount": "10",
  "txnId": "YXUXLNOM",
  "payment_id": "88540de7-5516-4768-ae76-229148947be4",
  "transaction_uuid": "abcd123",
  "gateway": "eSewa"
}

Fail Response

{
  "success": false,
  "status": "fail"
}

Error Codes

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

WordPress Plugin

To integrate this payment gateway with your WordPress site, you can download the plugin below:

Download WordPress Plugin
Note: Please make sure to test in the UAT environment before moving to the live environment for production use.