Webhooks are server callbacks to your server from Cashfree Payments. We send webhooks for three different events for a payment.

  1. payment success webhook
  2. payment failed webhook
  3. payment user dropped webhook

Payment Success Webhook

A payment success webhook is triggered when a payment is successfully completed. You can use this for: Updating order status, triggering fulfillment, send confirmation to customer.

Version (2023-08-01)
{
"data": {
"order": {
"order_id": "order_OFR_2",
"order_amount": 2,
"order_currency": "INR",
"order_tags": null
},
"payment": {
"cf_payment_id": "1453002795",
"payment_status": "SUCCESS",
"payment_amount": 1,
"payment_currency": "INR",
"payment_message": "00::Transaction success",
"payment_time": "2022-12-15T12:20:29+05:30",
"bank_reference": "234928698581",
"auth_id": null,
"payment_method": {  
"upi": {
        "channel": "collect",
        "upi_id": "suhasg6@ybl",
    }  
},
"payment_group":"upi",
},
"customer_details": {
"customer_name": null,
"customer_id": "7112AAA812234",
"customer_email": "test@gmail.com",
"customer_phone": "9908734801"
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "1634766330",
"gateway_payment_id": "1504280029",
"gateway_order_reference_id": "abc_124",
"gateway_settlement": "CASHFREE",
"gateway_status_code": null
},
"payment_offers": [
{
"offer_id": "0f05e1d0-fbf8-4c9c-a1f0-814c7b2abdba",
"offer_type": "DISCOUNT",
"offer_meta": {
  "offer_title": "50% off on UPI",
  "offer_description": "50% off for testing",
  "offer_code": "UPI50",
  "offer_start_time": "2022-11-09T06:23:25.972Z",
  "offer_end_time": "2023-02-27T18:30:00Z"
},
"offer_redemption": {
  "redemption_status": "SUCCESS",
  "discount_amount": 1,
  "cashback_amount": 0
}
}
]
},
"event_time": "2023-08-01T11:16:10+05:30",
"type": "PAYMENT_SUCCESS_WEBHOOK"
}

Payment Failed Webhook

The payment failed webhook notifies you when a payment attempt fails and we receive a failed response from the bank. Use case: Update order status, notify customer, initiate retry flow

Version 2023-08-01
{
"data": {
"order": {
  "order_id": "order_OFR_2",
  "order_amount": 2,
  "order_currency": "INR",
  "order_tags": null
},
"payment": {
  "cf_payment_id": "1453002795",
  "payment_status": "SUCCESS",
  "payment_amount": 1,
  "payment_currency": "INR",
  "payment_message": "00::Transaction success",
  "payment_time": "2022-12-15T12:20:29+05:30",
  "bank_reference": "234928698581",
  "auth_id": null,
  "payment_method": {
    "upi": {
      "channel": null,
      "upi_id": "9611199227@paytm"
    }
  },
  "payment_group": "upi"
},
"customer_details": {
  "customer_name": null,
  "customer_id": "7112AAA812234",
  "customer_email": "test@gmail.com",
  "customer_phone": "9908734801"
},
"payment_gateway_details": {
  "gateway_name": "CASHFREE",
  "gateway_order_id": "1634766330",
  "gateway_payment_id": "1504280029",
  "gateway_order_reference_id": "abc_124",
  "gateway_settlement": "CASHFREE",
  "gateway_status_code": null
},
"payment_offers": [
  {
    "offer_id": "0f05e1d0-fbf8-4c9c-a1f0-814c7b2abdba",
    "offer_type": "DISCOUNT",
    "offer_meta": {
      "offer_title": "50% off on UPI",
      "offer_description": "50% off for testing",
      "offer_code": "UPI50",
      "offer_start_time": "2022-11-09T06:23:25.972Z",
      "offer_end_time": "2023-02-27T18:30:00Z"
    },
    "offer_redemption": {
      "redemption_status": "SUCCESS",
      "discount_amount": 1,
      "cashback_amount": 0
    }
  }
] 
},
"event_time": "2023-08-01T11:16:10+05:30",
"type": "PAYMENT_SUCCESS_WEBHOOK" 
}

Payment User Dropped Webhook

The User Dropped Webhook notifies you when your customer abandons the payment flow. It will help you understand if customers attempted to pay or not. Some common scenarios where the transaction will be marked as USER_DROPPED are:

  • User was redirected to the bank’s OTP page, but never entered the OTP.
  • User was redirected to open the UPI app, but never entered the UPI PIN.
  • User was shown the 3ds OTP modal, but did not enter the OTP.
Version 2023-08-01
{
"data": {
"order": {
  "order_id": "order_02",
  "order_amount": 2,
  "order_currency": "INR",
  "order_tags": null
},
"payment": {
  "cf_payment_id": "975672265",
  "payment_status": "USER_DROPPED",
  "payment_amount": 2,
  "payment_currency": "INR",
  "payment_message": "User dropped and did not complete the two factor authentication",
  "payment_time": "2022-05-25T14:25:34+05:30",
  "bank_reference": "1803592531",
  "auth_id": "2980",
  "payment_method": {
    "netbanking": {
      "channel": null,
      "netbanking_bank_code": "3044",
      "netbanking_bank_name": "State Bank Of India"
    }
  },
  "payment_group": "net_banking"
},
"customer_details": {
  "customer_name": null,
  "customer_id": "7112AAA812234",
  "customer_email": "test@gmail.com",
  "customer_phone": "9611199227"
}
},
"event_time": "2022-05-25T14:35:38+05:30",
"type": "PAYMENT_USER_DROPPED_WEBHOOK"
}

Sample Payload by Payment Method

The instrument used for making a payment will vary by the payment methods used by the customer. Details of the payload by payment method are documented for reference.

{
  ...,
  "payment_method": {  
    "card": {  
      "channel": null,  
      "card_number": "470613XXXXXX2123",  
      "card_network": "visa",  
      "card_type": "credit_card",  
      "card_sub_type": "C",  
      "card_country": "IN",  
      "card_bank_name": "TEST Bank"  ,  
      "card_network_reference_id": "100212023061200000001014824849"  
    }  
  },  
  "payment_group": "credit_card",
  ...
}