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

# 🛒 Abandoned Checkout Webhook

> Notifies external servers when a customer leaves the checkout process without completing their purchase.

## 📘 Overview

When a checkout is considered "abandoned," the system captures the cart state, user details, and sends this information to configured external endpoints. This allows for automated recovery campaigns (e.g., via email or WhatsApp) with thrid party apps..

## 🚀 Webhook Payload (JSON)

### Field Specifications

| Field          | Type   | Description                                     |
| :------------- | :----- | :---------------------------------------------- |
| `checkout_url` | string | The direct URL to resume the checkout session.  |
| `variants`     | array  | List of items left in the cart.                 |
| `phone`        | string | Customer's primary phone number.                |
| `user_details` | object | Contains `name`, `email`, and `country`.        |
| `shop_id`      | string | The unique identifier of the merchant store.    |
| `order_id`     | int64  | The internal ID of the abandoned order/session. |
| `address`      | object | Comprehensive shipping/billing address details. |

### Sample Payload

```json theme={null}
{
  "checkout_url": "https://quick.paytring.com/.......",
  "variants": [
    {
      "vairant_id": "987654321",
      "title": "Breeze Premium T-Shirt",
      "price": "999.00",
      "image_url": "https://cdn.example.com/item.jpg",
      "quantity": 1
    }
  ],
  "phone": "+919999999999",
  "user_details": {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "country": "IN"
  },
  "shop_id": "breeze-store",
  "order_id": 554433
}
```

***

## 🛠️ Testing with CURL

You can test your server's endpoint using the following command:

```bash theme={null}
curl -X POST https://your-webhook-receiver.com/abandoned \
-H "Content-Type: application/json" \
-d '{
  "checkout_url": "https://quick.paytring.com/",
  "variants": [{"vairant_id": "123", "title": "Test Product", "price": "10.00", "quantity": 1}],
  "shop_id": "test-shop",
  "user_details": {"name": "Test User", "email": "test@example.com"}
}'
```
