Skip to content

Webhooks in Cashfree

  1. Overview
  2. Webhook Configuration
  3. Account Aggregator Webhooks
  4. International Payments (Import) Webhooks
  5. Subscription Webhooks
  6. Video KYC Webhooks
  7. Bank Account Verification Webhooks
  8. Security & Signature Verification
  9. Best Practices

Webhooks are server-to-server callbacks from Cashfree to your application. They provide real-time event notifications for various services including payments, verifications, and KYC processes.

  • Event-driven: Triggered when specific events occur
  • Asynchronous: Non-blocking notifications
  • Secure: HMAC-SHA256 signature verification
  • Reliable: Automatic retries on failures

graph TB
    A[Login to Merchant Dashboard] --> B[Navigate to Developers Section]
    B --> C[Click Webhooks under Secure ID/Payments]
    C --> D[Click Add Webhook URL]
    D --> E[Enter HTTPS Webhook URL]
    E --> F[Click Test & Add Webhook]
    F --> G{Test Successful?}
    G -->|Yes| H[Webhook Configured]
    G -->|No| I[Check URL & Retry]
    I --> E
  • URL: Must be publicly accessible HTTPS endpoint
  • Method: POST requests only
  • Format: JSON payload
  • Response: Return 200 OK status within 5 seconds
  • Retry Logic: Automatic retries with exponential backoff

Account Aggregator webhooks notify you about consent status changes and financial information retrieval events.

sequenceDiagram
    participant F as Frontend
    participant B as Backend
    participant CF as Cashfree API
    participant W as Webhook Endpoint
    
    Note over F,W: Consent Request Flow
    F->>B: User initiates AA consent
    B->>CF: POST /aa/consent/request
    activate CF
    CF-->>B: consent_verification_id
    deactivate CF
    B-->>F: Display consent URL
    
    F->>F: User approves consent
    
    CF->>W: POST webhook (AA_CONSENT_VERIFICATION_SUCCESS)
    activate W
    W->>W: Verify signature
    W->>W: Process consent approval
    W-->>CF: 200 OK
    deactivate W
    
    Note over F,W: Financial Info Request Flow
    B->>CF: POST /aa/fi/request
    activate CF
    CF-->>B: fi_verification_id
    deactivate CF
    
    CF->>W: POST webhook (AA_FI_VERIFICATION_ACTIVE)
    activate W
    W->>W: Verify signature
    W->>W: Update FI status
    W-->>CF: 200 OK
    deactivate W
    
    B->>CF: GET /aa/fi/fetch
    activate CF
    CF-->>B: Financial data
    deactivate CF
    B-->>F: Display financial info

Event: Consent approved by user

Payload from Backend (API Request):

{
"redirect_url": "https://yourapp.com/aa/callback",
"consent_options": {
"duration": {
"unit": "MONTH",
"value": 12
},
"fetch_type": "ONETIME",
"frequency_type": "MONTHLY",
"frequency_value": 1
},
"fi_types": ["DEPOSIT"],
"consent_description": "Access to bank statements"
}

Webhook from Cashfree:

{
"event_type": "AA_CONSENT_VERIFICATION_SUCCESS",
"event_time": "2024-02-15 16:53:15",
"version": "v1",
"data": {
"status": "SUCCESS",
"consent_verification_id": "a12bc34def56789"
}
}

Response to Cashfree:

{
"status": "received",
"message": "Webhook processed successfully"
}

Webhook from Cashfree:

{
"event_type": "AA_CONSENT_VERIFICATION_REJECTED",
"event_time": "2024-02-15 16:55:20",
"version": "v1",
"data": {
"status": "REJECTED",
"consent_verification_id": "a12bc34def56789"
}
}

Webhook from Cashfree:

{
"event_type": "AA_CONSENT_VERIFICATION_EXPIRED",
"event_time": "2024-02-20 16:53:15",
"version": "v1",
"data": {
"status": "EXPIRED",
"consent_verification_id": "a12bc34def56789"
}
}

Payload from Backend (API Request):

{
"consent_verification_id": "a12bc34def56789",
"data_range": {
"from": "2023-01-01",
"to": "2024-01-31"
}
}

Webhook from Cashfree:

{
"event_type": "AA_FI_VERIFICATION_SUCCESS",
"event_time": "2024-02-15 16:53:15",
"version": "v1",
"data": {
"status": "READY",
"fi_verification_id": "v1234567890abcdef",
"fi_status_response": [
{
"fip_id": "FIP_1",
"accounts": [
{
"link_ref_number": "b2328fa7-0dcd-2314-asb5-9ef7b4c1cz6b",
"fi_status": "READY"
}
]
}
]
}
}

