> ## Documentation Index
> Fetch the complete documentation index at: https://www.cashfree.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Abandoned Checkout Webhook

> Subscribe BSP endpoints to the Cashfree One Click Checkout abandoned cart webhook to receive real-time customer, address, and cart payloads for retargeting.

Cashfree One Click Checkout (OCC) webhooks notify Communications and WhatsApp Business Service Providers (BSPs) in real time when customers create abandoned carts. BSPs can add their webhook URLs to receive these events.

## How Cashfree defines an abandoned checkout

OCC checkout progresses through four steps. Cashfree uses this progression to decide when a checkout counts as abandoned, and which customer details it can include in the webhook payload.

1. **Checkout initiated**: The customer starts the checkout flow.
2. **Login completed**: Cashfree captures the customer's phone number.
3. **Address submitted**: Cashfree captures the customer's phone number, address, and email address.
4. **Order placed**: The customer completes the order. Cashfree doesn't treat this checkout as abandoned.

Cashfree marks a checkout as abandoned when a customer drops off anywhere between step 1 and step 4 and remains inactive for 30 minutes.

When a customer drops off at any point during checkout, Cashfree OCC creates an abandoned cart record in both Shopify and the Cashfree system. The record always includes the cart contents and store URL, and adds customer details as the shopper progresses:

* **Dropped after step 1 (not logged in)**: cart and store details only; no phone number or customer block.
* **Dropped after step 2 (login completed)**: phone number is included.
* **Dropped after step 3 (address submitted)**: phone number plus the full `customer` block (name, email, shipping address).

