Skip to main content

Configure Webhook

  • You can now configure webhooks from the merchant dashboard. Click here to know how to add a new webhook.
  • Ensure you do not process duplicate events.
Webhooks 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
  • SUBSCRIPTION_NEW_PAYMENT
  • SUBSCRIPTION_PAYMENT_CANCELLED
  • SUBSCRIPTION_PAYMENT_DECLINED
  • SUBSCRIPTION_AUTH_STATUS
  • REFUND_STATUS

SUBSCRIPTION_STATUS_CHANGE

📘 The parameters “cf_subscriptionId” will be available from 31st July 2023 onwards.

SUBSCRIPTION_NEW_PAYMENT

📘 The parameters “cf_subscriptionId” and “cf_merchantTxnId” will be available from 31st July 2023 onwards.

SUBSCRIPTION_PAYMENT_CANCELLED

📘 The parameters “cf_subscriptionId” and “cf_merchantTxnId” will be available from 31st July 2023 onwards.

SUBSCRIPTION_PAYMENT_DECLINED

📘 The parameters “cf_subscriptionId” and “cf_merchantTxnId” will be available from 31st July 2023 onwards.

SUBSCRIPTION_AUTH_STATUS

📘 The parameters “cf_subscriptionId” and “cf_merchantTxnId” will be available from 31st July 2023 onwards.
The event is triggered when the checkout is completed by the customer for success and failed cases.

REFUND_STATUS


Verify Signature

Verifying the signature (passed along with the POST parameters) is mandatory before you process any response. We also recommend whitelisting only our IP address on your webhook endpoint. Follow the steps below to calculate & verify the signature on the webhook payload:
  1. Please sort the webhook payload in alphabetical order based on fields which are starting with field cf_.
  2. Append the key-value pair w/o using any delimiter and create a string.
  3. Hash the string using the secret key which will be provided to you.
  4. Encode the hashed string using base64 and generate the signature.
Example :
  1. Sample web hook payload -
  2. Sorted web hook payload -
    cf_amount1cf_eventSUBSCRIPTION_NEW_PAYMENTcf_eventTime2022-01-10 10:51:02cf_paymentId1cf_referenceId2cf_retryAttempts0cf_subReferenceId3
  3. Signature generated using encoding with secret key -
    tT9pXZkT2LuDzXacYDUaur7EX3dJgNKcITHQng44tns=
  4. Generated signature should match the signature present in the webhook payload.
Following code snippets show you how to generate and verify the signature. This should not be assumed production-ready, kindly consider adding necessary validation before processing.
Failure Reasons
📘 We send the webhook response in a form data format.