Webhook from Cashfree:

{
"event_type": "AA_FI_VERIFICATION_FAILED",
"event_time": "2024-02-15 16:54:00",
"version": "v1",
"data": {
"status": "FAILED",
"fi_verification_id": "v1234567890abcdef",
"error": "FIP_TIMEOUT"
}
}
content-length: 1099
x-webhook-attempt: 1
content-type: application/json
x-webhook-signature: 07r5C3VMwsGYeldGOCYxe5zoHhIN1zLfa8O0U/yngHI=
x-webhook-timestamp: 1746427759733

These webhooks notify merchants about payment verification status updates for international collections from India.

sequenceDiagram
    participant C as Customer
    participant F as Frontend
    participant B as Backend
    participant CF as Cashfree API
    participant W as Webhook Endpoint
    
    C->>F: Make international payment
    F->>B: Process payment
    B->>CF: POST /orders (create payment)
    activate CF
    CF-->>B: order_id, cf_payment_id
    deactivate CF
    
    B-->>F: Payment confirmation
    F-->>C: Payment success
    
    Note over CF,W: Payment requires verification
    
    CF->>W: POST webhook (PAYMENT_VERIFICATION_UPDATE)
    activate W
    W->>W: Verify signature
    W->>W: Check verification_status
    W->>W: Log ACTION_REQUIRED documents
    W-->>CF: 200 OK
    deactivate W
    
    W->>B: Notify admin of pending docs
    
    Note over B,CF: Upload verification documents
    B->>CF: POST /upload-verification-details
    activate CF
    CF-->>B: Upload confirmation
    deactivate CF
    
    CF->>W: POST webhook (PAYMENT_VERIFICATION_UPDATE)
    activate W
    W->>W: Verify signature
    W->>W: Check updated status (IN_REVIEW)
    W-->>CF: 200 OK
    deactivate W
    
    Note over CF,W: Verification complete
    CF->>W: POST webhook (PAYMENT_VERIFICATION_UPDATE)
    activate W
    W->>W: Process completion
    W-->>CF: 200 OK
    deactivate W

Event: PAYMENT_VERIFICATION_UPDATE

Payload from Backend (Upload Documents):

{
"cf_payment_id": "5114910634577",
"shop_or_brand_name": "TechStore Inc",
"partner_order_number": "ORD-2024-12345",
"goods_description": "Electronics - Laptop",
"invoice_number": "INV-2024-001",
"importer_name": "John International Traders",
"importer_address": "123 Business Street, Mumbai, India",
"country_of_origin": "USA",
"invoice_file": "base64_encoded_pdf_content",
"ecommerce_order_serial_number": "ECO-12345",
"hs_code": "847130",
"shipment_date": "2024-12-01",
"port_of_loading": "Los Angeles",
"awb_number": "AWB123456789"
}

Webhook from Cashfree (Initial - Action Required):

{
"data": {
"cf_payment_id": 5114910634577,
"payment_status": "SUCCESS",
"payment_verification_status": "ACTION_REQUIRED",
"payment_verification_expiry": "2024-07-12T15:19:42+05:30",
"remarks": null,
"required_details": [
{
"doc_name": "shop_or_brand_name",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null
},
{
"doc_name": "invoice_file",
"doc_type": "DOCUMENT",
"doc_status": "ACTION_REQUIRED",
"remarks": null
},
{
"doc_name": "ecommerce_order_serial_number",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null
}
]
},
"event_time": "2024-07-12T13:39:42+05:30",
"type": "PAYMENT_VERIFICATION_UPDATE"
}

Webhook from Cashfree (After Upload - In Review):

{
"data": {
"cf_payment_id": 5114910634577,
"payment_status": "SUCCESS",
"payment_verification_status": "IN_REVIEW",
"payment_verification_expiry": "2024-07-12T15:19:42+05:30",
"remarks": null,
"required_details": [
{
"doc_name": "shop_or_brand_name",
"doc_type": "VALUE",
"doc_status": "IN_REVIEW",
"remarks": null
},
{
"doc_name": "invoice_file",
"doc_type": "DOCUMENT",
"doc_status": "IN_REVIEW",
"remarks": null
}
]
},
"event_time": "2024-07-12T14:20:10+05:30",
"type": "PAYMENT_VERIFICATION_UPDATE"
}

Response to Cashfree:

{
"status": "received"
}
  • ACTION_REQUIRED: Document needs to be submitted
  • IN_REVIEW: Document submitted, under verification
  • APPROVED: Document verified successfully
  • REJECTED: Document rejected, needs resubmission

