Skip to main content
POST
Requires the usage:write scope. See Authentication. For how usage is priced and invoiced, see Usage-based billing.

Authorizations

Authorization
string
header
required

An API key. Its scopes decide what it may call: customers:read (List and look up customers.) customers:write (Create customers, and Xero contacts where the organisation allows it.) catalogue:read (List plans and charges.) subscriptions:read (List and look up subscriptions.) subscriptions:write (Create subscriptions, change units, end and restore them.) invoices:read (List and look up invoices.) credit_notes:read (List and look up credit notes, and where their credit was applied.)

Headers

Idempotency-Key
string

1 to 255 printable characters. A retry with the same key and body returns the first response.

Required string length: 1 - 255
Example:

"usage_batch_2026-10-12T10"

Body

application/json
events
object[]
required
Required array length: 1 - 100 elements

Response

Success.

object
string
required
Allowed value: "usage_event_batch"
created
integer
required

Events stored by this request.

duplicates
integer
required

Events already stored with the same details, counted once.

rejected
integer
required

Events not stored. results says why for each. Resend them once fixed.

results
object[]
required

One entry per event, in the order they were sent.