steampipe plugin install stripe

Table: stripe_customer - Query Stripe Customers using SQL

Stripe is a technology company that builds economic infrastructure for the internet. Businesses of every size from new startups to public companies use the software to accept payments and manage their businesses online. Stripe combines a payments platform with applications that put revenue data at the heart of business operations.

Table Usage Guide

The stripe_customer table provides insights into customer data within Stripe. As a financial analyst, you can explore customer-specific details through this table, including payment methods, transactions, and associated metadata. Utilize it to uncover information about customers, such as their payment history, preferred payment methods, and transaction patterns.

Examples

List all customers

Explore all customer data to gain insights into your customer base and understand their activity and behavior better. This can assist in creating targeted marketing strategies and improving customer service.

select
*
from
stripe_customer;
select
*
from
stripe_customer;

Customers added in the last week

Discover the segments that represent new customers by identifying those who have been added in the past week. This can help businesses understand recent growth patterns and tailor their marketing efforts accordingly.

select
id,
name,
created
from
stripe_customer
where
created > (current_timestamp - interval '7 days')
order by
created desc;
select
id,
name,
created
from
stripe_customer
where
created > (strftime('%s', 'now') - 7 * 24 * 60 * 60)
order by
created desc;

All customers with a credit on their account

Discover the segments that consist of customers who have a credit balance on their account. This is useful to identify potential areas for revenue recovery or customer engagement.

select
id,
name,
balance,
currency
from
stripe_customer
where
balance < 0;
select
id,
name,
balance,
currency
from
stripe_customer
where
balance < 0;

All customers with an outstanding balance to add to their next invoice

Gain insights into customers who have a pending balance, which will be added to their next invoice. This helps in understanding the financial standing of the customers and planning future billing accordingly.

select
id,
name,
balance,
currency
from
stripe_customer
where
balance > 0;
select
id,
name,
balance,
currency
from
stripe_customer
where
balance > 0;

Schema for stripe_customer

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addressjsonbThe customer’s address.
balancebigintCurrent balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
createdtimestamp with time zone>, >=, =, <, <=Time at which the object was created.
currencytextThree-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
default_sourcejsonbID of the default payment source for the customer.
deletedbooleanTrue if the customer is marked as deleted.
delinquentbooleanWhen the customer’s latest invoice is billed by charging automatically, delinquent is true if the invoice’s latest charge failed. When the customer’s latest invoice is billed by sending an invoice, delinquent is true if the invoice isn’t paid by its due date. If an invoice is marked uncollectible by dunning, delinquent doesn’t get reset to false.
descriptiontextAn arbitrary string attached to the object. Often useful for displaying to users.
discountjsonbDescribes the current discount active on the customer, if there is one.
emailtext=The customer’s email address.
idtext=Unique identifier for the customer.
invoice_prefixtextThe prefix for the customer used to generate unique invoice numbers.
invoice_settingsjsonbThe customer’s default invoice settings.
livemodebooleanHas the value true if the object exists in live mode or the value false if the object exists in test mode.
metadatajsonbSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
nametextThe customer’s full name or business name.
next_invoice_sequencebigintThe suffix of the customer’s next invoice number, e.g., 0001.
phonetextThe customer’s phone number.
preferred_localesjsonbThe customer’s preferred locales (languages), ordered by preference.
shippingjsonbMailing and shipping address for the customer. Appears on invoices emailed to this customer.
tax_exempttextDescribes the customer’s tax exemption status. One of none, exempt, or reverse.
tax_idsjsonbThe customer’s tax IDs.

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_customer