Subscription webhooks provide real-time updates on subscription lifecycle events, payment statuses, and authorization changes.

sequenceDiagram
    participant C as Customer
    participant F as Frontend
    participant B as Backend
    participant CF as Cashfree API
    participant W as Webhook Endpoint
    
    Note over C,W: Subscription Creation
    C->>F: Subscribe to service
    F->>B: Create subscription
    B->>CF: POST /subscriptions
    activate CF
    CF-->>B: cf_subReferenceId, auth_link
    deactivate CF
    B-->>F: Redirect to auth_link
    
    C->>CF: Authorize subscription
    
    CF->>W: POST webhook (SUBSCRIPTION_AUTH_STATUS)
    activate W
    W->>W: Verify signature
    W->>W: Check cf_authStatus
    W-->>CF: 200 OK
    deactivate W
    
    CF->>W: POST webhook (SUBSCRIPTION_STATUS_CHANGE)
    activate W
    W->>W: Update subscription status to ACTIVE
    W->>B: Notify subscription active
    W-->>CF: 200 OK
    deactivate W
    
    B-->>F: Subscription activated
    F-->>C: Confirmation
    
    Note over CF,W: Recurring Payment
    CF->>CF: Scheduled charge
    
    CF->>W: POST webhook (SUBSCRIPTION_NEW_PAYMENT)
    activate W
    W->>W: Verify signature
    W->>W: Record payment
    W->>B: Update customer account
    W-->>CF: 200 OK
    deactivate W
    
    Note over CF,W: Payment Failure Scenario
    CF->>CF: Failed payment attempt
    
    CF->>W: POST webhook (SUBSCRIPTION_PAYMENT_DECLINED)
    activate W
    W->>W: Verify signature
    W->>W: Log failure
    W->>B: Notify admin & customer
    W-->>CF: 200 OK
    deactivate W

Payload from Backend (Create Subscription):

{
"subscriptionId": "SUB-2024-001",
"planId": "premium_monthly",
"customerId": "CUST-12345",
"authAmount": 1,
"firstChargeDate": "2024-12-20",
"expiresOn": "2025-12-20",
"authType": "DEBITCARD",
"returnUrl": "https://yourapp.com/subscription/callback"
}

Webhook from Cashfree:

{
"cf_event": "SUBSCRIPTION_STATUS_CHANGE",
"cf_subReferenceId": 123456,
"cf_status": "ACTIVE",
"cf_lastStatus": "INITIALIZED",
"cf_eventTime": "2024-12-09 14:30:45",
"cf_subscriptionId": "SUB-2024-001",
"signature": "wBBgeTOZUyXgj6vySAm9fJYCtdXvlVHQCA6dV5uVssw="
}

Webhook from Cashfree:

{
"cf_event": "SUBSCRIPTION_NEW_PAYMENT",
"cf_subReferenceId": 123456,
"cf_eventTime": "2024-12-09 14:35:20",
"cf_orderId": "order_987654321",
"cf_paymentId": 111222333,
"cf_amount": 999.00,
"cf_subscriptionId": "SUB-2024-001",
"cf_merchantTxnId": "TXN-2024-001",
"cf_referenceId": 444555666,
"cf_retryAttempts": 0,
"signature": "xyz123signature..."
}

Action in Backend:

// Process successful payment
{
"action": "credit_account",
"subscription_id": "SUB-2024-001",
"amount": 999.00,
"next_billing_date": "2025-01-09",
"status": "active"
}

Webhook from Cashfree:

{
"cf_event": "SUBSCRIPTION_PAYMENT_DECLINED",
"cf_subReferenceId": 123456,
"cf_eventTime": "2024-12-09 14:40:00",
"cf_paymentId": 111222444,
"cf_amount": 999.00,
"cf_subscriptionId": "SUB-2024-001",
"cf_merchantTxnId": "TXN-2024-002",
"cf_referenceId": 444555777,
"cf_retryAttempts": 1,
"cf_reasons": "Insufficient funds",
"signature": "abc456signature..."
}

Action in Backend:

// Handle payment failure
{
"action": "suspend_or_retry",
"subscription_id": "SUB-2024-001",
"retry_scheduled": "2024-12-10 14:40:00",
"notify_customer": true,
"status": "payment_failed"
}

Webhook from Cashfree:

