Webhooks
Webhooks are server callbacks to your server from Instantpay. Webhooks are event-based and are sent when specific events related to the transaction happen.
Configuration Steps
The Webhook is called after the transaction has been done. It reports the status of the transaction. In case of a pending transaction, final result of the transaction will also be reported on this Webhook once it is settled.
Step 1 -Please create a URL at your end on which we will hit a GET request with transaction parameters.
Step 2- Then login to Instantpay portal and Go to Developer APIs ➡️ Credentials and then click on Setup Webhook and enter the Webhook URL.
Step 3- For every callback, we expect a specific in response to the callback. The request and response structure is mentioned below.
Request Structure
https://<your-webhook-url>?ipay_id=ipay_id&agent_id=agent_id&opr_id=opr_id&status=status&res_code=res_code&res_msg=res_msg&txn_mode=txn_mode
Request Parameters
Params | Description |
---|---|
ipay_id | Unique transaction id generated in Instantpay's system |
agent_id | Unique transaction id given by the client at the time of transaction |
opr_id | Uniques transaction id from the service provider |
status | Status of the transaction. Possible values are SUCCESS, PENDING or REFUND |
res_code | Response Code |
res_msg | Response Message |
txn_mode | Possible values are DR for Debit from user wallet and CR for Credit in user wallet. |
Response Structure
{
"ipay_id": "1234567890",
"success": true,
"description": "callback called successfully"
}
Response Parameters
Params | Desription |
---|---|
ipay_id | echo back the ipay_id field value |
success | It will be true or false |
description | Remarks |
Important
We mark the callback as acknowledged when we receive the response with HTTP Code 2XX, success: true and ipay_id field is correctly echoed back.
If the callback is not acknowledged in 3 sec then we will be sending 5 request at an Interval of 5, 15, 30, 60 and 240 minutes at the configured URL.
"res_code":"TUP","res_msg":"Response Timedout please contact help desk #E1"
If you received above message in callback please check the final status from Instantpay Dashboard and take action accordingly.
Updated over 1 year ago