events

Batch multiple events

Changed on

This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.

post/events/batch

Request

Request body

Example request

{
  "events": [
    {
      "transaction_id": "transaction_1234567890",
      "external_subscription_id": "sub_1234567890",
      "code": "storage",
      "precise_total_amount_cents": "1234.56",
      "properties": {
        "gb": 10
      }
    }
  ]
}

Response

Event received

Example response

{
  "events": [
    {
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "transaction_id": "transaction_1234567890",
      "code": "storage",
      "timestamp": "2022-04-29T08:59:51.123Z",
      "precise_total_amount_cents": "1234.56",
      "properties": {
        "gb": 10
      },
      "lago_subscription_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "external_subscription_id": "sub_1234567890",
      "created_at": "2022-04-29T08:59:51Z"
    }
  ]
}

Changes