{"id":22793244,"url":"https://github.com/fivetran/dbt_stripe","last_synced_at":"2026-04-01T17:39:59.650Z","repository":{"id":39632071,"uuid":"264264565","full_name":"fivetran/dbt_stripe","owner":"fivetran","description":"Data models for Stripe built using dbt.","archived":false,"fork":false,"pushed_at":"2025-03-13T22:44:00.000Z","size":6394,"stargazers_count":41,"open_issues_count":10,"forks_count":37,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-03-31T10:04:40.742Z","etag":null,"topics":["dbt","dbt-packages","fivetran","stripe"],"latest_commit_sha":null,"homepage":"https://fivetran.github.io/dbt_stripe/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivetran.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T18:05:39.000Z","updated_at":"2025-03-25T11:25:27.000Z","dependencies_parsed_at":"2023-12-28T13:50:53.161Z","dependency_job_id":"7f701946-830f-4c19-b663-2749a5fdcd57","html_url":"https://github.com/fivetran/dbt_stripe","commit_stats":{"total_commits":475,"total_committers":20,"mean_commits":23.75,"dds":"0.47578947368421054","last_synced_commit":"17222c8207c4dff00d9ac5fbdf3adf4f7c60b192"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_stripe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_stripe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_stripe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_stripe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivetran","download_url":"https://codeload.github.com/fivetran/dbt_stripe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640461,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbt","dbt-packages","fivetran","stripe"],"created_at":"2024-12-12T03:18:45.911Z","updated_at":"2026-04-01T17:39:59.630Z","avatar_url":"https://github.com/fivetran.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--section=\"stripe_transformation_model\"--\u003e\n# Stripe dbt Package\n\nThis dbt package transforms data from Fivetran's Stripe connector into analytics-ready tables.\n\n## Resources\n\n- Number of materialized models¹: 61\n- Connector documentation\n  - [Stripe connector documentation](https://fivetran.com/docs/connectors/applications/stripe)\n  - [Stripe ERD](https://fivetran.com/docs/connectors/applications/stripe#schemainformation)\n- dbt package documentation\n  - [GitHub repository](https://github.com/fivetran/dbt_stripe)\n  - [dbt Docs](https://fivetran.github.io/dbt_stripe/#!/overview)\n  - [DAG](https://fivetran.github.io/dbt_stripe/#!/overview?g_v=1)\n  - [Changelog](https://github.com/fivetran/dbt_stripe/blob/main/CHANGELOG.md)\n- dbt Core™ supported versions\n  - `\u003e=1.3.0, \u003c3.0.0`\n  - [Decisionlog](https://github.com/fivetran/dbt_stripe/blob/main/DECISIONLOG.md)\n\n## What does this dbt package do?\nThis package enables you to better understand your Stripe transactions, enhance balance transaction entries with useful fields, and generate metrics tables for account activity analysis. It creates enriched models with metrics focused on transaction analysis, customer insights, and revenue tracking.\n\n### Output schema\nFinal output tables are generated in the following target schema:\n\n```\n\u003cyour_database\u003e.\u003cconnector/schema_name\u003e_stripe\n```\n\n### Final output tables\n\nBy default, this package materializes the following final tables:\n\n| Table | Description |\n| :---- | :---- |\n| [stripe__balance_transactions](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__balance_transactions) | Represents each change to your Stripe balance with transaction context.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat types of transactions are most impacting my Stripe balance?\u003c/li\u003e\u003cli\u003eHow much did fees, refunds, or disputes reduce net revenue this quarter?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__invoice_details](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__invoice_details) | Contains invoice records with associated charge, customer, and subscription data.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat is the average invoice value by customer segment?\u003c/li\u003e\u003cli\u003eWhich customers have the highest outstanding invoices?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__invoice_line_item_details](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__invoice_line_item_details) | Includes line items with charge, customer, subscription, and pricing details.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich products or services contribute most to total invoiced revenue?\u003c/li\u003e\u003cli\u003eAre there any products consistently discounted or refunded?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__daily_overview](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__daily_overview) | Summarizes daily and rolling Stripe transaction totals by type.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat is the trend in daily net payments and refunds?\u003c/li\u003e\u003cli\u003eWhat is the MRR trend over the last 6 months?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__subscription_details](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__subscription_details) | Contains subscription records with customer and payment metrics.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eHow many active subscriptions are there by plan or product?\u003c/li\u003e\u003cli\u003eWhat is the average customer subscription length before cancellation?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__customer_overview](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__customer_overview) | Shows customer-level metrics with transaction details and associations.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWho are the top 10 customers by total lifetime value?\u003c/li\u003e\u003cli\u003eHow many customers made a payment in the last 90 days?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__activity_itemized_2](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__activity_itemized_2) | Lists balance transactions with invoice, fee, refund, and customer data.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat are the exact transaction-level fees for each invoice or customer?\u003c/li\u003e\u003cli\u003eHow much are we paying in interchange and platform fees per transaction?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__balance_change_from_activity_itemized_3](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__balance_change_from_activity_itemized_3) | Reconciles Stripe balance changes like a detailed bank statement.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat was the source of each Stripe balance change over the last month?\u003c/li\u003e\u003cli\u003eHow accurate is my accounting ledger compared to Stripe's balance records?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__ending_balance_reconciliation_itemized_4](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__ending_balance_reconciliation_itemized_4) | Matches bank payouts with unsettled Stripe transactions.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich transactions remain unsettled as of the last payout?\u003c/li\u003e\u003cli\u003eDo all automatic payouts reconcile fully with balance changes?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__payout_itemized_3](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__payout_itemized_3) | Details expected and actual payout amounts and statuses.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhen should I expect my next payout, and for how much?\u003c/li\u003e\u003cli\u003eAre there any delayed or failed payouts that need follow-up?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__line_item_enhanced](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__line_item_enhanced) | Provides unified reporting across billing platforms on product, customer, and revenue metrics. See the [Fivetran Billing Model Streamlit App](https://fivetran-billing-model.streamlit.app/) for more details.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat are the top revenue-generating products or SKUs?\u003c/li\u003e\u003cli\u003eWhat is the average revenue per user (ARPU) by subscription plan?\u003c/li\u003e\u003c/ul\u003e |\n| [stripe__subscription_item_mrr_report](https://fivetran.github.io/dbt_stripe/#!/model/model.stripe.stripe__subscription_item_mrr_report) | Shows both contracted and billed MRR (monthly recurring revenue) with discounts applied at the subscription item level. Tracks MRR changes over time, classifying each month as new, expansion, contraction, churned, reactivation, or unchanged.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat percentage of subscription customers are churning each month as compared to new?\u003c/li\u003e\u003cli\u003eHow much subscription revenue was lost last year due to discounts?\u003c/li\u003e\u003c/ul\u003e |\n\n¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as `view`, `table`, or `incremental`.\n\n---\n\n## Visualizations\nMany of the above reports are now configurable for [visualization via Streamlit](https://github.com/fivetran/streamlit_fivetran_billing_model). Check out some [sample reports here](https://fivetran-billing-model.streamlit.app/).\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://fivetran-billing-model.streamlit.app/\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/fivetran/dbt_stripe/main/images/streamlit_example.png\" alt=\"Streamlit Billing Model App\" width=\"75%\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n## Prerequisites\nTo use this dbt package, you must have the following:\n\n- At least one Fivetran Stripe connection syncing data into your destination.\n- A **BigQuery**, **Snowflake**, **Redshift**, **Databricks**, or **PostgreSQL** destination.\n\n## How do I use the dbt package?\nYou can either add this dbt package in the Fivetran dashboard or import it into your dbt project:\n\n- To add the package in the Fivetran dashboard, follow our [Quickstart guide](https://fivetran.com/docs/transformations/data-models/quickstart-management).\n- To add the package to your dbt project, follow the setup instructions in the dbt package's [README file](https://github.com/fivetran/dbt_stripe/blob/main/README.md#how-do-i-use-the-dbt-package) to use this package.\n\n\u003c!--section-end--\u003e\n\n### Install the package\nInclude the following stripe package version in your `packages.yml` file:\n\u003e TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.\n```yaml\npackages:\n  - package: fivetran/stripe\n    version: [\"\u003e=1.6.0\", \"\u003c1.7.0\"]\n```\n\u003e All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/stripe_source` in your `packages.yml` since this package has been deprecated.\n\n#### Databricks Dispatch Configuration\nIf you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your `dbt_project.yml`. This is required in order for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively.\n```yml\ndispatch:\n  - macro_namespace: dbt_utils\n    search_order: ['spark_utils', 'dbt_utils']\n```\n\n### Define database and schema variables\nBy default, this package runs using your destination and the `stripe` schema. If this is not where your stripe data is (for example, if your stripe schema is named `stripe_fivetran`), add the following configuration to your root `dbt_project.yml` file:\n\n```yml\nvars:\n    stripe_database: your_destination_name\n    stripe_schema: your_schema_name \n```\n\n### Disable models for non-existent sources\nThis package takes into consideration that not every Stripe account utilizes the `invoice`, `invoice_line_item`, `payment_method`, `payment_method_card`, `plan`, `price`, `subscription`, `coupon`, `subscription_discount`, `transfer`, `payout`, `payout_balance_transaction`, or `credit_note` features, and allows you to disable the corresponding functionality. By default, all variables' values are assumed to be `true` with the exception of `credit_note`. Add variables for only the tables you want to disable or enable respectively:\n\n```yml\n# dbt_project.yml\n\n...\nvars:\n    stripe__using_invoices:                False  #Disable if you are not using the invoice and invoice_line_item tables.\n    stripe__using_payment_method:          False  #Disable if you are not using the payment_method and payment_method_card tables.\n    stripe__using_subscriptions:           False  #Disable if you are not using the subscription, subscription_item, and plan/price tables.\n    stripe__using_coupons:                 False  #Disable if you are not using coupon codes to apply discounts.\n    stripe__using_subscription_discounts:  False  #Disable if you are not using the subscription_discount table.\n    stripe__using_credit_notes:            True   #Enable if you are using the credit note tables.\n    stripe__using_transfers:               False  #Disable to turn off the transfer table temporarily.\n    stripe__using_payouts:                 False  #Disable to turn off the payout or payout_balance_transaction table temporarily.\n```\n### (Optional) Additional configurations\n\u003cdetails open\u003e\u003csummary\u003eExpand to view configurations\u003c/summary\u003e\n\n#### Enabling Standardized Billing Model\nThis package contains the `stripe__line_item_enhanced` model which constructs a comprehensive, denormalized analytical table that enables reporting on key revenue, subscription, customer, and product metrics from your billing platform. It's designed to align with the schema of the `*__line_item_enhanced` model found in Recurly, Recharge, Stripe, Shopify, and Zuora, offering standardized reporting across various billing platforms. To see the kinds of insights this model can generate, explore example visualizations in the [Fivetran Billing Model Streamlit App](https://fivetran-billing-model.streamlit.app/). This model is enabled by default. To disable it, set the `stripe__standardized_billing_model_enabled` variable to `false` in your `dbt_project.yml`:\n\n```yml\nvars:\n  stripe__standardized_billing_model_enabled: false # true by default.\n```\n\u003e All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/stripe_source` in your `packages.yml` since this package has been deprecated.\n\n#### Option A: Single connection\nBy default, this package runs using your destination and the `stripe` schema. If this is not where your Stripe data is (for example, if your Stripe schema is named `stripe_fivetran`), add the following configuration to your root `dbt_project.yml` file:\n\n```yml\nvars:\n    stripe_database: your_destination_name\n    stripe_schema: your_schema_name\n```\n\n#### Option B: Union multiple connections\nIf you have multiple Stripe connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. For each source table, the package will union all of the data together and pass the unioned table into the transformations. The `source_relation` column in each model indicates the origin of each record.\n\nTo use this functionality, you will need to set the `stripe_sources` variable in your root `dbt_project.yml` file:\n\n```yml\n# dbt_project.yml\n\nvars:\n  stripe:\n    stripe_sources:\n      - database: connection_1_destination_name # Required\n        schema: connection_1_schema_name # Required\n        name: connection_1_source_name # Required only if following the step in the following subsection\n\n      - database: connection_2_destination_name\n        schema: connection_2_schema_name\n        name: connection_2_source_name\n```\n\n\u003e Previous versions of this package employed two separate, mutually exclusive variables for unioning: `union_schemas` and `union_databases`. While these variables are still supported, `stripe_sources` is the recommended variable to configure.\n\n##### Recommended: Incorporate unioned sources into DAG\n\u003e *If you are running the package through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt#transformationsfordbtcore), the below step is necessary in order to synchronize model runs with your Stripe connections. Alternatively, you may choose to run the package through Fivetran [Quickstart](https://fivetran.com/docs/transformations/quickstart), which would create separate sets of models for each Stripe source rather than one set of unioned models.*\n\nBy default, this package defines one single-connection source, called `stripe`, which will be disabled if you are unioning multiple connections. This means that your DAG will not include your Stripe sources, though the package will run successfully.\n\nTo properly incorporate all of your Stripe connections into your project's DAG:\n1. Define each of your sources in a `.yml` file in your project. Utilize the following template for the `source`-level configurations, and, **most importantly**, copy and paste the table and column-level definitions from the package's `src_stripe.yml` [file](https://github.com/fivetran/dbt_stripe/blob/main/models/staging/src_stripe.yml).\n\n```yml\n# a .yml file in your root project models folder\n\nversion: 2\n\nsources:\n  - name: \u003cname\u003e # ex: Should match name in stripe_sources\n    schema: \u003cschema_name\u003e\n    database: \u003cdatabase_name\u003e\n    loader: fivetran\n    config:\n      loaded_at_field: _fivetran_synced\n      freshness: # feel free to adjust to your liking\n        warn_after: {count: 72, period: hour}\n        error_after: {count: 168, period: hour}\n\n    tables: # copy and paste from stripe/models/staging/src_stripe.yml - see https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/ for how to use anchors to only do so once\n```\n2. Set the `has_defined_sources` variable (scoped to the `stripe` package) to `True` in your root project, like such:\n```yml\n# dbt_project.yml\nvars:\n  stripe:\n    has_defined_sources: true\n```\n#### Considerations: Unioning Multiple Schemas\nPlease note, If the source table is not found in any of the provided schemas/databases, union_data will return a completely empty table (ie limit 0) with just one string column (_dbt_source_relation). A compiler warning message will be output, highlighting that the expected source table was not found and its respective staging model is empty. The compiler warning can be turned off by the end user by setting the `fivetran__remove_empty_table_warnings` variable to True.\n```yml\n# dbt_project.yml\nvars:\n  fivetran__remove_empty_table_warnings: true  # false by default\n```\n#### Leveraging Plan vs Price Sources\n\nCustomers using Fivetran with the newer [Stripe Price API](https://stripe.com/docs/billing/migration/migrating-prices) will have a `price` table, and possibly a `plan` table if that was used previously. Therefore to accommodate two different source tables we added logic to check if there exists a `price` table by default. If not, it will leverage the `plan` table. However if you wish to use the `plan` table instead, you may set `stripe__using_price` to `false` in your `dbt_project.yml` to override the macro.\n\n```yml\n# dbt_project.yml\n\n...\nconfig-version: 2\n\nvars:\n  stripe__using_price: false #  True by default. If true, will look `price ` table. If false, will look for the `plan` table. \n```\n\n#### Leveraging Subscription Vs Subscription History Sources\nFor Stripe connections set up after February 09, 2022 the `subscription` table has been replaced with the new `subscription_history` table. By default this package will look for your subscription data within the `subscription_history` source table. However, if you have an older connection, then you must configure the `stripe__using_subscription_history` to `false` in order to have the package use the `subscription` source rather than the `subscription_history` table.\n\u003e **Please note that if you have `stripe__using_subscription_history` enabled then the package will filter for only active records.**\n```yml\nvars:\n    stripe__using_subscription_history: False  # True by default. Set to False if your connection syncs the `subscription` table instead. \n```\n\n#### Setting your timezone\nThis packages leaves all timestamp columns in the UTC timezone. However, there are certain instances, such in the daily overview model, that timestamps have to be converted to dates. As a result, the timezone used for the timestamp becomes relevant.  By default, this package will use the UTC timezone when converting to date, but if you want to set the timezone to the time in your Stripe reports, add the following configuration to your root `dbt_project.yml`:\n\n```yml\nvars:\n  stripe_timezone: \"America/New_York\" # Replace with your timezone\n```\n\n#### Running on Live vs Test Customers\nBy default, this package will run on non-test data (`where livemode = true`) from the source Stripe tables. However, you may want to include and focus on test data when testing out the package or developing your analyses. To run on only test data, add the following configuration to your root `dbt_project.yml` file:\n\n```yml\nvars:\n    stripe:\n        stripe__using_livemode: false  # Default = true\n```\n#### Including sub Invoice Line Items\nBy default, this package will filter out any records from the `invoice_line_item` source table which include the string `sub_`. This is due to a legacy Stripe issue where `sub_` records were found to be duplicated. However, if you highly utilize these records you may wish they be included in the final output of the `stg_stripe__invoice_line_item` model. To do, so you may include the below variable configuration in your root `dbt_project.yml`:\n```yml\nvars:\n    stripe:\n        stripe__using_invoice_line_sub_filter: false # Default = true\n```\n#### Pivoting Out and Using Metadata Properties\nOftentimes you may have custom fields within your source tables stored as a JSON object via the `metadata` column that you wish to pass through to your analytics models. By leveraging the `metadata` variables, this package will pivot out fields into their own columns within the respective staging models and for supported variables those columns will persist in end models with prefixed column names.\n\n##### Configuration\nThis package provides the ability to pivot out these `metadata` fields for the `account`, `card`, `coupon`, `charge`, `customer`, `dispute`, `invoice`, `invoice_line_item`, `payment_intent`, `payment_method`, `payout`, `plan`, `price`, `refund`, `subscription`, `subscription_item`, and `transfer` source tables. To pivot these fields out and include them in the respective **staging models**, add the relevant variable(s) to your root `dbt_project.yml` file.\n\nThe following **end models** automatically include metadata fields from their respective entities with an entity prefix (eg. `invoice_\u003cmetadata_field_name\u003e`) to avoid column name conflicts with the exception of the `stripe__customer_overview` model which retains the metafield name/alias:\n\n| End Model | Supported Metadata Entities |\n| --------- | --------------------------- |\n| `stripe__balance_transactions` | customer, charge, invoice, subscription |\n| `stripe__invoice_details` | customer, charge, invoice, subscription |\n| `stripe__subscription_details` | customer, subscription |\n| `stripe__invoice_line_item_details` | subscription |\n| `stripe__customer_overview` | customer |\n\n\u003e We're open to supporting others based on customer feedback. Please open a [support ticket](https://support.fivetran.com/hc/en-us) to request metadata fields from additional staging models.\n\nThe metadata variables accept dictionaries in addition to strings. The expectation is that you will only input single-level key-value pairs from the JSON. You may `alias` your field if you happen to be using a reserved word as a metadata field, any otherwise incompatible name, or just wish to rename your field.\n\n```yml\nvars:\n  stripe__account_metadata:\n    - name: metadata_field\n    - name: another_metadata_field\n  stripe__charge_metadata:\n    - name: campaign_id\n  stripe__card_metadata:\n    - name: metadata_field_10\n  stripe__customer_metadata:\n    - name: sales_region\n      alias: customer_region  # optional: rename the field\n  stripe__invoice_metadata:\n    - name: invoice_type\n  stripe__invoice_line_item_metadata:\n    - name: metadata_field_20\n  stripe__payment_intent_metadata:\n    - name: incompatible.field\n      alias: rename_incompatible_field\n  stripe__payment_method_metadata:\n    - name: field_is_reserved_word\n      alias: field_is_reserved_word_xyz\n  stripe__payout_metadata:\n    - name: 123\n      alias: one_two_three\n  stripe__price_plan_metadata: ## Used for both Price and Plan sources\n    - name: pricing_tier\n  stripe__refund_metadata:\n    - name: refund_reason_code\n  stripe__subscription_metadata:\n    - name: subscription_tier\n  stripe__subscription_item_metadata:\n    - name: item_category\n\n```\n**For dbt Core users**: Alternatively, if you only have strings in your JSON object, the metadata variable accepts the following simplified configuration:\n\n```yml\nvars:\n    stripe__subscription_metadata: ['subscription_tier', 'contract_length', 'renewal_date'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON\n```\n#### Enabling Cent to Dollar Conversion\n\nAmount-based fields, such as `amount` and `net`, are typically displayed in the smallest denomination (e.g., cents for USD). By default, amount-based fields will be in this raw form. However, some currencies use major and minor units (for example, cents and dollars when using USD). In these cases, it may be useful to divide the amounts by 100, converting amounts to major units (dollars for USD). To enable the division, configure the `stripe__convert_values` to `true` in your project.yml: \n\n```yml\nvars:\n    stripe__convert_values: true  # default is false \n```\n\nIf you are working in a currency that does not differentiate between minor and major units, such as JPY or KRW, it may make more sense to keep the amount-based fields in raw form and therefore the package can be ran without configuration. As `stripe__convert_values` is disabled by default, these fields will not be impacted.\n\n#### Passing Through Additional Fields\nThis package includes all source columns defined in the macros folder. You can add more columns using our pass-through column variables. These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables:\n\n```yml\n# dbt_project.yml\n\nvars:\n  stripe:\n    card_pass_through_columns:\n      - name: \"description\"\n      - name: \"iin\"\n      - name: \"issuer\"\n        alias: \"card_issuer\"  # optional: define an alias for the column \n        transform_sql: \"cast(card_issuer as string)\" # optional: apply transformation to column. must reference the alias if provided\n```\n\n#### Change the build schema\nBy default, this package builds the stripe staging models within a schema titled (`\u003ctarget_schema\u003e` + `_stg_stripe`) in your destination. If this is not where you would like your stripe staging data to be written to, add the following configuration to your root `dbt_project.yml` file:\n\n```yml\nmodels:\n    stripe:\n      +schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.\n      staging:\n        +schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.\n```\n\n#### Change the source table references\nIf an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:\n\u003e IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_stripe/blob/main/dbt_project.yml) variable declarations to see the expected names.\n\n```yml\nvars:\n    stripe_\u003cdefault_source_table_name\u003e_identifier: your_table_name \n```\n\n\u003c/details\u003e\n\n### (Optional) Orchestrate your models with Fivetran Transformations for dbt Core™\n\u003cdetails\u003e\u003csummary\u003eExpand for details\u003c/summary\u003e\n\u003cbr\u003e\n\nFivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt#transformationsfordbtcore). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt/setup-guide#transformationsfordbtcoresetupguide).\n\u003c/details\u003e\n\n## Does this package have dependencies?\nThis dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site.\n\u003e IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.\n\n```yml\npackages:\n    - package: fivetran/fivetran_utils\n      version: [\"\u003e=0.4.0\", \"\u003c0.5.0\"]\n\n    - package: dbt-labs/dbt_utils\n      version: [\"\u003e=1.0.0\", \"\u003c2.0.0\"]\n\n    - package: dbt-labs/spark_utils\n      version: [\"\u003e=0.3.0\", \"\u003c0.4.0\"]\n```\n\n\u003c!--section=\"stripe_maintenance\"--\u003e\n## How is this package maintained and can I contribute?\n\n### Package Maintenance\nThe Fivetran team maintaining this package only maintains the [latest version](https://hub.getdbt.com/fivetran/stripe/latest/) of the package. We highly recommend you stay consistent with the latest version of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_stripe/blob/main/CHANGELOG.md) and release notes for more information on changes across versions.\n\n### Contributions\nA small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.\n\nWe highly encourage and welcome contributions to this package. Learn how to contribute to a package in dbt's [Contributing to an external dbt package article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657).\n\n\u003c!--section-end--\u003e\n\n## Are there any resources available?\n- If you have questions or want to reach out for help, see the [GitHub Issue](https://github.com/fivetran/dbt_stripe/issues/new/choose) section to find the right avenue of support for you.\n- If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_stripe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivetran%2Fdbt_stripe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_stripe/lists"}