Billing Reports
Billing Reports aggregate customer usage data across billing metrics, providing a detailed breakdown of consumption during a billing period. Reports can be generated for a customer, subscription, or specific events.
The Billing Report Object
Attributes
The unique ID for the customer.
Total usage across all billing metrics.
Indicates if this is in live mode (true) or sandbox/testing (false).
Array of objects detailing usage per event.
{
"customer": "5c5286be-ca91-47d7-92d1-4f211963fce9",
"usage": "18000.0",
"livemode": false,
"aggregated_usage": [
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "kyc_requests",
"usage": "0.0",
"billing_metric": "f579684e-d442-4b9e-bb69-3e75f6308d1e"
},
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "frame_gives_you_billing",
"usage": "18000.0",
"billing_metric": "41411633-b804-4cf0-bb75-a9fc2c35b36e"
}
]
}
Aggregated Usage Object
Attributes
The object type, always "billing_report".
The aggregation method used (e.g., "sum").
The name of the billing event.
The usage amount for this event.
The UUID of the billing metric.
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "kyc_requests",
"usage": "0.0",
"billing_metric": "f579684e-d442-4b9e-bb69-3e75f6308d1e"
}
Generate Billing Report for Customer
Generates a billing report for a specific customer within a given time range.
Parameters
The ID of the customer to get the report for.
Start date for the report period in ISO 8601 format.
End date for the report period in ISO 8601 format.
Returns
Returns a billing report object with aggregated usage for the customer.
curl "https://api.framepayments.com/api/v1/billing/reports?customer=5c5286be-ca91-47d7-92d1-4f211963fce9&from=2025-01-01T00:00:00Z&to=2025-01-31T23:59:59Z" \
-H "Authorization: Bearer API_KEY"
{
"customer": "5c5286be-ca91-47d7-92d1-4f211963fce9",
"usage": "18000.0",
"livemode": false,
"aggregated_usage": [
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "kyc_requests",
"usage": "0.0",
"billing_metric": "f579684e-d442-4b9e-bb69-3e75f6308d1e"
},
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "frame_gives_you_billing",
"usage": "18000.0",
"billing_metric": "41411633-b804-4cf0-bb75-a9fc2c35b36e"
}
]
}
Generate Billing Report By Subscription
Returns the billing report for a specific subscription in the current subscription period.
Parameters
The ID of the subscription to get the report for.
Returns
Returns a billing report object with aggregated usage for the subscription.
curl "https://api.framepayments.com/v1/billing/report/subscription?subscription=5c5286be-ca91-47d7-92d1-4f211963fce9" \
-H "Authorization: Bearer API_KEY"
{
"subscription_id": "5c5286be-ca91-47d7-92d1-4f211963fce9",
"usage": "18000.0",
"livemode": false,
"aggregated_usage": [
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "kyc_requests",
"usage": "0.0",
"billing_metric": "f579684e-d442-4b9e-bb69-3e75f6308d1e"
},
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "frame_gives_you_billing",
"usage": "18000.0",
"billing_metric": "41411633-b804-4cf0-bb75-a9fc2c35b36e"
}
]
}
Generate Report for Event
Generates a report for a specific billing event within a given time range.
Parameters
The name of the billing event to generate the report for.
The ID of the customer to get the report for.
Start date for the report period in ISO 8601 format.
End date for the report period in ISO 8601 format.
Returns
Returns a billing report object for the specified event.
curl "https://api.framepayments.com/v1/billing/report/event/bounce_for_it_m0p-p?customer=5c5286be-ca91-47d7-92d1-4f211963fce9&start_date=2025-01-01T00:00:00Z&end_date=2025-01-31T23:59:59Z" \
-H "Authorization: Bearer API_KEY"
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "kyc_requests",
"usage": "330.0",
"billing_metric": "f579684e-d442-4b9e-bb69-3e75f6308d1e",
"customer": "5c5286be-ca91-47d7-92d1-4f211963fce9",
"livemode": false
}
Generate Report for Events (Bulk)
Generates reports for multiple billing events within a given time range.
Parameters
The ID of the customer to get the report for.
Start date for the report period in ISO 8601 format.
End date for the report period in ISO 8601 format.
Comma-separated list of event names to include in the report.
Returns
Returns a billing report object with aggregated usage for the specified events.
curl "https://api.framepayments.com/v1/billing/report/events?customer=5c5286be-ca91-47d7-92d1-4f211963fce9&start_date=2025-01-01T00:00:00Z&end_date=2025-01-31T23:59:59Z&events=kyc_requests,frame_gives_you_billing" \
-H "Authorization: Bearer API_KEY"
{
"customer": "5c5286be-ca91-47d7-92d1-4f211963fce9",
"usage": "18000.0",
"livemode": false,
"aggregated_usage": [
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "kyc_requests",
"usage": "0.0",
"billing_metric": "f579684e-d442-4b9e-bb69-3e75f6308d1e"
},
{
"object": "billing_report",
"aggregation": "sum",
"event_name": "frame_gives_you_billing",
"usage": "18000.0",
"billing_metric": "41411633-b804-4cf0-bb75-a9fc2c35b36e"
}
]
}