For AI agents and LLMs: a structured documentation index is available at /llms.txt. Every page has a Markdown sibling — append .md to any URL. 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.

Skip to content
Paddle Docs home

Record usage events

Records usage events for usage-based billing.

Join usage-based billing early access (beta)

Usage-based billing is in early access (beta). Read how it works, then apply to join. We'll reach out if you meet the program requirements.

POST/usage-events

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.

Requires usage_event.write permission.

Request body

eventsarrayrequired
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_keystringrequired
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_idstringrequired
Example: ctm_01grnn4zta5a1mf02jjze7y2ys
Paddle ID of the customer who used the metered feature.
Pattern: ^ctm_[a-z\d]{26}$
actionstringrequired
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_]*$
quantitystringrequired
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_atstring (date-time)required
Example: 2024-10-12T07:20:50.52Z
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.

Response (202)

dataobjectrequired
metaobjectrequired
Information about this response.
request_idstringrequired
Example: b15ec92e-8688-40d4-a04d-f44cbec93355
Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.
Request
{
"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
{
"data": {},
"meta": {
"request_id": "cf40234b-e140-44d1-a83f-7bbdedd88589"
}
}

Was this page helpful?