{
"cf_event": "SUBSCRIPTION_PAYMENT_CANCELLED",
"cf_subReferenceId": 123456,
"cf_eventTime": "2024-12-09 15:00:00",
"orderId": "order_987654322",
"paymentId": 111222555,
"amount": 999.00,
"subscriptionId": "SUB-2024-001",
"merchantTxnId": "TXN-2024-003",
"referenceId": 444555888,
"retryAttempts": 2,
"reasons": "Bank declined transaction",
"signature": "def789signature..."
}

Webhook from Cashfree (Failed Auth):

{
"cf_event": "SUBSCRIPTION_AUTH_STATUS",
"cf_subReferenceId": 123456,
"cf_eventTime": "2024-12-09 14:25:30",
"cf_subscriptionStatus": "AUTHENTICATION_FAILED",
"cf_authStatus": "FAILED",
"cf_subscriptionId": "SUB-2024-001",
"cf_merchantTxnId": "TXN-2024-000",
"cf_authTimestamp": "2024-12-09 14:25:00",
"cf_authFailureReason": "Card declined by issuer",
"signature": "ghi012signature..."
}

Payload from Backend (Initiate Refund):

{
"cf_payment_id": "111222333",
"refund_amount": 999.00,
"refund_note": "Customer requested cancellation",
"merchant_refund_id": "REFUND-2024-001"
}

Webhook from Cashfree:

{
"cf_event": "REFUND_STATUS_WEBHOOK",
"cf_subReferenceId": 123456,
"cf_eventTime": "2024-12-09 16:00:00",
"cf_sub_refund_id": "sub_refund_789",
"cf_payment_id": 111222333,
"cf_refund_amount": 999.00,
"cf_refund_id": 999888777,
"cf_merchant_refund_id": "REFUND-2024-001",
"cf_refund_status": "SUCCESS",
"signature": "jkl345signature..."
}
stateDiagram-v2
    [*] --> INITIALIZED: Create Subscription
    INITIALIZED --> AUTHENTICATION_FAILED: Auth Failed
    INITIALIZED --> ACTIVE: Auth Success
    ACTIVE --> PAUSED: Payment Failure
    PAUSED --> ACTIVE: Payment Success
    ACTIVE --> CANCELLED: User Cancellation
    PAUSED --> CANCELLED: Max Retries
    CANCELLED --> [*]
    AUTHENTICATION_FAILED --> [*]

Video KYC webhooks track the complete journey of a customer’s video verification process from link generation to call completion.

sequenceDiagram
    participant C as Customer
    participant F as Frontend
    participant B as Backend
    participant CF as Cashfree API
    participant W as Webhook Endpoint
    
    Note over F,W: User Creation & VKYC Initiation
    F->>B: Start KYC process
    B->>CF: POST /users (create user)
    activate CF
    CF-->>B: user_reference_id
    deactivate CF
    
    B->>CF: POST /vkyc/initiate
    activate CF
    CF-->>B: verification_id
    deactivate CF
    
    CF->>W: POST webhook (VKYC_USER_LINK_GENERATED)
    activate W
    W->>W: Verify signature
    W->>W: Store VKYC link
    W->>B: Send link to customer
    W-->>CF: 200 OK
    deactivate W
    
    B-->>F: Display VKYC link
    F-->>C: Send SMS/Email with link
    
    Note over C,CF: Customer Opens Link
    C->>CF: Access VKYC link
    CF->>CF: Aadhaar verification
    
    CF->>W: POST webhook (VKYC_USER_AADHAAR_VERIFIED)
    activate W
    W->>W: Update verification status
    W-->>CF: 200 OK
    deactivate W
    
    Note over C,CF: Schedule Call
    C->>CF: Schedule video call
    
    CF->>W: POST webhook (VKYC_USER_CALL_SCHEDULED)
    activate W
    W->>W: Log scheduled time
    W-->>CF: 200 OK
    deactivate W
    
    Note over C,CF: Join Call Queue
    C->>CF: Join at scheduled time
    
    CF->>W: POST webhook (VKYC_USER_CALL_QUEUED)
    activate W
    W->>W: Update status to queued
    W-->>CF: 200 OK
    deactivate W
    
    Note over C,CF: Video Call Session
    CF->>CF: Agent connects
    
    CF->>W: POST webhook (VKYC_USER_CALL_STARTED)
    activate W
    W->>W: Mark call in progress
    W-->>CF: 200 OK
    deactivate W
    
    CF->>CF: Complete verification
    
    CF->>W: POST webhook (VKYC_USER_CALL_COMPLETED)
    activate W
    W->>W: Process completion
    W->>W: Update customer status
    W->>B: Notify verification complete
    W-->>CF: 200 OK
    deactivate W
    
    B-->>F: Update UI - Verified
    F-->>C: KYC Complete notification

