Webhook Schema

Payment Link webhook will be triggered when your customer makes a complete or partial payment using the payment link you shared. You will also be notified via the same webhook when the payment link gets cancelled or expired.

 {
    "data": {
        "cf_link_id": 1576977,
        "link_id": “payment_ps11”,
        "link_status": "PARTIALLY_PAID",
        "link_currency": "INR",
        "link_amount": "200.12",
        "link_amount_paid": "55.00",
        "link_partial_payments": true,
        "link_minimum_partial_amount": "11.00",
        "link_purpose": "Payment for order 10",
        "link_created_at": "2021-08-18T07:13:41",
        "customer_details": {
            "customer_phone": "9000000000",
            "customer_email": "[email protected]",
            "customer_name": "John "
        },
        "link_meta": {
            "notify_url": "https://ee08e626ecd88c61c85f5c69c0418cb5.m.pipedream.net"
        },
        "link_url": "https://payments-test.cashfree.com/links//U1mgll3c0e9g",
        "link_expiry_time": "2021-11-28T21:46:20",
        "link_notes": {
            "note_key_1": "note_value_1"
        },
        "link_auto_reminders": true,
        "link_notify": {
            "send_sms": true,
            "send_email": true,
        },
        "order": {
            "order_amount": "22.00",
            "order_id": "CFPay_U1mgll3c0e9g_ehdcjjbtckf",
            "order_expiry_time": "2021-08-18T07:34:50",
            "order_hash": "Gb2gC7z0tILhGbZUIeds",
            "transaction_id": 1021206,
            "transaction_status": "SUCCESS"
        }
    },
    "type": "PAYMENT_LINK_EVENT",
    "version": 1,
    "event_time": "2021-08-18T12:55:06+05:30"
}

Payload

FieldDescriptionExample
cf_link_idUnique Identifier (generated by Cashfree) for this Link.1543566
link_idUnique Identifier (provided by merchant) for the Link. Only for merchant reference. Use this for other link-related APIs.payment_1psw
link_statusCurrent status of the payment link. Possible values: PAID, PARTIALLY_PAID, EXPIRED, CANCELLED.PARTIALLY_PAID
link_currencyDefault is INR. International currencies are supported.INR
link_amountThe amount which merchant wants to collect for the order.500.00
link_amount_paidThe amount paid by the customer.250.00
link_partial_paymentsIndicates if partial payments are allowed or not. Default value is false. If true, customer can make partial payment.true
link_minimum_partial_amountThe minimum amount which must be paid by customer as the first payment.200.00
link_purposeA brief description for which payment must be collected. This is shown to the customer.Payment for order 10
link_created_atTime at which the link was created.2021-08-18T07:13:41
customer_detailsCustomer object, it contains customer details.
customer_nameName of the customerJohn
customer_phonePhone number of the customer9000000000
customer_emailEmail ID of the customer[email protected]
notify_urlPayment notification URLhttps://payment1notify.net
link_urlPayment link URLhttps://website.com/payments
link_expiry_timeThe date till which the link will be valid, and then it will be expired. Default value is 30 days. Format is “yyyy-mm-dd hr:min:sec”2021-11-28T21:46:20
link_notesLink notes object where you can provide any key-value pairs for your internal reference.
note_key_1note_value_1
link_auto_remindersDefault is false. Reminders will be sent to customers based on defined settings.true
link_notifyLink notify object, used to notifiy customers via SMS or an email.
send_smsDefault is true. If true, Cashfree will send the link to customer via SMS.true
send_emailDefault is true. If true and customerEmail is provided, Cashfree will send the link to customer via Email.true
orderOrder object, it contains the order details.
It gives details of the order object for the payment which triggered the webhook. It will be null for cancelled and expired link status.
order_amountOrder amount that the customer must pay.700
order_idThe order ID generated.order_10
order_expiry_timeThe date till which the order will be valid, and then it will be expired. Default value is 30 days. Format is “yyyy-mm-dd hr:min:sec”.2021-08-18T07:34:50
transaction_idTransaction IDid45466ye
transaction_statusStatus of the transaction. Possible values: Success, Failed, User_Dropped, Cancelled, Void, Pending, Flagged, Not_Attempted.SUCCESS
typeType of the webhook. PAYMENT_LINK_EVENTPAYMENT_LINK_EVENT
versionThe version of webhook. You should build your parsing logic wrt to this version.1
event_timeTime when this webhook was created.2021-08-18T12:55:06+05:30

Signature Generation

The signature must be used to verify if the request has not been tampered with. To verify the signature at your end, you will need your Cashfree Payment Gateway secret key along with the payload.

//The payload here refers to the raw request sent by 
Cashfree to your endpoint. No modifications need to be made to this payload.
{
    "data": {
        "cf_link_id": 1576977,
        "link_id": “payment_ps11”,
        "link_status": "PARTIALLY_PAID",
        "link_currency": "INR",
        "link_amount": "200.12",
        "link_amount_paid": "55.00",
        "link_partial_payments": true/false,
        "link_minimum_partial_amount": "11.00",
        "link_purpose": "Hello my friend how are you",
        "link_created_at": "2021-08-18T07:13:41",
        "customer_details": {
            "customer_phone": "9905736722",
            "customer_email": "[email protected]",
            "customer_name": "Supal "
        },
        "link_meta": {
            "notify_url": "https://ee08e626ecd88c61c85f5c69c0418cb5.m.pipedream.net"
        },
        "link_url": "https://payments-test.cashfree.com/links//U1mgll3c0e9g",
        "link_expiry_time": "2026-11-28T21:46:20",
        "link_notes": {
            "game_name": "Last Of Us 2"
        },
        "link_auto_reminders": true,
        "link_notify": {
            "send_sms": true,
            "send_email": true,
        },
        "order": {
            "order_amount": "22.00",
            "order_id": "CFPay_U1mgll3c0e9g_ehdcjjbtckf",
            "order_expiry_time": "2021-08-18T07:34:50",
            "order_hash": "Gb2gC7z0tILhGbZUIeds",
            "transaction_id": 1021206,
            "transaction_status": "SUCCESS"
        }
    },
    "type": "PAYMENT_LINK_EVENT",
    "version": 1,
    "event_time": "2021-08-18T12:55:06+05:30"
}

 



# timestamp is present in the header x-webhook-timestamp  
timestamp := 1617695238078  
  
signedPayload := $timestamp.$payload  
  
expectedSignature := Base64Encode(HMACSHA256($signedPayload, $merchantSecretKey))

📘

We send the webhook response in a form data format.