events
Batch multiple events
Changed onThis endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
post/events/batch
Request
- Base URLhttps://api.getlago.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
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
- info
added the new optional request property
///
- info
- breaking
the
//////response's property format changed fromuuidto no format for status
- breaking