Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt

Use this file to discover all available pages before exploring further.

const { result, error } = await unprice.events.ingest({
  idempotencyKey: "idem_123",
  eventSlug: "tokens_used",
  customerId: "cus_1234567890",
  properties: {
    amount: 1
  }
});

if (error) {
  console.error(error.message);
  return;
}

console.log(result);
{
  "accepted": true
}

Request

idempotencyKey
string
required
Logical key used to deduplicate the event.
eventSlug
string
required
The event slug configured in Unprice.
customerId
string
The customer ID. Required when the API key has no default customer binding.
properties
object
required
Event properties used by meters.
timestamp
number
Optional epoch-millisecond event timestamp.