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

# checkout.refunded

> Event triggered when a succeeded charge is refunded. Opt-in — enable it in your webhook settings to receive it.

<Note>
  This event is **opt-in**. You will not receive it unless you subscribe to `checkout.refunded` in your webhook settings. Contact us to enable it for your account.
</Note>

## Payload Structure

```typescript theme={null}
interface WebhookEvent {
  event_id: string;
  data: {
    id: string; // id of the checkout you originally created
    type: "deposit" | "withdrawal";
    charge: {
      id: string;
      status: string;
      from_status: string;
      amount_cents: number;
      transaction_type: "credit" | "debit";
      failure_code: string | null;
      failure_message: string | null;
    };
    customer: {
      id: string;
    };
    line_items: Array<{
      product_id: string;
      quantity: number;
    }>;
    line_items_total_amount_cents: number | null;
    subscription: {
      id: string;
      interval: "day" | "week" | "month" | "year";
      interval_count: number;
      line_items: Array<{
        product_id: string;
        sku: string;
        product_name: string;
        product_url: string;
        quantity: number;
        price_cents: number;
        total_amount_cents: number;
      }>;
      line_items_total_amount_cents: number | null;
    } | null; // null for non-subscription checkouts
  };
  type: "checkout.refunded";
}
```

## Example Response

```json theme={null}
{
  "event_id": "ev_tDaWu5aTVa2kbvDjGe55rxZpaMEmVFWB",
  "data": {
    "id": "chk_u8ThNhNory2ydjKWH5VmwsYpZA54wVGy",
    "type": "deposit",
    "charge": {
      "id": "ch_sybbteMNNfCGZN9SixJ199ZhaUjERzgA",
      "status": "refunded",
      "from_status": "succeeded",
      "amount_cents": 2500,
      "transaction_type": "credit",
      "failure_code": null,
      "failure_message": null
    },
    "customer": {
      "id": "cus_YPyZUwR9pR3zz3gWzqd69Pb2efRCacN1"
    },
    "line_items": [],
    "line_items_total_amount_cents": null,
    "subscription": null
  },
  "type": "checkout.refunded"
}
```

## Updating Your Internal Ledger

This event is triggered when a charge that previously succeeded is refunded to the customer — via the dashboard or the [Refund a Charge](/api-reference/api-v1/charges/refund) endpoint. You need to "undo" the previous action — for deposits you should deduct the balance you credited when the charge succeeded.

`checkout.refunded` differs from `checkout.returned`: a refund is deliberately issued back to the customer, while a return is a reversal initiated by the customer's bank (e.g. an ACH return or chargeback). Both reverse settled funds, so your ledger handling is typically the same.