Payload from Backend (Initiate VKYC):

{
"user_id": "USER-12345",
"callback_url": "https://yourapp.com/vkyc/callback",
"redirect_url": "https://yourapp.com/vkyc/complete"
}

Webhook from Cashfree:

{
"signature": "wBBgeTOZUyXgj6vySAm9fJYCtdXvlVHQCA6dV5uVssw=",
"event_type": "VKYC_USER_LINK_GENERATED",
"event_time": "2025-05-22T03:51:14Z",
"version": "v1",
"data": {
"verification_id": "VKYC-2024-001",
"reference_id": 10449,
"user_reference_id": 10259,
"user_id": "USER-12345",
"status": "RECEIVED",
"sub_status": "LINK_GENERATED",
"vkyc_link": "https://forms.cashfree.net/verification/c8k926bpt84g",
"link_expiry": "2025-06-21",
"recording_link": "",
"meeting_schedule": ""
}
}

Action in Frontend:

// Send VKYC link to customer
{
"channel": "sms",
"recipient": "+919876543210",
"message": "Complete your Video KYC: https://forms.cashfree.net/verification/c8k926bpt84g",
"expiry": "2025-06-21"
}

Webhook from Cashfree:

{
"signature": "xyz123signature...",
"event_type": "VKYC_USER_AADHAAR_VERIFIED",
"event_time": "2025-05-22T03:55:30Z",
"version": "v1",
"data": {
"verification_id": "VKYC-2024-001",
"reference_id": 10449,
"user_reference_id": 10259,
"user_id": "USER-12345",
"status": "IN_PROGRESS",
"sub_status": "AADHAAR_VERIFIED",
"vkyc_link": "https://forms.cashfree.net/verification/c8k926bpt84g",
"link_expiry": "2025-06-21",
"recording_link": "",
"meeting_schedule": ""
}
}

Webhook from Cashfree:

{
"signature": "abc456signature...",
"event_type": "VKYC_USER_CALL_SCHEDULED",
"event_time": "2025-05-22T04:00:00Z",
"version": "v1",
"data": {
"verification_id": "VKYC-2024-001",
"reference_id": 10449,
"user_reference_id": 10259,
"user_id": "USER-12345",
"status": "IN_PROGRESS",
"sub_status": "CALL_SCHEDULED",
"vkyc_link": "https://forms.cashfree.net/verification/c8k926bpt84g",
"link_expiry": "2025-06-21",
"recording_link": "",
"meeting_schedule": "2025-05-22T10:00:00Z"
}
}

Webhook from Cashfree:

{
"signature": "def789signature...",
"event_type": "VKYC_USER_CALL_QUEUED",
"event_time": "2025-05-22T10:00:05Z",
"version": "v1",
"data": {
"verification_id": "VKYC-2024-001",
"reference_id": 10449,
"user_reference_id": 10259,
"user_id": "USER-12345",
"status": "IN_PROGRESS",
"sub_status": "CALL_QUEUED",
"vkyc_link": "https://forms.cashfree.net/verification/c8k926bpt84g",
"link_expiry": "2025-06-21",
"recording_link": "",
"meeting_schedule": "2025-05-22T10:00:00Z"
}
}

Webhook from Cashfree:

{
"signature": "ghi012signature...",
"event_type": "VKYC_USER_CALL_STARTED",
"event_time": "2025-05-22T10:02:30Z",
"version": "v1",
"data": {
"verification_id": "VKYC-2024-001",
"reference_id": 10449,
"user_reference_id": 10259,
"user_id": "USER-12345",
"status": "IN_PROGRESS",
"sub_status": "CALL_IN_PROGRESS",
"vkyc_link": "https://forms.cashfree.net/verification/c8k926bpt84g",
"link_expiry": "2025-06-21",
"recording_link": "",
"meeting_schedule": "2025-05-22T10:00:00Z"
}
}

Webhook from Cashfree:

{
"signature": "jkl345signature...",
"event_type": "VKYC_USER_CALL_COMPLETED",
"event_time": "2025-05-22T10:15:45Z",
"version": "v1",
"data": {
"verification_id": "VKYC-2024-001",
"reference_id": 10449,
"user_reference_id": 10259,
"user_id": "USER-12345",
"status": "COMPLETED",
"sub_status": "VERIFICATION_SUCCESS",
"vkyc_link": "https://forms.cashfree.net/verification/c8k926bpt84g",
"link_expiry": "2025-06-21",
"recording_link": "https://recordings.cashfree.net/vkyc-2024-001.mp4",