Get Metric Access
curl --request GET \
--url https://api.uselotus.io/api/metric_access/ \
--header 'X-API-KEY: <x-api-key>'
{
"access": true,
"access_per_subscription": [
{
"metric_free_limit": 123,
"metric_total_limit": 123,
"metric_usage": 123,
"subscription": {
"end_date": "2023-11-07T05:31:56Z",
"plan": {
"plan_id": "<string>",
"plan_name": "<string>",
"version": 123,
"version_id": "<string>"
},
"start_date": "2023-11-07T05:31:56Z",
"subscription_filters": []
}
}
],
"customer": {
"customer_id": "<string>",
"customer_name": "<string>",
"email": "jsmith@example.com"
},
"metric": {
"event_name": "<string>",
"metric_id": "<string>",
"metric_name": "<string>"
}
}
lotus.check_metric_access(
customer_id="cust_0569173ee6654369",
metric_id="metric_a47ac0bf",
)
Authorizations
Query Parameters
The customer_id of the customer you want to check access.
The metric_id of the metric you want to check access for.
Used if you want to restrict the access check to only plans that fulfill certain subscription filter criteria. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you.
Response
Whether or not the customer has access to this metric. The default behavior for this is whether all of the customer's plans (that have access to the metric) are below the total limit of the metric. If you have specified subscription filters, then this will be whether all of the customer's plans that match the subscription filters are below the total limit of the metric. You can customize the behavior of this flag by setting a policy in your Organization settings in the frontend.
curl --request GET \
--url https://api.uselotus.io/api/metric_access/ \
--header 'X-API-KEY: <x-api-key>'
{
"access": true,
"access_per_subscription": [
{
"metric_free_limit": 123,
"metric_total_limit": 123,
"metric_usage": 123,
"subscription": {
"end_date": "2023-11-07T05:31:56Z",
"plan": {
"plan_id": "<string>",
"plan_name": "<string>",
"version": 123,
"version_id": "<string>"
},
"start_date": "2023-11-07T05:31:56Z",
"subscription_filters": []
}
}
],
"customer": {
"customer_id": "<string>",
"customer_name": "<string>",
"email": "jsmith@example.com"
},
"metric": {
"event_name": "<string>",
"metric_id": "<string>",
"metric_name": "<string>"
}
}