steampipe plugin install stripe

Table: stripe_plan - Query Stripe Plans using SQL

Stripe Plans is a service within Stripe that allows businesses to set up recurring payments for their products or services. It provides a way to create and manage different pricing tiers for subscriptions, including details about the billing cycle, pricing, and currency. Stripe Plans helps businesses to automate their billing process and manage subscriptions efficiently.

Table Usage Guide

The stripe_plan table provides insights into the pricing plans within Stripe. As a billing manager, explore plan-specific details through this table, including pricing, intervals, and associated products. Utilize it to uncover information about plans, such as their cost, billing frequency, and the product they are associated with.

Examples

List all plans

Explore the different plans available in your Stripe account. This can be useful for understanding your billing structure and identifying any plans that may need to be updated or changed.

select
*
from
stripe_plan;
select
*
from
stripe_plan;

List all plans with a trial period

Discover the segments that offer trial periods in your subscription plans. This can help you assess the elements within your business model that may be contributing to customer acquisition and retention.

select
id,
nickname,
trial_period_days
from
stripe_plan
where
trial_period_days > 0;
select
id,
nickname,
trial_period_days
from
stripe_plan
where
trial_period_days > 0;

List all products with their associated plans

Explore which products are linked to specific plans, allowing you to analyze the relationship between your offerings and their associated plans for better product management and strategic planning.

select
p.id,
p.name,
pl.id,
pl.nickname
from
stripe_product as p,
stripe_plan as pl
where
p.id = pl.product_id
order by
p.name,
pl.nickname;
select
p.id,
p.name,
pl.id,
pl.nickname
from
stripe_product as p,
stripe_plan as pl
where
p.id = pl.product_id
order by
p.name,
pl.nickname;

Schema for stripe_plan

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
activeboolean=, !=Whether the plan is currently available for purchase.
aggregate_usagetextSpecifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum.
amountbigintThe unit amount in cents to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit.
amount_decimaldouble precisionThe unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit.
billing_schemetextDescribes how to compute the price per period. Either per_unit or tiered.
createdtimestamp with time zone>, >=, =, <, <=Time at which the plan was created.
currencytextThree-letter ISO currency code, in lowercase. Must be a supported currency.
deletedbooleanTrue if the plan is marked as deleted.
idtext=Unique identifier for the plan.
intervaltextThe frequency at which a subscription is billed. One of day, week, month or year.
interval_countbigintThe number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months.
livemodebooleanHas the value true if the plan exists in live mode or the value false if the plan exists in test mode.
metadatajsonbSet of key-value pairs that you can attach to an plan. This can be useful for storing additional information about the plan in a structured format.
nicknametextA brief description of the plan, hidden from customers.
product_idtext=ID of the product whose pricing this plan determines.
tiersjsonbEach element represents a pricing tier. This parameter requires billing_scheme to be set to tiered.
tiers_modetextDefines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows.
transform_usagejsonbApply a transformation to the reported usage or set quantity before computing the amount billed.
trial_period_daysbigintDefault number of trial days when subscribing a customer to this plan using trial_from_plan=true.
usage_typetextConfigures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- stripe

You can pass the configuration to the command with the --config argument:

steampipe_export_stripe --config '<your_config>' stripe_plan