API Reference
Log In

Webhooks allow you to get notified of events that happen on Instamojo.

For example, when a buyer makes payment, Instamojo can send an HTTP POST request to your server. This avoids the need to keep polling Instamojo servers for updates.

A webhook is not a redirect. The buyer or the browser will never see it. Its a communication channel between Instamojo servers and your servers.

Here are some use cases where a webhook might be useful:

  1. Sending a custom email from your server at the end of every transaction
  2. Activation of a user's account on your service
  3. Sending a user the license key to your software
  4. Adding a user to your CRM software
  5. Adding the transaction to your accounting software

By default, a webhook is sent only on successful payments, but can be enabled
for failures too. Please get in touch with [email protected] for the same.

A webhook URL should be an internet facing publicly accessible URL on your server, which accepts a POST request from instamojo.com. CSRF checks should be disabled and if the server is hosted over HTTPS, the SSL certificate should be valid and not expired. The URL should not have any kind of authentication.

We have a handy [https://www.instamojo.com/webhook-testing-tool/](webhook testing tool) which can be used to test your server. [https://requestb.in/](Request bin) is a useful service to explore the request sent by the server.

The webhook request is request with content-type application/www-form-urlencoded. Don't try to handle it like a JSON request.

The parameters for Payment requests are

KeyDescription
amountAmount related to the payment
buyerBuyer's email
buyer_nameBuyer's name
buyer_phoneBuyer's phone number
currencyCurrency related to the payment
feesFees charged by Instamojo
longurlURL related to the payment request
macMessage Authentication code of this webhook request
payment_idID of the payment
payment_request_idID of the payment request
purposePurpose of the Payment request
shorturlShort URL of the payment request
statusStatus of the Payment. This can be either "Credit" or "Failed".

NOTE: 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.