Get Billing State
customer_access.retrieve_billing_state(strsubject_id) -> CustomerAccessRetrieveBillingStateResponse
/customer-access/{subject_id}/billing-state
Get Billing State
Parameters
subject_id: str
The ID or external ID of the subject to get billing state for.
Returns
Get Billing State
from lark import Lark
client = Lark(
api_key="My API Key",
)
response = client.customer_access.retrieve_billing_state(
"user_1234567890",
)
print(response.active_subscriptions)
{
"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"
}
]
}