Merchants can use this data to retarget customers. See [Sample webhook event payload](#sample-webhook-event-payload) for examples of each variant.

Abandoned cart records can include the following fields:

| Field | Description | Included |
| - | - | - |
| **Store URL** (`storeUrl`) | Identifies the Shopify store. | Always |
| **Cart details** (`lineItems`) | The items in the cart. | Always |
| **UTM parameters** (`utmParameters`) | Marketing parameters captured when the customer initiated checkout. | Always |
| **Abandoned checkout URL** (`abandonedCheckoutUrl`) | Link to the merchant's Shopify store with the OCC page preloaded and previous information pre-filled. Use this URL for retargeting. | Always |
| **Total price** (`totalPrice`) | Final payable amount for the customer. | Always |
| **Phone number** (`phone`) | Customer's phone number. | Only if the customer completed login (dropped off at step 2 or later) |
| **Customer details** (`customer`) | Name, email address, and shipping address. | Only if the customer submitted the complete address (dropped off at step 3) |
| **Promotions** (`promotions`) | List of discounts, if the customer applied any. | If the customer applied a discount |

Cashfree OCC triggers webhooks only for abandoned carts, not for completed checkouts. Once a BSP adds a webhook URL, it begins receiving events. To enable this, merchants must ask the BSP to share the webhook URL where Cashfree should send data.

> [!NOTE]
>
> Cashfree doesn't send abandoned checkouts to Shopify if a login is required in the native checkout settings.

## Adding a webhook endpoint

To start receiving abandoned cart webhooks from Cashfree One Click Checkout (OCC), follow these steps.

**1. Log in to the Merchant Dashboard**

Log in to the **[Merchant Dashboard](https://merchant.cashfree.com/auth/login)**.

**2. Open the webhooks configuration page**

Go to **Payment Gateway > Developers > Webhooks > Configuration > Payment Gateway** tab.

**3. Add a webhook endpoint**

On the **Webhooks** page, select **Add Webhook Endpoints**.

**4. Enter the endpoint details**

In the **Endpoint Details** section:

* Enter the **endpoint URL** where you want to receive webhook data.
* Select **Test** to verify the URL.
* From the drop-down menu, select **Webhook Version: 2025-01-01**.
* Select **Continue**.

![Endpoint Details section showing the endpoint URL field, Test button, and webhook version drop-down](https://mintcdn.com/cashfreepayments-d00050e9/IZHwxw1JPraq_7pF/static/images/occ/endpoint-details.png?fit=max\&auto=format\&n=IZHwxw1JPraq_7pF\&q=85\&s=e19a7dd9d812a56bc622246cc95a27e8)

Endpoint Details section of the Add Webhook Endpoints flow

**5. Add a retry policy and select events**

In the **Add Policy** section:

* Choose a **retry policy**. The default policy includes **3 retries**.
* Select the relevant **events** to subscribe to.
* Optionally, add another **retry policy** if needed.
* Select **Continue**.

![Add Policy section showing retry policy options and selected events, including abandoned checkout](https://mintcdn.com/cashfreepayments-d00050e9/IZHwxw1JPraq_7pF/static/images/occ/add-policy.png?fit=max\&auto=format\&n=IZHwxw1JPraq_7pF\&q=85\&s=473f6c1ac5d87f52a84117e96c1e34ae)

Add Policy section of the Add Webhook Endpoints flow

**6. Review and save**

In the **Summary** section:

* Review the configuration.
* Select **Update Secret Key**, then select **Update** in the confirmation pop-up. This generates the custom secret key that Cashfree uses to sign this webhook's payload. This key is separate from your Cashfree PG secret key.
* Select **Save**.

![Summary section showing the configuration review and Update Secret Key button](https://mintcdn.com/cashfreepayments-d00050e9/IZHwxw1JPraq_7pF/static/images/occ/summary.png?fit=max\&auto=format\&n=IZHwxw1JPraq_7pF\&q=85\&s=e438640febc9318aceb17c82be2fbad6)

Summary section showing the Update Secret Key option

For an optional recap, watch the following video walkthrough of this process.

[YouTube video player](https://www.youtube.com/embed/mj_ccisbCZI?si=kfLRBnCvUBpBzdnE\&enablejsapi=1)

## Sample webhook event payload

The payload varies depending on the step where the customer dropped off. Select the tab that matches your scenario.

> [!NOTE]
>
> Unlike other Cashfree webhooks, which sign payloads with your Cashfree PG secret key, the abandoned checkout webhook uses a separate custom secret key. Generate or rotate this key from the **Summary** section when you [add the webhook endpoint](#adding-a-webhook-endpoint) by selecting **Update Secret Key**. Use this custom secret key, not your PG secret key, together with the payload to verify the `x-webhook-signature` header.

> [tab] Not logged in
>
> Customer dropped off before logging in (after step 1). The payload omits `phone` and `customer` because Cashfree hasn't captured the shopper's identity yet.
>
> ```json theme={"dark"}
>     {
>       "data": {
>         "cart_id": "32868848",
>         "store_url": "gcf-test-101.myshopify.com",
>         "cart_token": "hWN6DkSJe6sGaGkHft0es77c?key=61ff137efca84c5de49a6b3304be4d6c",
>         "abandoned_checkout_url": "https://api.cashfree.com/pg/view/sessions/checkout/web/N0o4OEpDiqSdBVY0KlYt",
>         "original_total_price": 201,
>         "total_price": 1,
>         "total_discount": 0,
>         "utm_parameters": {
>           "fbclid": "",
>           "utm_campaign": "",
>           "utm_medium": "",
>           "utm_content": "",
>           "utm_source": ""
>         },
>         "line_items": [
>           {
>             "reference": "9652835221780",
>             "variant_id": "49734122930452",
>             "sku_name": "",
>             "name": "Goku great shirt",
>             "description": "",
>             "details_url": "",
>             "image_url": "https://cdn.shopify.com/s/files/1/0000/0001/0002/files/goku-great-shirt.webp",
>             "image_url_cashfree_s3": "https://cashfree-checkoutcartimages-prod.cashfree.com/50279842/checkoutcartitem1",
>             "original_unit_price": 201,
>             "discounted_unit_price": 201,
>             "currency": "INR",
>             "quantity": 1,
>             "discounts": []
>           }
>         ],
>         "promotions": [
>           {
>             "code": "SHOE_AUTOMATIC",
>             "value": 200
>           }
>         ]
>       },
>       "event_time": "2025-12-09T12:00:00+05:30",
>       "type": "ABANDONED_CHECKOUT"
>     }
> ```

> [tab] Address submitted
>
> Customer logged in and submitted a complete address before dropping off (after step 3).
>
> ```json theme={"dark"}
>     {
>       "data": {
>         "cart_id": "32868848",
>         "store_url": "merchant-demo-store.myshopify.com",
>         "cart_token": "hWN6DkSJe6sGaGkHft0es77c?key=61ff137efca84c5de49a6b3304be4d6c",
>         "phone": "+91 98765 43210",
>         "abandoned_checkout_url": "https://api.cashfree.com/pg/view/sessions/checkout/web/N0o4OEpDiqSdBVY0KlYt",
>         "original_total_price": 1200,
>         "total_price": 1000,
>         "total_discount": 200,
>         "utm_parameters": {
>           "fbclid": "",
>           "utm_campaign": "",
>           "utm_medium": "",
>           "utm_content": "",
>           "utm_source": ""
>         },
>         "line_items": [
>           {
>             "reference": "9652835221780",
>             "variant_id": "49734122930452",
>             "sku_name": "",
>             "name": "Running Shoes - Blue",
>             "description": "",
>             "details_url": "",
>             "image_url": "https://cdn.shopify.com/s/files/1/0000/0001/0002/files/running-shoes-blue.webp",
>             "image_url_cashfree_s3": "https://cashfree-checkoutcartimages-prod.cashfree.com/1234567890/checkoutcartitem1",
>             "original_unit_price": 1200,
>             "discounted_unit_price": 1000,
>             "currency": "INR",
>             "quantity": 1,
>             "discounts": []
>           }
>         ],
>         "promotions": [
>           {
>             "code": "SHOE_AUTOMATIC",
>             "value": 200
>           }
>         ],
>         "customer": {
>           "email": "aditi.sharma@example.com",
>           "first_name": "Aditi",
>           "last_name": "Sharma",
>           "shipping_address": {
>             "customer_name": "Aditi Sharma",
>             "address1": "221B, MG Road",
>             "address2": "",
>             "city": "Bengaluru",
>             "province": "Karnataka",
>             "country": "India",
>             "zip": "560001",
>             "email": "aditi.sharma@example.com",
>             "phone": "+91 98765 43210",
>             "province_code": "KA",
>             "country_code": "IN"
>           }
>         }
>       },
>       "event_time": "2025-12-09T12:00:00+05:30",
>       "type": "ABANDONED_CHECKOUT"
>     }
> ```

> [tab] Login completed
>
> Customer logged in but dropped off before submitting an address (after step 2).
>
> ```json theme={"dark"}
>     {
>       "data": {
>         "cart_id": "32868848",
>         "store_url": "merchant-demo-store.myshopify.com",
>         "cart_token": "hWN6DkSJe6sGaGkHft0es77c?key=61ff137efca84c5de49a6b3304be4d6c",
>         "phone": "+91 98765 43210",
>         "abandoned_checkout_url": "https://api.cashfree.com/pg/view/sessions/checkout/web/N0o4OEpDiqSdBVY0KlYt",
>         "original_total_price": 1200,
>         "total_price": 1000,
>         "total_discount": 200,
>         "utm_parameters": {
>           "fbclid": "",
>           "utm_campaign": "",
>           "utm_medium": "",
>           "utm_content": "",
>           "utm_source": ""
>         },
>         "line_items": [
>           {
>             "reference": "9652835221780",
>             "variant_id": "49734122930452",
>             "sku_name": "",
>             "name": "Running Shoes - Blue",
>             "description": "",
>             "details_url": "",
>             "image_url": "https://cdn.shopify.com/s/files/1/0000/0001/0002/files/running-shoes-blue.webp",
>             "image_url_cashfree_s3": "https://cashfree-checkoutcartimages-prod.cashfree.com/1234567890/checkoutcartitem1",
>             "original_unit_price": 1200,
>             "discounted_unit_price": 1000,
>             "currency": "INR",
>             "quantity": 1,
>             "discounts": []
>           }
>         ],
>         "promotions": [
>           {
>             "code": "SHOE_AUTOMATIC",
>             "value": 200
>           }
>         ]
>       },
>       "event_time": "2025-12-09T12:00:00+05:30",
>       "type": "ABANDONED_CHECKOUT"
>     }
> ```

## Webhook headers

Each webhook request contains the following headers for validation and tracing.

| **Header key** | **Description** |
| - | - |
| `x-datadog-sampling-priority` | Indicates trace sampling priority. A value of 1 means the trace is retained. |
| `x-datadog-parent-id` | ID of the parent span in a distributed trace. |
| `x-datadog-trace-id` | Unique ID for the trace across services. |
| `content-length` | Size of the request body in bytes. |
| `x-webhook-attempt` | Number of delivery attempts. |
| `content-type` | MIME type of the request body (`application/json`). |
| `x-webhook-signature` | Cryptographic signature for payload integrity. |
| `x-idempotency-key` | Unique key to prevent duplicate processing. |
| `x-webhook-timestamp` | Unix timestamp (in milliseconds) indicating when the webhook was sent. |
| `x-webhook-version` | Version of the webhook payload (for example, `2025-01-01`). |
| `accept` | Acceptable media types in the response (`*/*`). |
| `host` | Receiving server domain (for example, `webhook.site`). |
| `user-agent` | Client software sending the request (for example, `ReactorNetty/1.1.11`). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.