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

# Event catalog

> The six events Elapse sends, when each fires, and what your server should do.

Six lifecycle events. **There are no per-second events**: the meter accrues continuously and your server hears about the moments that change what a customer is entitled to.

| Type                         | When                                                        | Merchant action                                                             |
| ---------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------------------- |
| `checkout.session.completed` | The subscriber pressed Start.                               | Provision access; the Subscription id is in `data.object.subscription`.     |
| `subscription.created`       | The meter is running on the chain.                          | Mark the customer entitled.                                                 |
| `subscription.updated`       | Paused or resumed.                                          | Sync entitlement with `data.object.status`.                                 |
| `subscription.canceled`      | The meter stopped: the subscriber, your server, or the cap. | Revoke access. `seconds_elapsed` and `amount_settled` are the final totals. |
| `invoice.settled`            | Accrued dollars were pulled for a period.                   | Book revenue. Fires mid-run in batches and once at cancel.                  |
| `invoice.payment_failed`     | A settlement could not be paid, or the cap ran out.         | Revoke access. The meter has stopped.                                       |

Every body has the same envelope: `id` (`evt_…`), `type`, `created`, `livemode`, `pending_webhooks`, and `data.object`, the object the event is about. Handle events by `evt_` id; a retry delivers the same id again.

## Payloads

These are generated from the platform's own sample objects and validated against the `Event` schema in the API reference on every build.

<AccordionGroup>
  <Accordion title="checkout.session.completed">
    ```json checkout.session.completed theme={"system"}
    {
      "id": "evt_test_checkout_session_completed",
      "object": "event",
      "type": "checkout.session.completed",
      "created": 1757160000,
      "livemode": false,
      "pending_webhooks": 1,
      "data": {
        "object": {
          "id": "cs_test000000000000",
          "object": "checkout.session",
          "status": "complete",
          "subscription": "sub_test00000000000",
          "customer": "cus_test00000000000",
          "product": "prod_test0000000000",
          "livemode": false,
          "created": 1757159910
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="subscription.created">
    ```json subscription.created theme={"system"}
    {
      "id": "evt_test_subscription_created",
      "object": "event",
      "type": "subscription.created",
      "created": 1757160000,
      "livemode": false,
      "pending_webhooks": 1,
      "data": {
        "object": {
          "id": "sub_test00000000000",
          "object": "subscription",
          "status": "active",
          "product": "prod_test0000000000",
          "customer": "cus_test00000000000",
          "checkout_session": "cs_test000000000000",
          "manage_url": "https://elapse.finance/account",
          "rate_usd_per_second": "0.004",
          "started_at": 1757159917,
          "paused_at": null,
          "canceled_at": null,
          "ended_reason": null,
          "max_duration_seconds": 3600,
          "max_escrow_usd": "14.4",
          "funded_usd": "14.4",
          "settled_usd": "0",
          "seconds_elapsed": 83,
          "currency": "ausd",
          "livemode": false,
          "created": 1757159910
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="subscription.updated">
    ```json subscription.updated theme={"system"}
    {
      "id": "evt_test_subscription_updated",
      "object": "event",
      "type": "subscription.updated",
      "created": 1757160000,
      "livemode": false,
      "pending_webhooks": 1,
      "data": {
        "object": {
          "id": "sub_test00000000000",
          "object": "subscription",
          "status": "paused",
          "product": "prod_test0000000000",
          "customer": "cus_test00000000000",
          "checkout_session": "cs_test000000000000",
          "manage_url": "https://elapse.finance/account",
          "rate_usd_per_second": "0.004",
          "started_at": 1757159917,
          "paused_at": 1757160000,
          "canceled_at": null,
          "ended_reason": null,
          "max_duration_seconds": 3600,
          "max_escrow_usd": "14.4",
          "funded_usd": "14.4",
          "settled_usd": "0",
          "seconds_elapsed": 83,
          "currency": "ausd",
          "livemode": false,
          "created": 1757159910
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="subscription.canceled" defaultOpen>
    ```json subscription.canceled theme={"system"}
    {
      "id": "evt_test_subscription_canceled",
      "object": "event",
      "type": "subscription.canceled",
      "created": 1757160000,
      "livemode": false,
      "pending_webhooks": 1,
      "data": {
        "object": {
          "id": "sub_test00000000000",
          "object": "subscription",
          "status": "canceled",
          "product": "prod_test0000000000",
          "customer": "cus_test00000000000",
          "checkout_session": "cs_test000000000000",
          "manage_url": "https://elapse.finance/account",
          "rate_usd_per_second": "0.004",
          "started_at": 1757159917,
          "paused_at": null,
          "canceled_at": 1757160000,
          "ended_reason": "canceled",
          "max_duration_seconds": 3600,
          "max_escrow_usd": "14.4",
          "funded_usd": "14.4",
          "settled_usd": "0.332",
          "seconds_elapsed": 83,
          "currency": "ausd",
          "livemode": false,
          "created": 1757159910,
          "amount_settled": "0.332"
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="invoice.settled">
    ```json invoice.settled theme={"system"}
    {
      "id": "evt_test_invoice_settled",
      "object": "event",
      "type": "invoice.settled",
      "created": 1757160000,
      "livemode": false,
      "pending_webhooks": 1,
      "data": {
        "object": {
          "id": "in_test000000000000",
          "object": "invoice",
          "subscription": "sub_test00000000000",
          "period_start": 1757159917,
          "period_end": 1757160000,
          "seconds": 83,
          "amount_settled": "0.332",
          "gross": "0.332",
          "fee": "0.00332",
          "net": "0.32868",
          "currency": "ausd",
          "status": "paid",
          "livemode": false,
          "created": 1757160000
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="invoice.payment_failed">
    ```json invoice.payment_failed theme={"system"}
    {
      "id": "evt_test_invoice_payment_failed",
      "object": "event",
      "type": "invoice.payment_failed",
      "created": 1757160000,
      "livemode": false,
      "pending_webhooks": 1,
      "data": {
        "object": {
          "id": "in_test000000000000",
          "object": "invoice",
          "subscription": "sub_test00000000000",
          "period_start": 1757159917,
          "period_end": 1757160000,
          "seconds": 0,
          "amount_settled": "0",
          "gross": "0",
          "fee": "0",
          "net": "0",
          "currency": "ausd",
          "status": "failed",
          "livemode": false,
          "created": 1757160000
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Ordering

Events for one subscription arrive in lifecycle order, but two can land within the same second. `subscription.canceled` and its final `invoice.settled` are the common pair. Key your state on the subscription id and let a canceled status win.
