Webhooks vs APIs
Here is how webhooks compare to traditional API polling:Aspect | APIs | Webhooks
Data retrieval | Pull-based (you request) | Push-based (we send)
Timing | On-demand | Near real-time when events occur
Resource usage | Requires polling | Event-driven, efficientHow Razorpay Webhooks Work
When you subscribe to webhook events, Razorpay sends an HTTP POST request with JSON payload to your configured endpoint URL whenever those events are triggered. Suppose you have subscribed to theorder.paid webhook event, you will receive a notification every time a user pays you for an order, in the configured endpoint URL.
Use Cases
There can be multiple uses for webhook events. Two of these are listed below.Capturing Late Authorised Payments
Capturing payments for which you did not receive a response on the client-side is perhaps the most important use case for thepayment.authorized event.
Sometimes, the communication between the bank and Razorpay or between you and Razorpay may not occur. This could be because of a slow network connection or your customer closing the window while processing the payment. This could lead to a payment being marked as Failed on the Dashboard but changed to Authorized at a later time. Know more about late authorisation of payments.
You can use webhooks to get notified about payments that get authorised and analyse this data to decide whether to capture the payment or not.
Notifications on Failed Payments
When a payment attempted by your customer fails, we receive the failed payment status from the bank. This payment gets recorded in our system as Failed. Suppose you have enabled thepayment.failed webhook, you will receive a notification from us about the failed payment. You can then further analyse this payment and notify your customer about the failure.
Setup and Configuration
- You can set up webhooks from your Dashboard and configure separate URLs for Live mode and Test mode. Know more about setting up Payment webhooks and Payout webhooks.
- A Test mode webhook receives events for your test transactions. Know more about testing webhooks.
- Webhook URLs must use ports 80 or 443 only.
- Ensure Razorpay webhook IPs are whitelisted on your server. Even if your server accepts all incoming requests, webhooks may still be blocked by cloud security groups or network configurations. Refer to Razorpay IPs and Certificates for the complete list of webhook IP addresses.
Implementation ConsiderationsWebhooks are the primary and most efficient method for event notifications. They are delivered asynchronously in near real-time. For critical user-facing flows that need instant confirmation (like showing “Payment Successful” immediately), supplement webhooks with API verification.Recommended approach
- Rely on webhooks for all automation, which can be asynchronous.
- If a critical user-facing flow requires instant status, but the webhook notification has not arrived within the time mandated by your business needs, perform an immediate API Fetch call (Payments, Orders and Refunds) to verify the status.
Idempotency
There could be scenarios where your endpoint might receive the same webhook event multiple times. This is an expected behaviour based on the webhook design. To handle duplicate webhook events:1
You can identify the duplicate webhooks using the `x-razorpay-event...
You can identify the duplicate webhooks using the
x-razorpay-event-id header. The value for this header is unique per event.2
Check the value of `x-razorpay-event-id` in the webhook request hea...
Check the value of
x-razorpay-event-id in the webhook request header.3
Verify if an event with the same header is processed at your end.
Verify if an event with the same header is processed at your end.
Deactivation
All webhook responses must return a status code in the range2XX within a window of 5 seconds. If we receive response codes other than this or the request times out, it is considered a failure.
On failure, a webhook is re-tried at progressive intervals of time, defined in the exponential back-off policy, for 24 hours. If the failures continue for 24 hours, the webhook is disabled. You need to enable the webhook from the Dashboard after fixing the errors at your end. Know more about enabling Webhooks.
Handy Tips
Setup Webhooks
Watch this video to see how to set up a webhook. To set up webhooks:1
Log in to the Dashboard and navigate to **Accounts & Settings**.
Log in to the Dashboard and navigate to Accounts & Settings.
2
Click **Webhooks** under **Website and app settings**.
Click Webhooks under Website and app settings.
3
Click the **+ Add New Webhook** button.
Click the + Add New Webhook button.
- In the Webhook Setup pop-up page:
- Enter the URL where you want to receive the webhook payload when an event is triggered. We recommend using an HTTPS URL.
Handy Tips
- You can set up to 30 URLs to receive Webhook notifications. Webhooks can only be delivered to public URLs.
-
If your URL contains
razorpayas a domain, you will not be able to add the URL and will receive an error. -
If you attempt to save a localhost endpoint as part of a webhook setup, you will notice an error. Know more about testing Webhooks on an application running on localhost.
- Enter a Secret for the webhook endpoint. The secret is used to validate that the webhook is from Razorpay. Do not expose the secret publicly. Know more about how to validate webhooks.
Handy Tips
- When setting up the webhook, specify a secret. Use this secret to validate that the webhook is from Razorpay. Entering the secret is optional but recommended. The secret should never be exposed publicly.
-
The webhook secret does not need to be the Razorpay API key secret.
- In the Alert Email field, enter the email address to which the notifications should be sent in case of webhook failure. You will receive webhook related notifications like failures, deactivation and so on.
- Select the required events from the list of Active Events.
- Click Create Webhook. After you set up a webhook, it appears on the list of webhooks.
- You can select the webhook and click Edit to make more changes.
Validation
When your webhooksecret is set, Razorpay uses it to create a hash signature with each payload. This hash signature is passed with each request under the X-Razorpay-Signature header that you need to validate at your end. We provide support for validating the signature in all of our language SDKs.
If you have changed your webhook secret, remember to use the old secret for webhook signature validation while retrying older requests. Using the new secret will lead to a signature mismatch.
PHP
/* PHP SDK: https://github.com/razorpay/razorpay-php */
use Razorpay\Api\Api;
$api = new Api("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
$api->utility->verifyWebhookSignature($webhookBody, $webhookSignature, $webhookSecret);
/* $webhookBody should be raw webhook request body */
```python:Python
/* Python SDK: https://github.com/razorpay/razorpay-python */
import razorpay
client = razorpay.Client(auth=("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]"))
client.utility.verify_webhook_signature(webhook_body, webhook_signature, webhook_secret)
#webhook_body should be raw webhook request body
```ruby:Ruby
/* Ruby SDK: https://github.com/razorpay/razorpay-ruby */
require razorpay
Razorpay::Utility.verify_webhook_signature(webhook_body, webhook_signature, webhook_secret)
#webhook_body should be raw webhook request body
```C:.Net
/* Dot Net SDK: https://github.com/razorpay/razorpay-dot-net */
Utils.verifyWebhookSignature(webhookBody, webhookSignature, webhookSecret);
#webhookBody should be raw webhook request body
```java: Java
/* Java SDK: https://github.com/razorpay/razorpay-java */
Utils.verifyWebhookSignature("", "", "");
```javascript: Node.js
/* NODE SDK: https://github.com/razorpay/razorpay-node */
const {validateWebhookSignature} = require('razorpay/dist/utils/razorpay-utils')
validateWebhookSignature(JSON.stringify(webhookBody), webhookSignature, webhookSecret)
#webhook_body should be raw webhook request body
X-Razorpay-Signature
: The hash signature is calculated using HMAC with SHA256 algorithm; with your webhook secret set as the key and the webhook request body as the message.
You can also validate the webhook signature yourself using a HMAC as shown below:
HMAC Hex Digest
key = webhook_secret
message = webhook_body // raw webhook request body
received_signature = webhook_signature
expected_signature = hmac('sha256', message, key)
if expected_signature != received_signature
throw SecurityError
end
Do Not Parse or Cast the Webhook Request BodyWhile generating the signature at your end, ensure that the webhook body passed as an argument is the raw webhook request body. Do not parse or cast the webhook request body.
Check Payment Status Using Webhooks
You can use these webhooks to check the status of the authorisation payment and subsequent payments.Webhook Event | Description
payment.authorized | Indicates the payment has been authorized. A payment is authorized when the customer’s payment details are successfully authenticated by the bank.
payment.captured | Indicates when the payment has been captured.
order.paid | Indicates the customer has successfully made the payment.
payment.failed | Indicates that the payment has failed. If the payment fails, you need to create an authorisation transaction again.
Payment Authorized
Indicates that the payment has been authorized. A payment is authorized when the customer’s payment details are successfully authenticated by the bank.Watch Out!For Emandate, the ‘acquirer_data’ is populated as an empty object in the webhook.
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.authorized",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHf94S8ja4Cggz",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "authorized",
"order_id": "order_FHf8iqahguUGkM",
"invoice_id": "inv_FHf8iwg1ZaNMNh",
"international": false,
"method": "emandate",
"amount_refunded": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHf94Uym9tdYFJ",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": null,
"tax": null,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1595447381
}
}
},
"created_at": 1595447383
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.authorized",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHfqtkRzWvxky4",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "authorized",
"order_id": "order_FHfnswDdfu96HQ",
"invoice_id": null,
"international": false,
"method": "card",
"amount_refunded": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": "card_F0zoXUp4IPPGoI",
"card": {
"id": "card_F0zoXUp4IPPGoI",
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer"
},
"bank": null,
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHfn3rIiM1Z8nr",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": null,
"tax": null,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"auth_code": "541898"
},
"created_at": 1595449871
}
}
},
"created_at": 1595449872
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.authorized",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_EhXwFbTdVTDWVA",
"entity": "payment",
"amount": 0,
"currency": "INR",
"base_amount": 0,
"status": "authorized",
"order_id": "order_EhTTPTTwLAijw8",
"invoice_id": "inv_EhTTPSxAjbXCWi",
"international": false,
"method": "nach",
"amount_refunded": 0,
"amount_transferred": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EhXwFeR0hG3qZj",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"fee": null,
"tax": null,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1587561758
}
}
},
"created_at": 1587562064
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.authorized",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhm0UWoNrZT3h",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "authorized",
"order_id": "order_FHhlVrVCPWGSDC",
"invoice_id": null,
"international": false,
"method": "upi",
"amount_refunded": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": null,
"bank": null,
"wallet": null,
"vpa": "gaurav.kumar@upi",
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHhm0XTtJg9zqb",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": null,
"tax": null,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"rrn": "688684363734",
"upi_transaction_id": "B832E94839C6C5194D2DB36F865F564D"
},
"created_at": 1595456636
}
}
},
"created_at": 1595456636
}
Payment Captured
Indicates that the payment has been captured.Watch Out!For Emandate, the ‘acquirer_data’ is populated as an empty object in the webhook.
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.captured",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHf94S8ja4Cggz",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "captured",
"order_id": "order_FHf8iqahguUGkM",
"invoice_id": "inv_FHf8iwg1ZaNMNh",
"international": false,
"method": "emandate",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHf94Uym9tdYFJ",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1595447381
}
}
},
"created_at": 1595447383
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.captured",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHfqtkRzWvxky4",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"order_id": "order_FHfnswDdfu96HQ",
"invoice_id": null,
"international": false,
"method": "card",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": "card_F0zoXUp4IPPGoI",
"card": {
"id": "card_F0zoXUp4IPPGoI",
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer"
},
"bank": null,
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHfn3rIiM1Z8nr",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"auth_code": "541898"
},
"created_at": 1595449871
}
}
},
"created_at": 1595449873
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.captured",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_EhXwFbTdVTDWVA",
"entity": "payment",
"amount": 0,
"currency": "INR",
"base_amount": 0,
"status": "captured",
"order_id": "order_EhTTPTTwLAijw8",
"invoice_id": "inv_EhTTPSxAjbXCWi",
"international": false,
"method": "nach",
"amount_refunded": 0,
"amount_transferred": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EhXwFeR0hG3qZj",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at": 1587561758
}
}
},
"created_at": 1587562064
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.captured",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhm0UWoNrZT3h",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"order_id": "order_FHhlVrVCPWGSDC",
"invoice_id": null,
"international": false,
"method": "upi",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": null,
"wallet": null,
"vpa": "gaurav.kumar@upi",
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHhm0XTtJg9zqb",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"rrn": "688684363734",
"upi_transaction_id": "B832E94839C6C5194D2DB36F865F564D"
},
"created_at": 1595456636
}
}
},
"created_at": 1595456636
}
Order Paid
Indicates that the payment has been captured.Watch Out!
- For Emandate, the ‘acquirer_data’ is populated as an empty object in the webhook.
- The
invoice_idparameter is populated with the unique identifier value (for example,inv_FHf8iwg1ZaNMNh) for Emandate, Card and Paper NACH methods only. For UPI, the value of theinvoice_idparameter value isnull.
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "order.paid",
"contains": [
"payment",
"order"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHf94S8ja4Cggz",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "captured",
"order_id": "order_FHf8iqahguUGkM",
"invoice_id": "inv_FHf8iwg1ZaNMNh",
"international": false,
"method": "emandate",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHf94Uym9tdYFJ",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1595447381
}
},
"order": {
"entity": {
"id": "order_FHf8iqahguUGkM",
"entity": "order",
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"currency": "INR",
"receipt": "Receipt No. 1",
"offer_id": null,
"status": "paid",
"attempts": 1,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"created_at": 1595447361,
"token": {
"method": "emandate",
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 9999900,
"auth_type": "netbanking",
"expire_at": 1689971140,
"bank_account": {
"ifsc": "HDFC0000001",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "XXXXXXXXXXXX1121",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9876543210"
},
"first_payment_amount": 0
}
}
}
},
"created_at": 1595447383
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "order.paid",
"contains": [
"payment",
"order"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHfqtkRzWvxky4",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"order_id": "order_FHfnswDdfu96HQ",
"invoice_id": "inv_FHf8iwg1ZaNMNh",
"international": false,
"method": "card",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": "card_F0zoXUp4IPPGoI",
"card": {
"id": "card_F0zoXUp4IPPGoI",
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer"
},
"bank": null,
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHfn3rIiM1Z8nr",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"auth_code": "541898"
},
"created_at": 1595449871
}
},
"order": {
"entity": {
"id": "order_FHfnswDdfu96HQ",
"entity": "order",
"amount": 100,
"amount_paid": 100,
"amount_due": 0,
"currency": "INR",
"receipt": "Receipt No. 1",
"offer_id": null,
"status": "paid",
"attempts": 1,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"created_at": 1595449699
}
}
},
"created_at": 1595449873
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "order.paid",
"contains": [
"payment",
"order"
],
"payload": {
"payment": {
"entity": {
"id": "pay_EhXwFbTdVTDWVA",
"entity": "payment",
"amount": 0,
"currency": "INR",
"base_amount": 0,
"status": "captured",
"order_id": "order_EhTTPTTwLAijw8",
"invoice_id": "inv_EhTTPSxAjbXCWi",
"international": false,
"method": "nach",
"amount_refunded": 0,
"amount_transferred": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EhXwFeR0hG3qZj",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"created_at": 1587561758
}
},
"order": {
"entity": {
"id": "order_EhTTPTTwLAijw8",
"entity": "order",
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"currency": "INR",
"receipt": null,
"offer_id": null,
"status": "paid",
"attempts": 1,
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at": 1587546033,
"token": {
"method": "nach",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 10000000,
"auth_type": "physical",
"expire_at": 1617215399,
"nach": {
"create_form": true,
"form_reference1": "Reference 1",
"form_reference2": "Reference 2",
"prefilled_form": "https://rzp.io/i/kHXQ34x",
"upload_form_url": "https://rzp.io/i/2IcNo4E",
"description": "Paper NACH"
},
"bank_account": {
"ifsc": "HDFC0000123",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "99889900231489",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9876543210"
},
"first_payment_amount": 10000
}
}
}
},
"created_at": 1587562064
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "order.paid",
"contains": [
"payment",
"order"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhm0UWoNrZT3h",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"order_id": "order_FHhlVrVCPWGSDC",
"invoice_id": null,
"international": false,
"method": "upi",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": null,
"wallet": null,
"vpa": "gaurav.kumar@upi",
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHhm0XTtJg9zqb",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"rrn": "688684363734",
"upi_transaction_id": "B832E94839C6C5194D2DB36F865F564D"
},
"created_at": 1595456636
}
},
"order": {
"entity": {
"id": "order_FHhlVrVCPWGSDC",
"entity": "order",
"amount": 100,
"amount_paid": 100,
"amount_due": 0,
"currency": "INR",
"receipt": "Receipt No. 1",
"offer_id": null,
"status": "paid",
"attempts": 2,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"created_at": 1595456608
}
}
},
"created_at": 1595456636
}
Payment Failed
Indicates that the payment has failed. If the payment fails, you need to create an authorisation transaction again.Watch Out!For Emandate, the ‘acquirer_data’ is populated as an empty object in the webhook.
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.failed",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhKpRTgEWNzBx",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "failed",
"order_id": "order_FHhKYYSK40KNzt",
"invoice_id": "inv_FHhKYltuPeHTyP",
"international": false,
"method": "emandate",
"amount_refunded": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHhKpV8NeHJHtg",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": null,
"tax": null,
"error_code": "BAD_REQUEST_ERROR",
"error_description": "Payment failed",
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1595455092
}
}
},
"created_at": 1595455094
}
```json: Cards
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.failed",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhLcvd67XXsBe",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "failed",
"order_id": "order_FHhLONJc3wlBbv",
"invoice_id": null,
"international": false,
"method": "card",
"amount_refunded": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": "card_F0zoXUp4IPPGoI",
"card": {
"id": "card_F0zoXUp4IPPGoI",
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer"
},
"bank": null,
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHfn3rIiM1Z8nr",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": null,
"tax": null,
"error_code": "BAD_REQUEST_ERROR",
"error_description": "Payment failed",
"error_source": "gateway",
"error_step": "payment_authorization",
"error_reason": "payment_failed",
"acquirer_data": {
"auth_code": null
},
"created_at": 1595455138
}
}
},
"created_at": 1595455139
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.failed",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_EhYcjfgwGLVZOf",
"entity": "payment",
"amount": 0,
"currency": "INR",
"base_amount": 0,
"status": "failed",
"order_id": "order_EhYX40CBIRmSaC",
"invoice_id": "inv_EhYX3zhOm38daM",
"international": false,
"method": "nach",
"amount_refunded": 0,
"amount_transferred": 0,
"refund_status": null,
"captured": false,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EhYcjjYiEL1nEW",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"fee": null,
"tax": null,
"error_code": "BAD_REQUEST_ERROR",
"error_description": "Payment failed",
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1587564171
}
}
},
"created_at": 1587564208
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "payment.failed",
"contains": [
"payment"
],
"payload": {
"payment": {
"entity": {
"id": "pay_EhSxIRyTtshjQr",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "failed",
"order_id": "order_EhSwt4nx32X1Ss",
"invoice_id": "inv_EhSwt4FKpTKrdf",
"international": false,
"method": "upi",
"amount_refunded": 0,
"refund_status": null,
"captured": false,
"description": "Invoice #inv_EhSwt4FKpTKrdf",
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": gaurav.kumar@okhdfc,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EhSxIV7p0l7yri",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"fee": null,
"tax": null,
"error_code": "BAD_REQUEST_ERROR",
"error_description": "Payment failed",
"created_at": 1587544209
}
}
},
"created_at": 1587544212
}
Check Token Status using Webhooks
You can use the below webhooks to check the status of the token.Webhook Event | Applicable Methods | Description
token.confirmed | - Emandate
- Card
- Paper NACH
- UPI | Indicates that the bank has completed the mandate registration. Once confirmed, you can create subsequent payments as per your business needs.
token.rejected | - Emandate
- Card
- Paper NACH
- UPI | Indicates that the has been rejected. If rejected, you need to create the authorisation transaction again.
token.cancelled | - Emandate
- UPI
- Card | Indicated the token has been cancelled.
token.paused | UPI | Indicated the token has been paused by your customer.
Token Confirmed
Indicates that the bank has completed the mandate registration. Once confirmed, you can create subsequent payments as per your business needs. Available for tokens authorized using the following methods:- Emandate
- Card
- Paper NACH
- UPI
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.confirmed",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHf94Uym9tdYFJ",
"entity": "token",
"token": "2wDPM7VAlXtjAR",
"bank": "HDFC",
"wallet": null,
"method": "emandate",
"recurring": true,
"recurring_details": {
"status": "confirmed",
"failure_reason": null
},
"auth_type": "netbanking",
"mrn": null,
"used_at": 1595447381,
"created_at": 1595447381,
"bank_details": {
"beneficiary_name": "Gaurav Kumar",
"account_number": "1121431121541121",
"ifsc": "HDFC0000001",
"account_type": "savings"
},
"max_amount": 9999900,
"expired_at": 1689971140,
"dcc_enabled": false
}
}
},
"created_at": 1595447383
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.confirmed",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHfn3rIiM1Z8nr",
"entity": "token",
"token": "2aqzyte2EqvuDr",
"bank": null,
"wallet": null,
"method": "card",
"card": {
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer",
"expiry_month": 5,
"expiry_year": 2025,
"flows": {
"otp": true,
"recurring": true,
"iframe": false
}
},
"recurring": true,
"auth_type": null,
"mrn": null,
"used_at": 1595449653,
"created_at": 1595449652,
"expired_at": 1748716199,
"dcc_enabled": false
}
}
},
"created_at": 1595449654
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.confirmed",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHf94Uym9tdYFJ",
"entity": "token",
"token": "2wDPM7VAlXtjAR",
"bank": "HDFC",
"wallet": null,
"method": "nach",
"recurring": true,
"recurring_details": {
"status": "confirmed",
"failure_reason": null
},
"auth_type": "physical",
"mrn": null,
"used_at": 1595447381,
"created_at": 1595447381,
"max_amount": 9999900,
"expired_at": 1689971140,
"dcc_enabled": false
}
}
},
"created_at": 1595447383
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.confirmed",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHhm0XTtJg9zqb",
"entity": "token",
"token": "BmwqwrkHZTlzVF",
"bank": null,
"wallet": null,
"method": "upi",
"vpa": {
"username": "gaurav.kumar",
"handle": "upi",
"name": null
},
"recurring": true,
"recurring_details": {
"status": "confirmed",
"failure_reason": null
},
"auth_type": null,
"mrn": null,
"used_at": 1595456636,
"created_at": 1595456636,
"start_time": 1595456608,
"dcc_enabled": false
}
}
},
"created_at": 1595456636
}
Token Rejected
Triggered during the token creation/registration process, when the token creation process fails without completion. This webhook is available for tokens authorized using the following methods:- Emandate
- Card
- Paper NACH
- UPI
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.rejected",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHhXz1xrfmEtzO",
"entity": "token",
"token": "CxQakUkIEObsTB",
"bank": "HDFC",
"wallet": null,
"method": "emandate",
"recurring": false,
"recurring_details": {
"status": "rejected",
"failure_reason": "Rejected by bank"
},
"auth_type": "debitcard",
"mrn": null,
"used_at": 1595455839,
"created_at": 1595455839,
"bank_details": {
"beneficiary_name": "Gaurav Kumar",
"account_number": "1121431121541121",
"ifsc": "HDFC0000001",
"account_type": "savings"
},
"max_amount": 9999900,
"expired_at": 4102444799,
"dcc_enabled": false
}
}
},
"created_at": 1595455843
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.rejected",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHhXz1xrfmEtzO",
"entity": "token",
"token": "CxQakUkIEObsTB",
"bank": "HDFC",
"wallet": null,
"method": "card",
"recurring": false,
"recurring_details": {
"status": "rejected",
"failure_reason": "Rejected by bank"
},
"card": {
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer",
"expiry_month": 5,
"expiry_year": 2021,
"flows": {
"otp": true,
"recurring": false,
"iframe": false
}
},
"auth_type": "card",
"mrn": null,
"used_at": 1595455839,
"created_at": 1595455839,
"max_amount": 9999900,
"expired_at": 4102444799,
"dcc_enabled": false
}
}
},
"created_at": 1595455843
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.rejected",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHhXz1xrfmEtzO",
"entity": "token",
"token": "CxQakUkIEObsTB",
"bank": "HDFC",
"wallet": null,
"method": "nach",
"recurring": false,
"recurring_details": {
"status": "rejected",
"failure_reason": "Rejected by bank"
},
"auth_type": "physical",
"mrn": null,
"used_at": 1595455839,
"created_at": 1595455839,
"max_amount": 9999900,
"expired_at": 4102444799,
"dcc_enabled": false
}
}
},
"created_at": 1595455843
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.rejected",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FHhm0XTtJg9zqb",
"entity": "token",
"token": "BmwqwrkHZTlzVF",
"bank": null,
"wallet": null,
"method": "upi",
"vpa": {
"username": "gaurav.kumar",
"handle": "upi",
"name": null
},
"recurring": true,
"recurring_details": {
"status": "rejected",
"failure_reason": "Rejected by bank"
},
"auth_type": "upi",
"mrn": null,
"used_at": 1595456636,
"created_at": 1595456636,
"start_time": 1595456608,
"dcc_enabled": false
}
}
},
"created_at": 1595456636
}
Token Cancelled
Triggered when a token is explicitly cancelled or deactivated. Usually happens after a successful token creation.UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.cancelled",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FVIP5DVexjoZjF",
"entity": "token",
"token": "5ESJrtR1V6k6mp",
"bank": null,
"wallet": null,
"method": "upi",
"vpa": {
"username": "56546",
"handle": "upi",
"name": null
},
"recurring": true,
"recurring_details": {
"status": "cancelled",
"failure_reason": null
},
"auth_type": null,
"mrn": null,
"used_at": 1598424055,
"created_at": 1598424055,
"start_time": 1598510437,
"dcc_enabled": false,
"max_amount": 5600,
"expired_at": 1913956837
}
}
},
"created_at": 1599065559
}
```json: Cards
{
"entity":"event",
"account_id":"acc_8TgNt9DVrJB0bl",
"event":"token.cancelled",
"contains":[
"token"
],
"payload":{
"token":{
"entity":{
"id":"token_KaQbMNOeH67CZj",
"entity":"token",
"token":"DWrlGEB3ZqWKNV",
"bank":null,
"wallet":null,
"method":"card",
"card":{
"entity":"card",
"name":"",
"last4":"3182",
"network":"Visa",
"type":"credit",
"issuer":"HDFC",
"international":false,
"emi":true,
"sub_type":"consumer",
"token_iin":"486924082",
"expiry_month":"01",
"expiry_year":"2099",
"flows":{
"otp":true,
"recurring":true
},
"cobranding_partner":null
},
"recurring":true,
"recurring_details":{
"status":"cancelled",
"failure_reason":null
},
"auth_type":null,
"mrn":null,
"used_at":1675247897,
"created_at":1667230058,
"expired_at":1730399399,
"status":"active",
"error_description":null,
"dcc_enabled":false,
"max_amount":200,
"error_code":null,
"compliant_with_tokenisation_guidelines":true
}
}
},
"created_at":1681372110
}
Token Paused
Indicates the token has been paused by your customer. Available only for tokens authorized via UPI.UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "token.paused",
"contains": [
"token"
],
"payload": {
"token": {
"entity": {
"id": "token_FVIP5DVexjoZjF",
"entity": "token",
"token": "5ESJrtR1V6k6mp",
"bank": null,
"wallet": null,
"method": "upi",
"vpa": {
"username": "56546",
"handle": "upi",
"name": null
},
"recurring": true,
"recurring_details": {
"status": "paused",
"failure_reason": null
},
"auth_type": null,
"mrn": null,
"used_at": 1598424055,
"created_at": 1598424055,
"start_time": 1598510437,
"dcc_enabled": false,
"max_amount": 5600,
"expired_at": 1913956837
}
}
},
"created_at": 1599065559
}
Check Registration Link Status using Webhooks
You can use these webhooks to check the status of the registration link.Webhook Event | Description
invoice.paid | Indicates that a registration link is successfully paid.
invoice.expired | Indicates that a registration link has expired.
Invoice Paid
Indicates that a registration link has been successfully paid.Watch Out!For Emandate, the ‘acquirer_data’ is populated as an empty object in the webhook.
Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.paid",
"contains": [
"payment",
"order",
"invoice"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhf2L2OS2qE1u",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "captured",
"order_id": "order_FHhejhc3XFHr5c",
"invoice_id": "inv_FHhejg2WDlmyGP",
"international": false,
"method": "emandate",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": "Invoice #inv_FHhejg2WDlmyGP",
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHhf2PMcYf1mOu",
"notes": {
"Internal Note": "Random Description"
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1595456240
}
},
"order": {
"entity": {
"id": "order_FHhejhc3XFHr5c",
"entity": "order",
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"currency": "INR",
"receipt": "Receipt No. 1",
"offer_id": null,
"offers": {
"entity": "collection",
"count": 0,
"items": []
},
"status": "paid",
"attempts": 1,
"notes": [],
"created_at": 1595456223,
"token": {
"method": "emandate",
"notes": {
"Internal Note": "Random Description"
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 9999900,
"auth_type": null,
"expire_at": 1609439399,
"bank_account": {
"ifsc": "HDFC0000123",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "XXXXXXXX9012",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9876543210"
},
"first_payment_amount": 0
}
}
},
"invoice": {
"entity": {
"id": "inv_FHhejg2WDlmyGP",
"entity": "invoice",
"receipt": "Receipt No. 1",
"invoice_number": "Receipt No. 1",
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_FHhejhc3XFHr5c",
"payment_id": "pay_FHhf2L2OS2qE1u",
"status": "paid",
"expire_by": 1596220199,
"issued_at": 1595456223,
"paid_at": 1595456243,
"cancelled_at": null,
"expired_at": null,
"sms_status": "sent",
"email_status": "sent",
"date": 1595456223,
"terms": null,
"partial_payment": false,
"gross_amount": 0,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Authorization link",
"notes": {
"Internal Note": "Random Description"
},
"comment": null,
"short_url": "https://rzp.io/i/6gkcy7O",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"user_id": "CTlk1QZN33LQUT",
"created_at": 1595456223,
"idempotency_key": null
}
}
},
"created_at": 1595456243
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.paid",
"contains": [
"payment",
"order",
"invoice"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhcSi5TDZ7wJL",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"order_id": "order_FHhcC7dWy3feTu",
"invoice_id": "inv_FHhcC629qa82SA",
"international": false,
"method": "card",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": "Invoice #inv_FHhcC629qa82SA",
"card_id": "card_F0zoXUp4IPPGoI",
"card": {
"id": "card_F0zoXUp4IPPGoI",
"entity": "card",
"name": "Gaurav Kumar",
"last4": "2002",
"network": "Visa",
"type": "credit",
"issuer": "CITI",
"international": false,
"emi": true,
"sub_type": "consumer"
},
"bank": null,
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHfn3rIiM1Z8nr",
"notes": {
"Internal Note": "Random Description"
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"auth_code": "290686"
},
"created_at": 1595456094
}
},
"order": {
"entity": {
"id": "order_FHhcC7dWy3feTu",
"entity": "order",
"amount": 100,
"amount_paid": 100,
"amount_due": 0,
"currency": "INR",
"receipt": "Receipt No. 1",
"offer_id": null,
"offers": {
"entity": "collection",
"count": 0,
"items": []
},
"status": "paid",
"attempts": 1,
"notes": [],
"created_at": 1595456078,
"token": {
"method": "card",
"notes": {
"Internal Note": "Random Description"
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 9999900,
"auth_type": null,
"expire_at": null,
"first_payment_amount": 0
}
}
},
"invoice": {
"entity": {
"id": "inv_FHhcC629qa82SA",
"entity": "invoice",
"receipt": "Receipt No. 1",
"invoice_number": "Receipt No. 1",
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_FHhcC7dWy3feTu",
"payment_id": "pay_FHhcSi5TDZ7wJL",
"status": "paid",
"expire_by": 1596220199,
"issued_at": 1595456078,
"paid_at": 1595456095,
"cancelled_at": null,
"expired_at": null,
"sms_status": "sent",
"email_status": "sent",
"date": 1595456078,
"terms": null,
"partial_payment": false,
"gross_amount": 100,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 100,
"amount_paid": 100,
"amount_due": 0,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Authorization Link",
"notes": {
"Internal Note": "Random Description"
},
"comment": null,
"short_url": "https://rzp.io/i/X2cWr1D",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"user_id": "CTlk1QZN33LQUT",
"created_at": 1595456078,
"idempotency_key": null
}
}
},
"created_at": 1595456095
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.paid",
"contains": [
"payment",
"order",
"invoice"
],
"payload": {
"payment": {
"entity": {
"id": "pay_EhXwFbTdVTDWVA",
"entity": "payment",
"amount": 0,
"currency": "INR",
"base_amount": 0,
"status": "captured",
"order_id": "order_EhTTPTTwLAijw8",
"invoice_id": "inv_EhTTPSxAjbXCWi",
"international": false,
"method": "nach",
"amount_refunded": 0,
"amount_transferred": 0,
"refund_status": null,
"captured": true,
"description": null,
"card_id": null,
"bank": "HDFC",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EhXwFeR0hG3qZj",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"created_at": 1587561758
}
},
"order": {
"entity": {
"id": "order_EhTTPTTwLAijw8",
"entity": "order",
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"currency": "INR",
"receipt": null,
"offer_id": null,
"offers": {
"entity": "collection",
"count": 0,
"items": []
},
"status": "paid",
"attempts": 1,
"notes": [],
"created_at": 1587546033,
"token": {
"method": "nach",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 10000000,
"auth_type": "physical",
"expire_at": 1617215399,
"nach": {
"create_form": true,
"form_reference1": "Reference 1",
"form_reference2": "Reference 2",
"prefilled_form": "https://rzp.io/i/409IxCx",
"upload_form_url": "https://rzp.io/i/2IcNo4E",
"description": "Paper NACH"
},
"bank_account": {
"ifsc": "HDFC0000123",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "99889900231489",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9876543210"
},
"first_payment_amount": 10000
}
}
},
"invoice": {
"entity": {
"id": "inv_EhTTPSxAjbXCWi",
"entity": "invoice",
"receipt": null,
"invoice_number": null,
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_EhTTPTTwLAijw8",
"payment_id": "pay_EhXwFbTdVTDWVA",
"status": "paid",
"expire_by": 1588271399,
"issued_at": 1587546033,
"paid_at": 1587562064,
"cancelled_at": null,
"expired_at": null,
"sms_status": "sent",
"email_status": "sent",
"date": 1587546033,
"terms": null,
"partial_payment": false,
"gross_amount": 0,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Paper NACH",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"comment": null,
"short_url": "https://rzp.io/i/2IcNo4E",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"subscription_status": null,
"user_id": "BhPhy4mGkOmThn",
"created_at": 1587546033,
"idempotency_key": null,
"reminder_status": null,
"token": {
"method": "nach",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 10000000,
"auth_type": "physical",
"expire_at": 1617215399,
"nach": {
"create_form": true,
"form_reference1": "Reference 1",
"form_reference2": "Reference 2",
"prefilled_form": "https://rzp.io/i/409IxCx",
"upload_form_url": "https://rzp.io/i/2IcNo4E",
"description": "Paper NACH"
},
"bank_account": {
"ifsc": "HDFC0000123",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "99889900231489",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9876543210"
},
"first_payment_amount": 10000
},
"nach_form_url": "https://rzp.io/i/409IxCx"
}
}
},
"created_at": 1587562064
}
```json: UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.paid",
"contains": [
"payment",
"order",
"invoice"
],
"payload": {
"payment": {
"entity": {
"id": "pay_FHhw4RhnuZPiuO",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"order_id": "order_FHhvTLKwXS9bnS",
"invoice_id": "inv_FHhvTPure2cEqZ",
"international": false,
"method": "upi",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": "Invoice #inv_FHhvTPure2cEqZ",
"card_id": null,
"bank": null,
"wallet": null,
"vpa": "gaurav.kumar@upi",
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_FHhw4Ufvv7kv9u",
"notes": {
"Internal Note": "Random Description"
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"rrn": "237153511656",
"upi_transaction_id": "B1D63A7B0366274F83AF9B3A0D7C5CA8"
},
"created_at": 1595457208
}
},
"order": {
"entity": {
"id": "order_FHhvTLKwXS9bnS",
"entity": "order",
"amount": 100,
"amount_paid": 100,
"amount_due": 0,
"currency": "INR",
"receipt": null,
"offer_id": null,
"offers": {
"entity": "collection",
"count": 0,
"items": []
},
"status": "paid",
"attempts": 3,
"notes": [],
"created_at": 1595457173,
"token": {
"method": "upi",
"notes": {
"Internal Note": "Random Description"
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 200000,
"auth_type": null,
"expire_at": 1609439399,
"first_payment_amount": 0
}
}
},
"invoice": {
"entity": {
"id": "inv_FHhvTPure2cEqZ",
"entity": "invoice",
"receipt": "Receipt No. 1",
"invoice_number": "Receipt No. 1",
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_FHhvTLKwXS9bnS",
"payment_id": "pay_FHhw4RhnuZPiuO",
"status": "paid",
"expire_by": 1596220199,
"issued_at": 1595457174,
"paid_at": 1595457208,
"cancelled_at": null,
"expired_at": null,
"sms_status": "sent",
"email_status": "sent",
"date": 1595457173,
"terms": null,
"partial_payment": false,
"gross_amount": 100,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 100,
"amount_paid": 100,
"amount_due": 0,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Authorization transaction",
"notes": {
"Internal Note": "Random Description"
},
"comment": null,
"short_url": "https://rzp.io/i/GZlLJ0d",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"user_id": "CTlk1QZN33LQUT",
"created_at": 1595457174,
"idempotency_key": null
}
}
},
"created_at": 1595457208
}
Invoice Expired
Indicates that a registration link has expired.Emandate
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.expired",
"contains": [
"invoice"
],
"payload": {
"invoice": {
"entity": {
"id": "inv_EhT8EVjQDUukPy",
"entity": "invoice",
"receipt": null,
"invoice_number": null,
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_EhT8EWJQqnMYq5",
"payment_id": null,
"status": "expired",
"expire_by": 1587580199,
"issued_at": 1587544830,
"paid_at": null,
"cancelled_at": null,
"expired_at": 1587580384,
"sms_status": "sent",
"email_status": "sent",
"date": 1587544830,
"terms": null,
"partial_payment": false,
"gross_amount": 0,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Emandate",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"comment": null,
"short_url": "https://rzp.io/i/bJsb41M",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"subscription_status": null,
"user_id": "BhPhy4mGkOmThn",
"created_at": 1587544830,
"idempotency_key": null,
"reminder_status": null
}
}
},
"created_at": 1587580384
}
```json: Card
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.expired",
"contains": [
"invoice"
],
"payload": {
"invoice": {
"entity": {
"id": "inv_EhT9735kpvUafM",
"entity": "invoice",
"receipt": null,
"invoice_number": null,
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_EhT9741SenUX1D",
"payment_id": null,
"status": "expired",
"expire_by": 1587580199,
"issued_at": 1587544880,
"paid_at": null,
"cancelled_at": null,
"expired_at": 1587580384,
"sms_status": "sent",
"email_status": "sent",
"date": 1587544880,
"terms": null,
"partial_payment": false,
"gross_amount": 10000,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 10000,
"amount_paid": 0,
"amount_due": 10000,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Card",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"comment": null,
"short_url": "https://rzp.io/i/BapcbaV",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"subscription_status": null,
"user_id": "BhPhy4mGkOmThn",
"created_at": 1587544880,
"idempotency_key": null,
"reminder_status": null
}
}
},
"created_at": 1587580384
}
```json: Paper NACH
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "invoice.expired",
"contains": [
"invoice"
],
"payload": {
"invoice": {
"entity": {
"id": "inv_EhTAJksst7voVZ",
"entity": "invoice",
"receipt": null,
"invoice_number": null,
"customer_id": "cust_DtHaBuooGHTuyZ",
"customer_details": {
"id": "cust_DtHaBuooGHTuyZ",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9876543210"
},
"order_id": "order_EhTAJlTQZbL9NT",
"payment_id": null,
"status": "expired",
"expire_by": 1587580199,
"issued_at": 1587544949,
"paid_at": null,
"cancelled_at": null,
"expired_at": 1587580384,
"sms_status": "sent",
"email_status": "sent",
"date": 1587544949,
"terms": null,
"partial_payment": false,
"gross_amount": 0,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"first_payment_min_amount": null,
"currency": "INR",
"currency_symbol": "₹",
"description": "Paper NACH",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"comment": null,
"short_url": "https://rzp.io/i/IT8vEd1",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"supply_state_code": null,
"subscription_status": null,
"user_id": "BhPhy4mGkOmThn",
"created_at": 1587544949,
"idempotency_key": null,
"reminder_status": null,
"token": {
"method": "nach",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 10000000,
"auth_type": "physical",
"expire_at": 1617215399,
"nach": {
"create_form": true,
"form_reference1": "Reference 1",
"form_reference2": "Reference 2",
"prefilled_form": "https://rzp.io/i/jDvNSTc",
"upload_form_url": "https://rzp.io/i/IT8vEd1",
"description": "Paper NACH"
},
"bank_account": {
"ifsc": "HDFC0000123",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "88990011223344",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9876543210"
},
"first_payment_amount": 0
},
"nach_form_url": "https://rzp.io/i/jDvNSTc"
}
}
},
"created_at": 1587580384
}
Check Notification Status using Webhooks
You can use these webhooks to check the status of the pre-debit notification sent to the customer when the payment method is UPI and Cards. These notification webhooks are available only if you send the notification object while creating an order.Webhooks Event | Description
notification.delivered | Indicates that a pre-debit notification is successfully delivered.
notification.failed | Indicates that a pre-debit notification has failed to deliver.
Notification Delivered
Indicates that a pre-debit notification is successfully delivered.UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "order.notification.delivered",
"contains": [
"notification"
],
"payload": {
"notification": {
"entity": {
"id": "notification_00000000000001",
"entity": "notification",
"order_id": "order_1Aa00000000002",
"token_id": "token_M7K2eFBU7vToaQ",
"delivered_at": 1634057113,
"status": "delivered",
"payment_after": 1634057114
}
},
"created_at": 1595456636
}
}
Notification Failed
Indicates that a pre-debit notification has failed to deliver. You should re-trigger the pre-debit notification before making a debit attempt in these cases.UPI
{
"entity": "event",
"account_id": "acc_8TgNt9DVrJB0bl",
"event": "order.notification.failed",
"contains": [
"notification"
],
"payload": {
"notification": {
"entity": {
"id": "notification_00000000000002",
"entity": "notification",
"order_id": "order_1Aa00000000002",
"token_id": "token_M7K2eFBU7vToaQ",
"delivered_at": null,
"status": "failed",
"payment_after": 1634057114
}
},
"created_at": 1595456636
}
}