API Reference
- GETAPI Overview
- SDK Setup
- Events
- Customers
- Entitlements
- Subscriptions
- Plans
- Invoices
- Credits
List plans
curl --request GET \
--url https://api.uselotus.io/api/plans/ \
--header 'Authorization: <api-key>'
[
{
"plan_id": "<string>",
"plan_name": "<string>",
"plan_duration": "monthly",
"plan_description": "<string>",
"external_links": [
{
"source": "stripe",
"external_plan_id": "<string>"
}
],
"num_versions": 123,
"active_version": 123,
"active_subscriptions": 123,
"tags": [
"<string>"
],
"versions": [
{
"recurring_charges": [
{
"name": "<string>",
"charge_timing": "in_advance",
"charge_behavior": "prorate",
"amount": 5000000000,
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 16383,
"reset_interval_unit": "day",
"reset_interval_count": 16383
}
],
"components": [
{
"billable_metric": {
"metric_id": "<string>",
"event_name": "<string>",
"property_name": "<string>",
"aggregation_type": "<string>",
"granularity": "seconds",
"event_type": "delta",
"metric_type": "counter",
"metric_name": "<string>",
"numeric_filters": [
{
"property_name": "<string>",
"operator": "gte",
"comparison_value": 123
}
],
"categorical_filters": [
{
"property_name": "<string>",
"operator": "isin",
"comparison_value": [
"<string>"
]
}
],
"is_cost_metric": true,
"custom_sql": "<string>",
"proration": "seconds"
},
"tiers": [
{
"type": "flat",
"range_start": 5000000000,
"range_end": 5000000000,
"cost_per_batch": 5000000000,
"metric_units_per_batch": 5000000000,
"batch_rounding_type": "<any>"
}
],
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 123,
"reset_interval_unit": "day",
"reset_interval_count": 123,
"prepaid_charge": {
"units": 5000000000,
"charge_behavior": "prorate"
}
}
],
"features": [
{
"feature_id": "<string>",
"feature_name": "<string>",
"feature_description": "<string>"
}
],
"price_adjustment": {
"price_adjustment_name": "<string>",
"price_adjustment_description": "<string>",
"price_adjustment_type": "percentage",
"price_adjustment_amount": 0
},
"version": 123,
"status": "active",
"plan_name": "<string>",
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"active_from": "2023-11-07T05:31:56Z",
"active_to": "2023-11-07T05:31:56Z",
"localized_name": "<string>",
"target_customers": [
{
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
}
],
"created_on": "2023-11-07T05:31:56Z",
"usage_billing_frequency": "<string>",
"flat_fee_billing_type": "in_advance",
"flat_rate": 5000000000,
"description": "<string>"
}
],
"parent_plan": {
"plan_name": "<string>",
"plan_id": "<string>"
},
"target_customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"display_version": {
"recurring_charges": [
{
"name": "<string>",
"charge_timing": "in_advance",
"charge_behavior": "prorate",
"amount": 5000000000,
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 16383,
"reset_interval_unit": "day",
"reset_interval_count": 16383
}
],
"components": [
{
"billable_metric": {
"metric_id": "<string>",
"event_name": "<string>",
"property_name": "<string>",
"aggregation_type": "<string>",
"granularity": "seconds",
"event_type": "delta",
"metric_type": "counter",
"metric_name": "<string>",
"numeric_filters": [
{
"property_name": "<string>",
"operator": "gte",
"comparison_value": 123
}
],
"categorical_filters": [
{
"property_name": "<string>",
"operator": "isin",
"comparison_value": [
"<string>"
]
}
],
"is_cost_metric": true,
"custom_sql": "<string>",
"proration": "seconds"
},
"tiers": [
{
"type": "flat",
"range_start": 5000000000,
"range_end": 5000000000,
"cost_per_batch": 5000000000,
"metric_units_per_batch": 5000000000,
"batch_rounding_type": "<any>"
}
],
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 123,
"reset_interval_unit": "day",
"reset_interval_count": 123,
"prepaid_charge": {
"units": 5000000000,
"charge_behavior": "prorate"
}
}
],
"features": [
{
"feature_id": "<string>",
"feature_name": "<string>",
"feature_description": "<string>"
}
],
"price_adjustment": {
"price_adjustment_name": "<string>",
"price_adjustment_description": "<string>",
"price_adjustment_type": "percentage",
"price_adjustment_amount": 0
},
"version": 123,
"status": "active",
"plan_name": "<string>",
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"active_from": "2023-11-07T05:31:56Z",
"active_to": "2023-11-07T05:31:56Z",
"localized_name": "<string>",
"target_customers": [
{
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
}
],
"created_on": "2023-11-07T05:31:56Z",
"usage_billing_frequency": "<string>",
"flat_fee_billing_type": "in_advance",
"flat_rate": 5000000000,
"description": "<string>"
},
"status": "<string>"
}
]
Retrieves an array of plan objects.
Out of the parameters below, duration
, exclude_tags
, include_tags
, and include_tags_all
will filter plan objects. version_currency_code
, version_custom_type
, and version_status
will filter versions within those plans. If a plan has no versions that match the filter, it will not be returned.
lotus.list_plans()
Authorizations
Token-based authentication with required prefix "Token"
Query Parameters
Filter to plans that have this duration.
monthly
- Monthlyquarterly
- Quarterlyyearly
- Yearly
monthly
, quarterly
, yearly
Filter to plans that do not have any of the tags in this list.
Filter to plans that have any of the tags in this list.
Filter to plans that have all of the tags in this list.
Filter to versions that have the currency specified by this currency code.
1
Filter to versions that have this custom type. If you choose custom_only, you will only see versions that have target customers. If you choose public_only, you will only see versions that do not have target customers.
custom_only
- Custom Onlypublic_only
- Public Onlyall
- All
custom_only
, public_only
, all
Filter to versions that have this status. Ended means it has an active_to date in the past. Not started means it has an active_from date in the future or null.
Response
The response is of type object[]
.
curl --request GET \
--url https://api.uselotus.io/api/plans/ \
--header 'Authorization: <api-key>'
[
{
"plan_id": "<string>",
"plan_name": "<string>",
"plan_duration": "monthly",
"plan_description": "<string>",
"external_links": [
{
"source": "stripe",
"external_plan_id": "<string>"
}
],
"num_versions": 123,
"active_version": 123,
"active_subscriptions": 123,
"tags": [
"<string>"
],
"versions": [
{
"recurring_charges": [
{
"name": "<string>",
"charge_timing": "in_advance",
"charge_behavior": "prorate",
"amount": 5000000000,
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 16383,
"reset_interval_unit": "day",
"reset_interval_count": 16383
}
],
"components": [
{
"billable_metric": {
"metric_id": "<string>",
"event_name": "<string>",
"property_name": "<string>",
"aggregation_type": "<string>",
"granularity": "seconds",
"event_type": "delta",
"metric_type": "counter",
"metric_name": "<string>",
"numeric_filters": [
{
"property_name": "<string>",
"operator": "gte",
"comparison_value": 123
}
],
"categorical_filters": [
{
"property_name": "<string>",
"operator": "isin",
"comparison_value": [
"<string>"
]
}
],
"is_cost_metric": true,
"custom_sql": "<string>",
"proration": "seconds"
},
"tiers": [
{
"type": "flat",
"range_start": 5000000000,
"range_end": 5000000000,
"cost_per_batch": 5000000000,
"metric_units_per_batch": 5000000000,
"batch_rounding_type": "<any>"
}
],
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 123,
"reset_interval_unit": "day",
"reset_interval_count": 123,
"prepaid_charge": {
"units": 5000000000,
"charge_behavior": "prorate"
}
}
],
"features": [
{
"feature_id": "<string>",
"feature_name": "<string>",
"feature_description": "<string>"
}
],
"price_adjustment": {
"price_adjustment_name": "<string>",
"price_adjustment_description": "<string>",
"price_adjustment_type": "percentage",
"price_adjustment_amount": 0
},
"version": 123,
"status": "active",
"plan_name": "<string>",
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"active_from": "2023-11-07T05:31:56Z",
"active_to": "2023-11-07T05:31:56Z",
"localized_name": "<string>",
"target_customers": [
{
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
}
],
"created_on": "2023-11-07T05:31:56Z",
"usage_billing_frequency": "<string>",
"flat_fee_billing_type": "in_advance",
"flat_rate": 5000000000,
"description": "<string>"
}
],
"parent_plan": {
"plan_name": "<string>",
"plan_id": "<string>"
},
"target_customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"display_version": {
"recurring_charges": [
{
"name": "<string>",
"charge_timing": "in_advance",
"charge_behavior": "prorate",
"amount": 5000000000,
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 16383,
"reset_interval_unit": "day",
"reset_interval_count": 16383
}
],
"components": [
{
"billable_metric": {
"metric_id": "<string>",
"event_name": "<string>",
"property_name": "<string>",
"aggregation_type": "<string>",
"granularity": "seconds",
"event_type": "delta",
"metric_type": "counter",
"metric_name": "<string>",
"numeric_filters": [
{
"property_name": "<string>",
"operator": "gte",
"comparison_value": 123
}
],
"categorical_filters": [
{
"property_name": "<string>",
"operator": "isin",
"comparison_value": [
"<string>"
]
}
],
"is_cost_metric": true,
"custom_sql": "<string>",
"proration": "seconds"
},
"tiers": [
{
"type": "flat",
"range_start": 5000000000,
"range_end": 5000000000,
"cost_per_batch": 5000000000,
"metric_units_per_batch": 5000000000,
"batch_rounding_type": "<any>"
}
],
"pricing_unit": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"invoicing_interval_unit": "day",
"invoicing_interval_count": 123,
"reset_interval_unit": "day",
"reset_interval_count": 123,
"prepaid_charge": {
"units": 5000000000,
"charge_behavior": "prorate"
}
}
],
"features": [
{
"feature_id": "<string>",
"feature_name": "<string>",
"feature_description": "<string>"
}
],
"price_adjustment": {
"price_adjustment_name": "<string>",
"price_adjustment_description": "<string>",
"price_adjustment_type": "percentage",
"price_adjustment_amount": 0
},
"version": 123,
"status": "active",
"plan_name": "<string>",
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"active_from": "2023-11-07T05:31:56Z",
"active_to": "2023-11-07T05:31:56Z",
"localized_name": "<string>",
"target_customers": [
{
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
}
],
"created_on": "2023-11-07T05:31:56Z",
"usage_billing_frequency": "<string>",
"flat_fee_billing_type": "in_advance",
"flat_rate": 5000000000,
"description": "<string>"
},
"status": "<string>"
}
]