Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
Billing
Tax
Reporting
Data
    Overview
    Schema
    Custom reports
    Sigma API
    Create custom reports
    Write queries using Sigma
    Query data across an organization
    Sync Stripe data
    Access data within a data warehouse
    Export data to a data warehouse
    Export data to cloud storage
    Data management
    Data freshness
    Business and product data use cases
      Transactional data
      Disputes and fraud data
      All fees data
      Billing data
      Tax data
      Connected account data
      Card issuing data
    Import external data
Startup incorporation
HomeFinance automationDataBusiness and product data use cases

Query tax data

Use Sigma or Data Pipeline to retrieve tax information.

Copy page

Stripe Tax data includes various components that work together to provide a comprehensive view of your tax liability through automated calculations with Payment Links, Checkout, Subscriptions, Invoices, Custom integrations and as a platform. All tax-specific data is available in the Tax section of the schema, and the primary table is tax_transactions.

To explore tax data further, you can use additional tables that represent the components of a tax_transaction, such as tax_transaction_line_items, tax_transaction_shipping_costs, and tax_transaction_jurisdiction_details.

This diagram represents all components created during an automated tax calculation and how it relates to the original object that triggered calculation. Amounts in the examples below appear in minor currency units (for example, cents instead of dollars).

Tax transactions

Each row in the tax_transactions table represents a single tax_transaction object. Tax transactions record the assumed or reduced tax liability for a transaction or reversal. You can report on every tax transaction created with automated tax calculations.

This table is our recommended starting point for creating reports on your tax liability. You need to join on the other tax tables below for your tax liability amounts, but this table joins your data to other products like invoices and checkout sessions. Joining to non-tax tables by source_id and source_type provides the object that triggers the creation of the tax transaction.

Tax transactions have a one-to-one relationship with their original source object. The following example retrieves a list of reportable tax transactions with their original source of invoices, which you can then expand on with query billing data.

select tx.id as tax_transaction_id, tx.posted_at as tax_transaction_posted_at, inv.id as invoice_id, inv.total as invoice_total from tax_transactions tx inner join invoices inv on inv.id = tx.source_id limit 5
tax_transaction_idtax_transaction_posted_atinvoice_idinvoice_total
tax_HPY3aMM9V4TUf882024-06-18 16:40:16 +0000in_yWu4QS6P3W6vV7X20,000
tax_yu483oSlrvu0aQc2021-06-28 00:01:21 +0000in_UAW0nQ4Kj0jYnLN189
tax_NYe1rxOirQowSfm2024-06-23 23:35:40 +0000in_BjJ4WJvmG7osTZR219
tax_yN5Dfo6Z3jWaoyG2024-06-23 23:35:40 +0000in_aZ5Zid5t5ND2ZaJ10,475
tax_2g2upA8vcdbxspl2023-07-23 04:03:06 +0000in_bRXatBCd8HWKMDn200

Tax transactions metadata

Tax transactions might have metadata set with your custom integrations. Each row in tax_transactions_metadata returns one key-value pair.

Tax transaction items

Tax line items and tax shipping costs make up the total amounts and tax liability for tax transactions. Tax line items and tax shipping costs are in their own tables, but they both contribute to amounts and total tax liability.

Tax line items

Tax line items represent line items that contribute to the sale of goods for the transaction. Each row in tax_transaction_line_items represents a single tax line item associated to the tax_transaction.

Tax shipping costs

Tax shipping costs represent shipping items that contribute to the shipment of goods for the transaction. Each row in tax_transaction_shipping_costs represents a single shipping cost associated to the tax_transaction.

Note

These tables provide high level information based on each item. A single tax transaction can have multiple line items and one shipping cost which make up the amounts for a tax transaction.

amount: This is the gross amount of the line item. When tax_behavior is inclusive, it includes tax liability amounts. When tax_behavior is exclusive (the default), it excludes tax liability amounts.

amount_tax: This is the amount of tax liability for the line item.

currency: This is the presentment currency that defines amount and amount_tax. Summing across different currencies yields unexpected results.

The following example retrieves a list of all amounts and tax liability for a given tax_transaction.

with tax_amounts as ( select li.tax_transaction_id, li.id, li.amount, li.amount_tax, li.tax_behavior, li.currency, 'line_item' as item_type from tax_transaction_line_items li union all select sc.tax_transaction_id, sc.id, sc.amount, sc.amount_tax, sc.tax_behavior, sc.currency, 'shipping_cost' as item_type from tax_transaction_shipping_costs sc ) select id, amount, amount_tax, tax_behavior, currency, item_type from tax_amounts where tax_transaction_id = 'tax_d2e5470dC63u'
idamountamount_taxtax_behaviorcurrencyitem_type
tax_li_of6V4YuFS44Ig4X3,1000exclusiveusdline_item
tax_li_WlmuaDjDtV1vSKY1,999190exclusiveusdline_item
tax_li_8bGpk73hvmLSU4y3,500304inclusiveusdline_item
tax_li_phtc4vcK3pMgK8g4,242242exclusiveusdline_item
tax_li_joWOwNBSwaNu4Qg7990exclusiveusdshipping_cost

