> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).
>
> To search these docs, send a `GET` request to `https://paddle-docs-retrieval.kapa-paddle.workers.dev/?q=<question>` with a URL-encoded question. No authentication needed. It returns a JSON array of `{content, source_url}`, most relevant first.

# POST /usage-events

**Record usage events**

> **Early access (beta): usage-based billing**

Records usage events for usage-based billing. Include up to 100 events in each request.

Paddle validates every event in the batch before accepting any of them. If successful, Paddle has
accepted every event in the batch, then draws down the customer's usage balances in the
background. Each event draws down the customer's usage balance for every meter with a matching
`action`, including archived meters. Paddle accepts events for actions that don't match a meter,
but they don't draw down any usage balance.

Paddle counts each event once for a customer and action, using its `event_key` and `occurred_at`.
If you change `occurred_at` when you retry, Paddle records it as new usage.

If any event in the batch fails validation, Paddle rejects the whole batch with a `bad_request`
error and doesn't record any event in the request. The `errors` array names each failed field by
its zero-based position in the batch, like `events[1].occurred_at`. Fix or remove the events it
names and send the batch again. Two events in the same batch can't share the same `customer_id`,
`event_key`, `occurred_at` and `action`.

`occurred_at` must be no more than 60 days in the past and no more than 24 hours in the future,
measured from when Paddle receives the request. An event more than 24 hours in the future usually
means `occurred_at` is a planned time rather than when the usage happened, the date is built or
converted incorrectly, or the clock on the system recording usage is ahead. An event older than
60 days usually means it was held in a queue or retried late on your side. It can't be accepted,
and changing its `occurred_at` records new usage, so remove it from the batch before resending.
If you resend a batch Paddle already accepted after some of its events are more than 60 days old,
Paddle rejects the resend but still counts the original events.

If you get a `5xx` error or the request times out, Paddle may have recorded some events in the
batch. Send the same batch again with the same `event_key` and `occurred_at` for each event.
Paddle counts each event once. If you get a `too_many_requests` error, do the same after the
number of seconds in the `Retry-After` header.

**Required permissions:** `usage_event.write`

## Request body

- `events`: array (required) — Usage events to record. Include up to 100 events in each request. Paddle validates and records the whole batch together — if any event fails validation, Paddle doesn't record any event in the request. (Items: 1–100)
  - `event_key`: string (required) — Unique key for this usage from your system, like a request or job ID. Paddle uses `event_key` and `occurred_at` together to count each event once for a customer and action, so send both unchanged when you retry. (Length: 1–255)
  - `customer_id`: string (required) — Paddle ID of the customer who used the metered feature. (pattern: `^ctm_[a-z\d]{26}$`)
  - `action`: string (required) — Action of the meters to draw down, matching a meter's `action`. Paddle accepts events for actions that don't match a meter, but they don't draw down any usage balance. (Length: 2–64; pattern: `^[a-z][a-z0-9_]*$`)
  - `quantity`: string (required) — How much usage to record, in the unit that the meter measures, like calls or tokens. A positive decimal string with up to 9 decimal places, for example `"12"` or `"2.5"`. Paddle rejects values with more decimal places rather than rounding them. (Max length: 45; pattern: `^([1-9][0-9]{0,34}(\.[0-9]{1,9})?|0\.(?:[1-9][0-9]{0,8}|0[1-9][0-9]{0,7}|00[1-9][0-9]{0,6}|000[1-9][0-9]{0,5}|0000[1-9][0-9]{0,4}|00000[1-9][0-9]{0,3}|000000[1-9][0-9]{0,2}|0000000[1-9][0-9]?|00000000[1-9]))$`)
  - `occurred_at`: string (date-time) (required) — When the usage happened, as an RFC 3339 datetime string in UTC. Paddle uses it with `event_key` to identify the event, so send the same value when you retry. Can't be more than 24 hours in the future or more than 60 days in the past, measured in 24-hour periods from when Paddle receives the request.

### Request example

```json
{
  "events": [
    {
      "event_key": "call_7f3a9c2e",
      "customer_id": "ctm_01gw9m680k848184fpttwr0b7z",
      "action": "api_call",
      "quantity": "1",
      "occurred_at": "2026-09-15T10:15:00Z"
    },
    {
      "event_key": "tokens_9b1e4d6a",
      "customer_id": "ctm_01gw9m680k848184fpttwr0b7z",
      "action": "tokens_processed",
      "quantity": "2048",
      "occurred_at": "2026-11-20T12:00:00Z"
    }
  ]
}
```

## Response (202)

- `data`: object (required)
- `meta`: object (required) — Information about this response.
  - `request_id`: string (required) — Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.

### Response example

```json
{
  "data": {},
  "meta": {
    "request_id": "cf40234b-e140-44d1-a83f-7bbdedd88589"
  }
}
```
