Subscriptions
Get usage by subscription
Customers
Wallets
Invoices
Entitlements
Environments
Events
Features
Payments
Integrations
Subscriptions
Tenants
Users
Subscriptions
Get usage by subscription
Get usage for a subscription
POST
/
subscriptions
/
usage
curl --request POST \
--url https://api.cloud.flexprice.io/v1/subscriptions/usage \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"end_time": "2024-03-20T00:00:00Z",
"lifetime_usage": false,
"start_time": "2024-03-13T00:00:00Z",
"subscription_id": "123"
}'
{
"amount": 123,
"charges": [
{
"amount": 123,
"currency": "<string>",
"display_amount": "<string>",
"filter_values": {},
"meter_display_name": "<string>",
"meter_id": "<string>",
"price": {
"amount": 123,
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"created_at": "<string>",
"created_by": "<string>",
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"environment_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter_id": "<string>",
"plan_id": "<string>",
"status": "published",
"tenant_id": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": 123,
"unit_amount": 123,
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "<string>"
},
"trial_period": 123,
"type": "USAGE",
"updated_at": "<string>",
"updated_by": "<string>"
},
"quantity": 123
}
],
"currency": "<string>",
"display_amount": "<string>",
"end_time": "<string>",
"start_time": "<string>"
}
Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
Usage request
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
curl --request POST \
--url https://api.cloud.flexprice.io/v1/subscriptions/usage \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"end_time": "2024-03-20T00:00:00Z",
"lifetime_usage": false,
"start_time": "2024-03-13T00:00:00Z",
"subscription_id": "123"
}'
{
"amount": 123,
"charges": [
{
"amount": 123,
"currency": "<string>",
"display_amount": "<string>",
"filter_values": {},
"meter_display_name": "<string>",
"meter_id": "<string>",
"price": {
"amount": 123,
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"created_at": "<string>",
"created_by": "<string>",
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"environment_id": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter_id": "<string>",
"plan_id": "<string>",
"status": "published",
"tenant_id": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": 123,
"unit_amount": 123,
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "<string>"
},
"trial_period": 123,
"type": "USAGE",
"updated_at": "<string>",
"updated_by": "<string>"
},
"quantity": 123
}
],
"currency": "<string>",
"display_amount": "<string>",
"end_time": "<string>",
"start_time": "<string>"
}