Tax transaction line items metadata

Tax transaction line items might have metadata set with your custom integrations. Each row in tax_transaction_line_items_metadata returns one key-value pair.

Tax transaction jurisdiction details

Each row in the tax_transaction_jurisdiction_details table represents a jurisdiction which makes up the liability for the tax transaction item (tax_transaction_line_item or tax_transaction_shipping_cost).

Understanding jurisdiction details

This table provides more in-depth information based on each jurisdiction. A single tax transaction item can have multiple jurisdictions which make up the amounts for a tax transaction item.

Summing amount_taxable or amount_non_taxable across all jurisdiction details doesn’t always equal the tax transaction item’s amount.

amount_taxable: This is the amount up to the tax transaction item’s amount that is taxable. Multiple jurisdictions can have the same taxable amount.

amount_non_taxable: This is the amount up to the tax transaction item amount that is non-taxable. Multiple jurisdictions can have the same non-taxable amount.

amount_tax: This is part of the tax transaction item amount_tax. Summing this across all jurisdiction details equals the transaction item’s amount_tax.

currency: This is the presentment currency that defines amount_taxable, amount_non_taxable and amount_tax. Summing across different currencies yields unexpected results.

filing_currency: This is the filing currency used by the applicable tax authority which defines filing_amount_taxable, filing_amount_non_taxable and filing_amount_tax. Summing across different filing currencies yields unexpected results.

The following example retrieves all jurisdiction details for a given tax transaction item.

select jd.amount_taxable, jd.amount_non_taxable, jd.amount_tax, jd.taxability_reason, jd.jurisdiction_level, jd.jurisdiction_name, concat(jd.jurisdiction_country, '-', jd.jurisdiction_state) as jurisdiction_location from tax_transaction_jurisdiction_details jd where li.id = 'tax_li_52d37cdd6f7'
amount_taxableamount_non_taxableamount_taxtaxability_reasonjurisdiction_leveljurisdiction_namejurisdiction_location
01,2990not_subject_to_taxcountryUnited States
1,299077standard_ratedstateCaliforniaUS-CA
1,299016standard_ratedcountySan DiegoUS-CA
1,29907standard_rateddistrictTransactions and Use Tax (CLVT)US-CA
1,29907standard_rateddistrictTransactions and Use Tax (CVGT)US-CA
1,29907standard_rateddistrictRegional Transportation Commission (SDCT)US-CA

Example queries

For additional examples, please reference the Tax section of query template library in Sigma sidebar.

Tax liability by month

This example summarizes the tax liability imposed on line items and shipping costs grouped by month and currency.

with tax_amounts as ( select li.tax_transaction_id, li.amount, li.amount_tax, li.tax_behavior, li.currency from tax_transaction_line_items li union all select sc.tax_transaction_id, sc.amount, sc.amount_tax, sc.tax_behavior, sc.currency from tax_transaction_shipping_costs sc ), tax_liability as ( select date_format(date_trunc('month', posted_at), '%Y-%m-%d') as month, currency as presentment_currency, sum( (
monthpresentment_currencytotal_sales_excluding_taxtotal_tax
2025-05-01usd286,60043,522
2025-05-01eur30,89856
2025-04-01usd79,7762,565
2025-04-01eur55,4343,954

Tax itemized jurisdiction details

This template itemizes tax transaction jurisdiction details for the previous month to produce a customizable version of the Tax itemized export. Review the comments throughout the template to learn more about how it is customizable for your needs.

with tax_amounts as ( select li.id, li.source_line_item_id, li.amount, li.amount_tax, li.tax_behavior, li.tax_code, li.currency, li.quantity_decimal from tax_transaction_line_items li union all select sc.id, -- Shipping costs do not have source line item IDs '' as source_line_item_id, sc.amount, sc.amount_tax, sc.tax_behavior, sc.tax_code, sc.currency, -- Shipping costs do not have a quantity '' as quantity_decimal from
source_idsource_typepresentment_currencyposted_attax_date,transaction_source_item_idtransaction_item_idamountamount_taxtax_behaviortax_codejurisdiction_namejurisdiction_level…
in_Uk8VPlzViuDvF7einvoiceeur2025-04-242025-04-24il_DDq8DioWZtd2PZJtax_il_QhuwPLks35NlXLF-199-20exclusivetxcd_99999999Irelandcountry…
in_MvHFY62tlkxLB3cinvoiceusd2025-04-242025-04-24il_OcdKSlk6eWyYC0Etax_il_FkdvNbirPD2CQFu10,0001,000exclusivetxcd_99999999Rhode Islandstate…
in_2Sok32pDyPqCMnyinvoiceusd2025-04-162025-04-16il_ZBtLQQPiPX2SisFtax_il_1BxEdZASf8tyism2,999371exclusivetxcd_99999999Fire District 17district…
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc