What is a webhook URL?
Webhooks are user defined HTTP callbacks. Instamojo uses them to inform the merchant about every successful or a failed transactions using a server side call (POST request) or webhook. Webhook request is an asynchronous request which means you don’t have to trigger it. After a successful or a failed transaction Instamojo will POST the transaction details to the webhook URL you may have configured.
Notes:
1. The webhook request is request with content-type application/www-form-urlencoded. Don't try to handle it like a JSON request.
2. The POST view you're using to handle this webhook request must not expect a CSRF token, otherwise it is not going to work(CSRF is enabled by default in most of the frameworks).
We have mentioned the parameters below which are sent using a webhook:
Key |
Description |
amount |
Amount related to the payment |
buyer |
Buyer's email |
buyer_name |
Buyer's name |
buyer_phone |
Buyer's phone number |
currency |
Currency related to the payment |
fees |
Fees charged by Instamojo |
longurl |
URL related to the payment request |
mac |
Message Authentication code of this webhook request |
payment_id |
ID of the payment |
payment_request_id |
ID of the payment request |
purpose |
Purpose of the Payment request |
shorturl |
Short URL of the payment request |
status |
Status of the Payment. This can be either "Credit" or "Failed". |
This list of keys will get updated over time. So when you are integrating, we recommend you to account for new keys that will be added to this.