curl --request POST \
--url https://app.flowglad.com/api/v1/usage-events/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"usageEvents": [
{
"subscriptionId": "<string>",
"amount": 123,
"transactionId": "<string>",
"usageDate": 0,
"properties": {},
"priceId": "<string>",
"priceSlug": "<string>"
}
]
}
'{
"usageEvents": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"customerId": "<string>",
"subscriptionId": "<string>",
"usageMeterId": "<string>",
"amount": 123,
"usageDate": 0,
"transactionId": "<string>",
"priceId": "<string>",
"billingPeriodId": "<string>",
"properties": {}
}
]
}Create multiple usage events in a single request. Supports both priceId and priceSlug for each event.
curl --request POST \
--url https://app.flowglad.com/api/v1/usage-events/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"usageEvents": [
{
"subscriptionId": "<string>",
"amount": 123,
"transactionId": "<string>",
"usageDate": 0,
"properties": {},
"priceId": "<string>",
"priceSlug": "<string>"
}
]
}
'{
"usageEvents": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"customerId": "<string>",
"subscriptionId": "<string>",
"usageMeterId": "<string>",
"amount": 123,
"usageDate": 0,
"transactionId": "<string>",
"priceId": "<string>",
"billingPeriodId": "<string>",
"properties": {}
}
]
}Show child attributes
x <= 9007199254740991A unique identifier for the transaction. This is used to prevent duplicate usage events from being created.
The date the usage occurred. If the usage occurs in a date that is outside of the current billing period, the usage will still be attached to the current billing period. Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991The internal ID of the price. If not provided, priceSlug is required.
The slug of the price. If not provided, priceId is required.
Successful response
Show child attributes
Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991x <= 9007199254740991The date the usage occurred. If the usage occurs in a date that is outside of the current billing period, the usage will still be attached to the current billing period. Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991A unique identifier for the transaction. This is used to prevent duplicate usage events from being created.
The billing period the usage belongs to. If the usage occurs in a date that is outside of the current billing period, the usage will still be attached to the current billing peirod.
Was this page helpful?