steampipe plugin install stripe

Table: stripe_coupon - Query Stripe Coupons using SQL

Stripe Coupon is a feature within Stripe that allows you to create, manage, and distribute discount codes for your customers. It provides a flexible way to set up and manage coupons for various Stripe services, including subscriptions, invoices, and more. Stripe Coupon helps you attract new customers, reward loyal ones, or reactivate past customers with discounts and promotions.

Table Usage Guide

The stripe_coupon table provides insights into coupons within Stripe. As a business owner or marketing manager, explore coupon-specific details through this table, including discount values, duration, and associated metadata. Utilize it to uncover information about coupons, such as those with high discount values, the duration of the coupons, and the verification of redemption limits.

Examples

List all coupons

Explore all the promotional coupons available in your system to understand the various discount schemes you offer. This can help in assessing the effectiveness of your marketing strategies and plan future campaigns.

select
*
from
stripe_coupon;
select
*
from
stripe_coupon;

Coupons that are currently valid

Explore which coupons are currently active. This can be useful for understanding which promotional offers are available for customers at a given time.

select
id,
name
from
stripe_coupon
where
valid;
select
id,
name
from
stripe_coupon
where
valid = 1;

Coupons by popularity

Discover the segments that are most popular based on the number of times they've been redeemed. This can help prioritize marketing efforts and understand customer behavior.

select
id,
name,
times_redeemed
from
stripe_coupon
order by
times_redeemed desc;
select
id,
name,
times_redeemed
from
stripe_coupon
order by
times_redeemed desc;

Schema for stripe_coupon

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
amount_offbigintAmount (in the currency specified) that will be taken off the subtotal of any invoices for this customer.
createdtimestamp with time zone>, >=, =, <, <=Time at which the coupon was created.
currencytextIf amount_off has been set, the three-letter ISO code for the currency of the amount to take off.
deletedbooleanTrue if the customer is marked as deleted.
durationtextOne of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount.
duration_in_monthsbigintIf duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once.
idtext=Unique identifier for the coupon.
livemodebooleanHas the value true if the coupon exists in live mode or the value false if the coupon exists in test mode.
max_redemptionsbigintMaximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
metadatajsonbSet of key-value pairs that you can attach to an coupon. This can be useful for storing additional information about the coupon in a structured format.
nametextThe coupon’s full name or business name.
percent_offdouble precisionPercent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $100 invoice $50 instead.
redeem_bytimestamp with time zoneDate after which the coupon can no longer be redeemed.
times_redeemedbigintNumber of times this coupon has been applied to a customer.
validbooleanTaking account of the above properties, whether this coupon can still be applied to a customer.

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_coupon