GET
/
api
/
plans
/
{plan_id}
/
curl --request GET \
  --url https://api.uselotus.io/api/plans/{plan_id}/ \
  --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 a plan object.

lotus.get_plan(
    plan_id='plan_0569173ee6654369',
)

Authorizations

Authorization
string
headerrequired

Token-based authentication with required prefix "Token"

Path Parameters

plan_id
string
required

Query Parameters

version_currency_code
string

Filter to versions that have the currency specified by this currency code.

version_custom_type
enum<string>
default: all

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 Only
  • public_only - Public Only
  • all - All
Available options:
custom_only,
public_only,
all
version_status
enum<string>[]

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.

Available options:
active,
ended,
not_started

Response

200 - application/json
plan_id
string
required
plan_name
string
required

Name of the plan

plan_duration
enum<string> | null
required

Duration of the plan

  • monthly - Monthly
  • quarterly - Quarterly
  • yearly - Yearly
Available options:
monthly,
quarterly,
yearly,
plan_description
string | null
required

Description of the plan

external_links
object[]
required

The external links that this plan has.

num_versions
integer
required

The number of versions that this plan has.

active_version
integer
required

This plan's currently active version.

active_subscriptions
integer
required

The number of active subscriptions that this plan has across all versions.

tags
string[]
required

The tags that this plan has.

versions
object[]
required

This plan's versions.

parent_plan
object
requireddeprecated

[DEPRECATED] The parent plan that this plan has.

target_customer
object
requireddeprecated

[DEPRECATED] The target customer that this plan has.

display_version
object
requireddeprecated

[DEPRECATED] Display version has been deprecated. Use 'versions' instead. We will still return this field for now with some heuristics for figuring out what the desired version is, but it will be removed in the near future.

status
string
requireddeprecated

[DEPRECATED] The status of this plan.