Get Billing State
/customer-access/{subject_id}/billing-state
Get Billing State
Path Parameters
subject_id: string
The ID or external ID of the subject to get billing state for.
Returns
has_active_subscription: boolean
Whether the subject has an active subscription.
has_overage_for_usage: boolean
Whether the subject has exceeded the included usage (if any) on a usage-based rate they are subscribed to.
Get Billing State
curl https://api.uselark.ai/customer-access/$SUBJECT_ID/billing-state \
-H "X-API-Key: $LARK_API_KEY"
{
"active_subscriptions": [
{
"rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
"subscription_id": "sub_PuLvkNSP3IBCvjayBD3TXNQ6"
}
],
"has_active_subscription": true,
"has_overage_for_usage": false,
"usage_data": [
{
"included_units": 300,
"pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
"rate_name": "Compute Hours",
"used_units": "100"
}
]
}Returns Examples
{
"active_subscriptions": [
{
"rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
"subscription_id": "sub_PuLvkNSP3IBCvjayBD3TXNQ6"
}
],
"has_active_subscription": true,
"has_overage_for_usage": false,
"usage_data": [
{
"included_units": 300,
"pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
"rate_name": "Compute Hours",
"used_units": "100"
}
]
}