Authorizations
API key authentication
Body
application/json
Response
Usage events created successfully
curl --request POST \
--url https://api.paygentic.io/v0/usage/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"idempotencyKey": "<string>",
"entitlementId": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 123,
"price": "<string>"
}
],
"metadata": {}
}
]
}'
{
"object": "batchUsageEvents",
"successful": [
{
"id": "<string>",
"object": "usageEvent",
"idempotencyKey": "<string>",
"customerId": "<string>",
"description": "<string>",
"merchantId": "<string>",
"consumerId": "<string>",
"subscriptionId": "<string>",
"entitlementId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 2,
"price": "<string>"
}
],
"metadata": {},
"billing": {
"price": 123,
"billingEventId": "<string>"
}
}
],
"failed": [
{
"index": 123,
"error": "<string>",
"idempotencyKey": "<string>"
}
],
"summary": {
"total": 123,
"successful": 123,
"failed": 123
}
}
Creates multiple usage events in a single request. The idempotencyKey for each event is used to ensure the event is processed only once by downstream consumers, even if the same event is submitted multiple times. Duplicate submissions will be accepted and return the same response.
curl --request POST \
--url https://api.paygentic.io/v0/usage/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"idempotencyKey": "<string>",
"entitlementId": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 123,
"price": "<string>"
}
],
"metadata": {}
}
]
}'
{
"object": "batchUsageEvents",
"successful": [
{
"id": "<string>",
"object": "usageEvent",
"idempotencyKey": "<string>",
"customerId": "<string>",
"description": "<string>",
"merchantId": "<string>",
"consumerId": "<string>",
"subscriptionId": "<string>",
"entitlementId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 2,
"price": "<string>"
}
],
"metadata": {},
"billing": {
"price": 123,
"billingEventId": "<string>"
}
}
],
"failed": [
{
"index": 123,
"error": "<string>",
"idempotencyKey": "<string>"
}
],
"summary": {
"total": 123,
"successful": 123,
"failed": 123
}
}
API key authentication
Show child attributes
Usage events created successfully
batchUsageEvents
Array of successfully created usage events
Show child attributes
Array of events that failed to be created with error details
Show child attributes
Summary of batch processing results
Show child attributes