Merchant Webhook

In this article, you will learn in detail about webhooks.

API Flow

API Flow

  1. Register your webhook URLs to get notified of certain events.
  2. Add customer, beneficiary any remitter details using the endpoint and use those ids while creating an order.
  3. Upload documents using Upload bulk doc endpoint and note down the bulk_doc_id and use that id to link those documents with the order.
  4. In the Create Order response, you will get a payment link to complete the payment using that URL.
  5. Once the order is created if any doc is missing use the Upload Documents endpoint to upload that document for the order.
  6. Once your payment and doc upload is completed you can hit process order to start remittance.
  7. You can get updated on order_url related to orders for approved and rejected docs.

Request Body

curl --location 'https://sandbox.cashfree.com/pg/lrs/webhooks' \
--header 'x-client-id: {client_id_lrs}' \
--header 'x-client-secret: {client_secret_lrs}' \
--header 'x-api-version: 2023-03-01' \
--data '{
  "payment_url": "https://webhook.site/da93ae47-4bdf-4b2b-9144-56e57a345592",
  "refund_url": "https://webhook.site/da93ae47-4bdf-4b2b-9144-56e57a345592",
  "order_url": "https://webhook.site/da93ae47-4bdf-4b2b-9144-56e57a345592"
}'

Event Types

IDEvent Name
1PAYMENT_UPDATE
2A2_FORM_GENERATED
3DOCUMENT_SENT_FOR_VERIFICATION
4DOCUMENT_VERIFICATION_UPDATE
5REMITTANCE_DONE
6REFUND_INITIATED
7REFUND_PROCESSED
8REFUND_HOLD
9REFUND_UPDATE
0ORDER_EXPIRED
1PROCESS_UPDATE_MISSING_DOCUMENT

Order Status

IDStatus Name
1ORDER_PAID
2ORDER_DOC_UPLOADED
3ORDER_DOC_UNDER_VERIFY
4ORDER_DOC_REJECTED
5ORDER_DOC_VERIFIED
6ORDER_REMITTANCE_DONE
7ORDER_REFUND_INITIATED
8ORDER_REFUND_DONE
9ORDER_REFUND_HOLD
0ORDER_EXPIRED

Transaction Status

IDTransaction Status Name
1TXN_SUCCESS
2TXN_FAILED
3TXN_INCOMPLETE
4TXN_PENDING
5TXN_FLAGGED
6TXN_CANCELLED
7TXN_VOID
8TXN_USER_DROPPED