Webhooks

Webhooks are server callbacks to your server from Cashfree. Webhooks are event-based and are sent when specific events related to the transaction happen.

Configure Webhook

  • Add your webhook through the merchant dashboard (PG Dashboard > Service Alerts) for the first time. Write to care@cashfree.com to edit your Webhook endpoint.

  • Ensure you do not process duplicate events.

Webhook will be sent to your configured endpoint as a POST request with the body containing the various parameters specifying the details of each event. Each request contains an event parameter that identifies its type.

Below are the various events that can be sent to your webhook endpoint.

SUBSCRIPTION_STATUS_CHANGE

Parameter

Description

cf_event

The event for which the subscription was authorized. The value for this event is SUBSCRIPTION_STATUS_CHANGE (Alphanumeric)

cf_subReferenceId

A unique Id which was generated when the subscription was created (Numeric)

cf_status

The new status of the subscription. Click here for more subscription status values (Alphanumeric)

cf_lastStatus

The old status of the subscription. Click here for the description of different subscription status values (Alphanumeric)

cf_eventTime

The time when the event was dispatched (Alphanumeric)

signature

The hash of all parameters in request generated using secretKey. Click here for details (Alphanumeric)

SUBSCRIPTION_NEW_PAYMENT

Parameter

Description

cf_event

The event for which the subscription was authorized. The value for this event is SUBSCRIPTION_NEW_PAYMENT (Alphanumeric)

cf_subReferenceId

A unique Id which was generated when the subscription was created (Numeric)

cf_paymentId

The unique paymentId for the payment (Alphanumeric)

cf_amount

The amount of money charged for payment (Numeric)

cf_eventTime

The time when the event was dispatched (Alphanumeric)

signature

The hash of all parameters in request generated using secretKey. Click here for details (Alphanumeric)

SUBSCRIPTION_PAYMENT_DECLINED

Parameter

Description

cf_event

The event for which the subscription was authorized. The value for this event is SUBSCRIPTION_PAYMENT_DECLINED (Alphanumeric)

cf_subReferenceId

A unique Id which was generated when the subscription was created (Numeric)

cf_paymentId

The unique paymentId for the payment (Alphanumeric)

cf_amount

The amount of money charged for payment (Numeric)

cf_reasons

A possible reason for failure (Alphanumeric)

cf_eventTime

The time when the event was dispatched (Alphanumeric)

signature

The hash of all parameters in request generated using secretKey. Refer Appendix 2 for details (Alphanumeric)