{"id":22793307,"url":"https://github.com/fivetran/dbt_zuora","last_synced_at":"2025-08-09T15:24:52.134Z","repository":{"id":77010173,"uuid":"323705991","full_name":"fivetran/dbt_zuora","owner":"fivetran","description":"Data models for Fivetran's Zuora transformation package, built using dbt.","archived":false,"fork":false,"pushed_at":"2025-02-27T21:07:52.000Z","size":2860,"stargazers_count":3,"open_issues_count":3,"forks_count":2,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-03-29T05:33:46.603Z","etag":null,"topics":["dbt","dbt-packages","fivetran","subscription-analytics","zuora"],"latest_commit_sha":null,"homepage":"https://fivetran.github.io/dbt_zuora/","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-12-22T18:39:37.000Z","updated_at":"2025-02-27T20:54:37.000Z","dependencies_parsed_at":"2024-02-08T15:49:51.613Z","dependency_job_id":"f4244857-475c-4e40-b510-3cf066e19c18","html_url":"https://github.com/fivetran/dbt_zuora","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_zuora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_zuora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_zuora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_zuora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivetran","download_url":"https://codeload.github.com/fivetran/dbt_zuora/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249266509,"owners_count":21240767,"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","subscription-analytics","zuora"],"created_at":"2024-12-12T03:19:07.643Z","updated_at":"2025-08-09T15:24:52.113Z","avatar_url":"https://github.com/fivetran.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zuora dbt package ([Docs](https://fivetran.github.io/dbt_zuora/))\n\n\u003cp align=\"left\"\u003e\n    \u003ca alt=\"License\"\n        href=\"https://github.com/fivetran/dbt_zuora/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"dbt-core\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/dbt_Core™_version-\u003e=1.3.0_\u003c2.0.0-orange.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"Maintained?\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"PRs\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributions-welcome-blueviolet\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What does this dbt package do?\n- Produces modeled tables that leverage Zuora data from [Fivetran's connector](https://fivetran.com/docs/applications/zuora) in the format described by [this ERD](https://fivetran.com/docs/applications/zuora#schemainformation) and builds off the output of our [Zuora source package](https://github.com/fivetran/dbt_zuora_source).\n\n- Enables you to better understand your Zuora data. The package achieves this by performing the following:\n    - Enhancing the balance transaction entries with useful fields from related tables \n    - Creating customized analysis tables to examine churn by subscriptions\n    - Developing a look at gross, net, and discount monthly recurring revenue by account \n    - Generating metrics tables that allow you to better understand your account activity over time or at a customer level. These time-based metrics are available on a daily level.\n- Generates a comprehensive data dictionary of your source and modeled Zuora data through the [dbt docs site](https://fivetran.github.io/dbt_zuora/).\n\n\u003c!--section=\"zuora_transformation_model\"--\u003e\nThe following table provides a detailed list of all tables materialized within this package by default.\n\u003e TIP: See more details about these tables in the package's [dbt docs site](https://fivetran.github.io/dbt_zuora/#!/overview?g_v=1).\n\n| **Table**                         | **Description** |\n|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [zuora__account_daily_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_daily_overview)    |  Each record is a day in an account and its accumulated balance totals based on all line item transactions up to that day.                            |\n| [zuora__account_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_overview)    |  Each record represents an account, enriched with metrics about their associated transactions.                                                                                                     |\n| [zuora__billing_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__billing_history)    | Each record represents an invoice and its various transaction details. |\n| [zuora__line_item_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__line_item_history)      | Each record represents a specific invoice item and its various transaction details.                                                                     |\n| [zuora__monthly_recurring_revenue](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__monthly_recurring_revenue) | Each record represents an account and MRR generated on a monthly basis. |\n| [zuora__subscription_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__subscription_overview)       | Each record represents a subscription, enriched with metrics about time, revenue, state, and period.    |\n| [zuora__line_item_enhanced](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__line_item_enhanced)       | This table is 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` table found in Zuora, Recharge, Stripe, Shopify, and Recurly, offering standardized reporting across various billing platforms. To see the kinds of insights this table can generate, explore example visualizations in the [Fivetran Billing Model Streamlit App](https://fivetran-billing-model.streamlit.app/). Visit the app for more details and refer to these [docs](https://github.com/fivetran/dbt_zuora/tree/main?tab=readme-ov-file#enabling-standardized-billing-model) for how to enable the table, which is disabled by default.  |\n\nAn example churn report is separately available in the analysis folder:\n| **analysis model**   | **description**   |\n|---------------------|------------------|\n| [zuora__account_churn_analysis](https://fivetran.github.io/dbt_zuora/#!/analysis/analysis.zuora.zuora__account_churn_analysis) | Each record represents an account and whether it has churned in that month or not. |\n\n### Example Visualizations\nCurious what these tables can do? Check out example visualizations from the [zuora__line_item_enhanced](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__line_item_enhanced) table in the [Fivetran Billing Model Streamlit App](https://fivetran-billing-model.streamlit.app/), and see how you can use these tables in your own reporting. Below is a screenshot of an example report—-explore the app for more.\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_zuora/main/images/streamlit_example.png\" alt=\"Streamlit Billing Model App\" width=\"75%\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n### Materialized Models\nEach Quickstart transformation job run materializes 51 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\u003c!--section-end--\u003e\n\n## How do I use the dbt package?\n### Step 1: Prerequisites\nTo use this dbt package, you must have the following:\n- At least one Fivetran Zuora connection syncing data into your destination\n- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, **Databricks** destination\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 for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages, respectively.\n\n```yml\ndispatch:\n  - macro_namespace: dbt_utils\n    search_order: ['spark_utils', 'dbt_utils']\n```\n\n### Step 2: Install the package\nInclude the following zuora 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/zuora\n    version: [\"\u003e=0.5.0\", \"\u003c0.6.0\"]\n```\nDo NOT include the `zuora_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.\n\n\n### Step 3: Define database and schema variables\nBy default, this package runs using your destination and the `zuora` schema. If this is not where your Zuora data is (for example, if your Zuora schema is named `zuora_fivetran`), add the following configuration to your root `dbt_project.yml` file:\n\n```yml\nvars:\n    zuora_database: your_destination_name\n    zuora_schema: your_schema_name \n```\n\n### Step 4: Disable models for non-existent sources\nYour Zuora connection may not sync every table that this package expects. This might be because you are excluding those tables. If you are not using those tables, you can disable the corresponding functionality in the package by specifying the variable in your dbt_project.yml. By default, all packages are assumed to be true. You only have to add variables for tables you want to disable in the following way:\n\n```yml \nvars: \n  zuora__using_credit_balance_adjustment: false # Disable if you do not have the credit balance adjustment table\n  zuora__using_refund: false # Disable if you do not have the refund table\n  zuora__using_refund_invoice_payment: false # Disable if you do not have the refund invoice payment table\n  zuora__using_taxation_item: false # Disable if you do not have the taxation item table\n```     \n\n### Step 5: Configure the multicurrency variable for customers billing in multiple currencies\nZuora allows the functionality for multicurrency to bill customers in various currencies. If you are an account utilizing multicurrency, make sure to set the `zuora__using_multicurrency` variable to `true` in `dbt_project.yml` so the amounts in our data models accurately reflect the home currency values in your native account currency.\n\n```yml\nvars:\n  zuora__using_multicurrency: true #Enable if you are utilizing multicurrency, false by default.\n```\n#### Multicurrency Support Disclaimer (and how you can help)\nWe were not able to develop the package using the multicurrency variable, so we had to execute our best judgement when building these models. If you encounter any issues with enabling the variable, [please file a bug report with us](https://github.com/fivetran/dbt_zuora/issues/new?assignees=\u0026labels=type%3Abug\u0026template=bug-report.yml\u0026title=%5BBug%5D+%3Ctitle%3E) and we can work together to fix any issues you encounter.\n\n### (Optional) Step 6: Additional configurations\n\u003cdetails open\u003e\u003csummary\u003eExpand to view configurations\u003c/summary\u003e\n\n#### Enabling Standardized Billing Model\nThis package contains the `zuora__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 `zuora__standardized_billing_model_enabled` variable to `false` in your `dbt_project.yml`:\n\n```yml\nvars:\n  zuora__standardized_billing_model_enabled: false # true by default.\n```\n\n#### Setting the date range for the account daily overview and monthly recurring revenue models\nBy default, the `zuora__account_daily_overview` will aggregate data for the entire date range of your data set based on the minimum and maximum `invoice_date` values from the `invoice` source table, and `zuora__monthly_recurring_revenue` based on the `service_start_date` from the `invoice_item` source table.\n\nHowever, you may limit this date range if desired by defining the following variables for each respective model (the `zuora_overview_` variables refer to the `zuora__account_daily_overview`, the `zuora_mrr_` variables apply to `zuora__monthly_recurring_revenue`).\n\n```yml\nvars:\n    zuora_daily_overview_first_date: \"yyyy-mm-dd\"\n    zuora_daily_overview_last_date: \"yyyy-mm-dd\"\n\n    zuora_mrr_first_date: \"yyyy-mm-dd\"\n    zuora_mrr_last_date: \"yyyy-mm-dd\"\n```\n\n#### Passing Through Additional Fields\nThis package includes all source columns defined in the [macros folder of the dbt_zuora_source package](https://github.com/fivetran/dbt_zuora_source/tree/main/macros). You can add more columns using our pass-through column variables. These variables allow 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\nvars:\n  zuora_account_pass_through_columns: \n    - name: \"new_custom_field\"\n      alias: \"custom_field\"\n      transform_sql: \"cast(custom_field as string)\"\n    - name: \"another_one\"\n  zuora_subscription_pass_through_columns:\n    - name: \"this_field\"\n      alias: \"cool_field_name\"\n  zuora_rate_plan_pass_through_columns:\n    - name: \"another_field\"\n      alias: \"cooler_field_name\"\n  zuora_rate_plan_charge_pass_through_columns:\n    - name: \"yet_another_field\"\n      alias: \"coolest_field_name\"\n```\n#### Change the build schema\nBy default this, package will build the Zuora staging models within a schema titled (\u003ctarget_schema\u003e + `_stg_zuora`), the Zuora intermediate models within a schema titled (\u003ctarget_schema\u003e + `_zuora_int`), and the Zuora final models within a schema titled (\u003ctarget_schema\u003e + `_zuora`) in your target database. If this is not where you would like your modeled Zuora data to be written to, add the following configuration to your `dbt_project.yml` file:\n\n```yml\nmodels:\n  zuora:\n    +schema: my_new_schema_name # leave blank for just the target_schema\n    intermediate:\n      +schema: my_new_schema_name # leave blank for just the target_schema\n  zuora_source:\n    +schema: my_new_schema_name # leave blank for just the 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_zuora_source/blob/main/dbt_project.yml) variable declarations to see the expected names.\n\n```yml\nvars:\n    zuora_\u003cdefault_source_table_name\u003e_identifier: your_table_name \n```\n\n#### Snowflake Users\nIf you do **not** use the default all-caps naming conventions for Snowflake, you may need to provide the case-sensitive spelling of your source tables that are also Snowflake reserved words.\n\nIn this package, this would apply to the `ORDER` source. If you are receiving errors for this source, include the below identifier in your `dbt_project.yml` file:\n\n```yml\nvars:\n    zuora_order_identifier: \"ORDER\" # as an example, must include the double-quotes and correct case\n```  \n\n\u003c/details\u003e\n\n### (Optional) Step 7: Orchestrate your models with Fivetran Transformations for dbt Core™\n\u003cdetails\u003e\u003csummary\u003eExpand to view 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). 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#setupguide).\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```yml\npackages:\n    - package: fivetran/zuora_source\n      version: [\"\u003e=0.2.0\", \"\u003c0.3.0\"]\n\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## How is this package maintained and can I contribute?\n### Package Maintenance\nThe Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend that you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/zuora/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_zuora/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. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) to learn how to contribute to a dbt package.\n\n### Opinionated Modelling Decisions\nThis dbt package takes several opinionated stances in order to provide the customer several options to better understand key subscription metrics. Those include:\n- Evaluating a history of billing transactions, examined at either the invoice or invoice item level\n- How to calculate monthly recurring revenue and at which grains to assess it, either looking at it granularly at the charge (invoice item) or account monthly level\n- Developing a custom churn analysis that you can find in the analysis folder that's built on the account monthly level, but also giving the customer the ability to look at churn from a subscription or rate plan charge level.\n\nIf you would like a deeper explanation of the decisions we made to our models in this dbt package, you may reference the [DECISIONLOG](https://github.com/fivetran/dbt_zuora/blob/main/DECISIONLOG.md).\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_zuora_source/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_zuora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivetran%2Fdbt_zuora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_zuora/lists"}