v1

latestOpenAPI 3.1.02026-07-222392081.7 MB
Billable events

Ingest billable events

Ingest several billable events in batch (limited to max 5000 events per request). This endpoint is idempotent, an event with the same id, will be updated if it already exists.

post/v1/events/batch

Request body

customer_idstring required

Hyperline ID or external ID of the existing customer.

event_typestring required

Type corresponding to the event. When creating a dynamic product, this type will be used to map the related events to specific prices.

timestampstring date-time required

UTC date time string in the ISO 8601 format, or milliseconds since the epoch. The event timestamp is used to retrieve the events related to a specific billing period.

Example request

[
  {
    "customer_id": "cus_CrqwefTRWBWRT",
    "event_type": "api_call",
    "timestamp": "2024-12-20T16:04:11Z",
    "record": {
      "id": "D32NAA8",
      "durationInMs": 32,
      "isVerified": true
    }
  }
]

Response

Events ingested

Example response

{
  "events_created": [
    {
      "customer_id": "cus_CrqwefTRWBWRT",
      "event_type": "api_call",
      "timestamp": "2024-12-20T16:04:11Z",
      "record": {
        "id": "D32NAA8",
        "durationInMs": 32,
        "isVerified": true
      }
    }
  ],
  "events_failed": [
    {
      "customer_id": "cus_CrqwefTRWBWRT",
      "event_type": "api_call",
      "timestamp": "2024-12-20T16:04:11Z",
      "record": {
        "id": "D32NAA8",
        "durationInMs": 32,
        "isVerified": true
      }
    }
  ]
}