Webhooks
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
Field | Description | Example |
---|---|---|
cf_link_id | Unique Identifier (generated by Cashfree) for this Link. | 1543566 |
link_id | Unique Identifier (provided by merchant) for the Link. Only for merchant reference. Use this for other link-related APIs. | payment_1psw |
link_status | Current status of the payment link. Possible values: PAID, PARTIALLY_PAID, EXPIRED, CANCELLED. | PARTIALLY_PAID |
link_currency | Default is INR. International currencies are supported. | INR |
link_amount | The amount which merchant wants to collect for the order. | 500.00 |
link_amount_paid | The amount paid by the customer. | 250.00 |
link_partial_payments | Indicates if partial payments are allowed or not. Default value is false. If true, customer can make partial payment. | true |
link_minimum_partial_amount | The minimum amount which must be paid by customer as the first payment. | 200.00 |
link_purpose | A brief description for which payment must be collected. This is shown to the customer. | Payment for order 10 |
link_created_at | Time at which the link was created. | 2021-08-18T07:13:41 |
customer_details | Customer object, it contains customer details. | |
customer_name | Name of the customer | John |
customer_phone | Phone number of the customer | 9000000000 |
customer_email | Email ID of the customer | [email protected] |
notify_url | Payment notification URL | https://payment1notify.net |
link_url | Payment link URL | https://website.com/payments |
link_expiry_time | The 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_notes | Link notes object where you can provide any key-value pairs for your internal reference. | |
note_key_1 | note_value_1 | |
link_auto_reminders | Default is false. Reminders will be sent to customers based on defined settings. | true |
link_notify | Link notify object, used to notifiy customers via SMS or an email. | |
send_sms | Default is true. If true, Cashfree will send the link to customer via SMS. | true |
send_email | Default is true. If true and customerEmail is provided, Cashfree will send the link to customer via Email. | true |
order | Order 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_amount | Order amount that the customer must pay. | 700 |
order_id | The order ID generated. | order_10 |
order_expiry_time | The 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_id | Transaction ID | id45466ye |
transaction_status | Status of the transaction. Possible values: Success, Failed, User_Dropped, Cancelled, Void, Pending, Flagged, Not_Attempted. | SUCCESS |
type | Type of the webhook. PAYMENT_LINK_EVENT | PAYMENT_LINK_EVENT |
version | The version of webhook. You should build your parsing logic wrt to this version. | 1 |
event_time | Time 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.
Updated 12 months ago