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

# Event Types

> Learn about the different event types Flex sends to your webhook endpoint.

This is a list of all the event types Flex currently sends. We may add more types at any time, so when developing and maintaining your code, you should not assume this list is exhaustive.

All events follow the pattern of

```json theme={null}
{
    event_dt: integer,
    event_id: string,
    event_type: string,
    object: object
}
```

where `object` is the object that was created, updated, deleted, etc.

## Charge dispute events

<br />

**charge.dispute.closed** where `object` is the dispute object

Occurs when a dispute is closed and the dispute status changes to won or lost.

***

**charge.dispute.created** where `object` is the dispute object

Occurs whenever a customer disputes a charge with their bank (chargeback).

***

**charge.dispute.funds\_reinstated** where `object` is the dispute object

Occurs when funds are reinstated to your account after a dispute is closed. This includes partially refunded payments.

***

**charge.dispute.funds\_withdrawn** where `object` is the dispute object

Occurs when funds are removed from your account due to a dispute.

***

**charge.dispute.updated** where `object` is the dispute object

Occurs when the dispute is updated (usually with evidence).

***

## Charge and refund events

<br />

**charge.refund.updated** where `object` is the refund object

Occurs whenever a refund is updated, on selected payment methods.

***

**charge.refunded** where `object` is the charge object

Occurs whenever a charge is refunded, on selected payment methods.

## Customer events

**customer.created** where `object` is the customer object

Occurs whenever a new customer is created.

***

**customer.deleted** where `object` is the customer object

Occurs whenever a customer is deleted.

***

**customer.updated** where `object` is the customer object

Occurs whenever any property of a customer changes.

***

## Subscription events

<br />

**customer.subscription.created** where `object` is the subscription object

Occurs whenever a customer is signed up for a new plan.

***

**customer.subscription.updated** where `object` is the subscription object

Occurs whenever an existing subscription changes (e.g., plan changes, payment failure, cancellation, status transitions like `active` → `past_due`). **Not fired at subscription creation**, and not reliably fired on `trialing` → `active` transitions. To detect new subscriptions, listen to `customer.subscription.created` (gated on `status in (trialing, active)`) or `invoice.payment_succeeded`.

***

**customer.subscription.deleted** where `object` is the subscription object

Occurs whenever a customer's subscription ends.

***

## Invoice events

<br />

**invoice.created** where `object` is the invoice object

Occurs whenever a new invoice is created.

***

**invoice.finalized** where `object` is the invoice object

Occurs whenever an invoice transitions from `draft` to `open` and is ready for payment.

***

**invoice.paid** where `object` is the invoice object

Occurs whenever an invoice is paid in full. Fires alongside `invoice.payment_succeeded` for paid invoices.

***

**invoice.payment\_failed** where `object` is the invoice object

Occurs whenever an invoice payment attempt fails (e.g., declined card, insufficient funds). For subscriptions, this is typically followed by a `customer.subscription.updated` event transitioning the subscription to `past_due`.

***

**invoice.payment\_succeeded** where `object` is the invoice object

Occurs whenever an invoice payment attempt succeeds. For subscriptions, this is the most reliable signal that a customer has paid — recommended for provisioning or extending entitlements.

***

## Payment intent events

<br />

**payment\_intent.created** where `object` is the payment intent object

Occurs whenever a new PaymentIntent is created.

***

**payment\_intent.succeeded** where `object` is the payment intent object

Occurs whenever a PaymentIntent has succeeded.

***

## Refund events

<br />

**refund.created** where `object` is the refund object

Occurs whenever a refund is created, on selected payment methods.

***

**refund.updated** where `object` is the refund object

Occurs whenever a refund is updated, on selected payment methods.
