# Export data to a data warehouse Automate data exports from Stripe to Snowflake, Redshift or Databricks. Data Pipeline currently supports [Snowflake](https://docs.snowflake.com/en/user-guide/intro-regions.html) (deployed on AWS, Azure or Google Cloud), [Amazon Redshift](https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/select-region.html) and [Databricks](https://docs.databricks.com/aws/en/resources/supported-regions) (Public preview) data regions. | AWS Region | Snowflake | Amazon Redshift RA3 (with encryption) | Databricks (Public preview) | | ----------------------------- | ----------- | ------------------------------------- | --------------------------- | | us-west-2 (Oregon) | ✓ Supported | ✓ Supported | ✓ Supported | | us-east-2 (Ohio) | ✓ Supported | ✓ Supported | ✓ Supported | | us-east-1 (N. Virginia) | ✓ Supported | ✓ Supported | ✓ Supported | | us-west-1 (N. California) | ✓ Supported | ✓ Supported | ✓ Supported | | ca-central-1 (Central Canada) | ✓ Supported | ✓ Supported | ✓ Supported | | sa-east-1 (São Paulo) | ✓ Supported | ✓ Supported | ✓ Supported | | eu-central-1 (Frankfurt) | ✓ Supported | ✓ Supported | ✓ Supported | | eu-central-2 (Zurich) | ✓ Supported | ❌ Unsupported | ✓ Supported | | eu-west-1 (Ireland) | ✓ Supported | ✓ Supported | ✓ Supported | | eu-west-2 (London) | ✓ Supported | ✓ Supported | ✓ Supported | | eu-west-3 (Paris) | ✓ Supported | ✓ Supported | ✓ Supported | | eu-north-1 (Stockholm) | ✓ Supported | ✓ Supported | ✓ Supported | | me-south-1 (Bahrain) | ✓ Supported | ✓ Supported | ✓ Supported | | ap-southeast-1 (Singapore) | ✓ Supported | ✓ Supported | ✓ Supported | | ap-southeast-2 (Sydney) | ✓ Supported | ✓ Supported | ✓ Supported | | ap-southeast-3 (Jakarta) | ✓ Supported | ❌ Unsupported | ✓ Supported | | ap-northeast-1 (Tokyo) | ✓ Supported | ✓ Supported | ✓ Supported | | ap-northeast-2 (Seoul) | ✓ Supported | ✓ Supported | ✓ Supported | | ap-northeast-3 (Osaka) | ✓ Supported | ❌ Unsupported | ✓ Supported | | ap-east-1 (Hong Kong) | ✓ Supported | ✓ Supported | ✓ Supported | ## Get started Navigate to Reporting > [Data management](https://dashboard.stripe.com/data-management) in the Stripe Dashboard, and go through the [onboarding steps](https://docs.stripe.com/stripe-data/access-data-in-warehouse/data-warehouses.md#sdp-onboarding-video). After you accept the data share and complete onboarding, you can access your core Stripe data in Snowflake, Amazon Redshift or Databricks within 12 hours. After the initial load, your Stripe data [refreshes regularly](https://docs.stripe.com/stripe-data/available-data.md). > You can only have one warehouse account connected to your Stripe account. ### How to onboard #### Snowflake [Watch on YouTube](https://www.youtube.com/watch?v=Ric7L5BCSQM) #### Amazon Redshift RA3 [Watch on YouTube](https://www.youtube.com/watch?v=cp8684Lyi0M) #### Snowflake ### Link your Snowflake account First, send all your up-to-date Stripe data and reports through the Dashboard: 1. On the [Data Pipeline settings](https://dashboard.stripe.com/settings/stripe-data-pipeline) page in the Dashboard, click **Sign up**. 1. From the drawer, select **Snowflake**, then click **Continue**. 1. Enter your Snowflake [Account Identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html) and then select the cloud provider on which your Snowflake account is deployed (AWS, Azure or GCP). 1. Select your region and then click **Next**. 1. Copy the SQL from the code block and insert it in a SQL worksheet in Snowflake warehouse and run the query to retrieve the unique value. Enter the value in the text box and click **Subscribe**. ### Access your data share in Snowflake After your core Stripe data becomes available (typically within 12 hours), access your data from your Snowflake account: 1. Navigate to your Snowflake account to accept the Stripe data share. 1. If your Snowflake cloud provider is deployed on AWS in one of these seven regions: - `us-east-1`: accept share from account `GSWUDFY_STRIPE_AWS_US_EAST_1` - `us-west-2`: accept share from account `JZA07263` - `us-east-2`: accept share from account `VM70738` - `ca-central-1`: accept share from account `TD26747` - `eu-central-1`: accept share from account `GSWUDFY-STRIPE_AWS_EU_CENTRAL_1` - `eu-west-1`: accept share from account `GSWUDFY-STRIPE_AWS_EU_WEST_1` - `ap-southeast-2`: accept share from account `KB26084` In Snowflake, have a user with `ACCOUNTADMIN` access go to **Data** > **Shared Data**. Under **Ready to Get**, go to the share called `SHARE_[ACCOUNT_IDENTIFIER]` from the corresponding Stripe account. Then, click **Get shared data** to accept the share. 1. If your Snowflake cloud provider isn’t AWS or if your AWS region isn’t one of the seven regions listed above: 1. Your share comes from the `JZA07263` account as a private listing. 1. In Snowflake, have a user with `ACCOUNTADMIN` access go to **Data Sharing** > **External Sharing**. 1. Locate the share from `JZA07263` and follow the instructions as prompted by Snowflake. 1. In the modal that opens, give the database a name (for example, “Stripe”), select the roles to grant access to (for example, `SYSADMIN`), then click **Get Data**. 1. Confirm that you can view your Stripe data in **Data From Direct Shares** and **Databases**. You can now query your Stripe data directly in Snowflake. #### Amazon Redshift RA3 Before you begin, confirm your cluster is compatible with Data Pipeline. Only RA3 node types with [cluster encryption](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) enabled are compatible with this method of data sharing. ### Link your Redshift account First, send all your up-to-date Stripe data and reports through the Dashboard: 1. In the [Data Pipeline settings](https://dashboard.stripe.com/settings/stripe-data-pipeline) page in the Dashboard, click **Sign up**. 1. From the modal, select **Redshift**, then click **Continue**. 1. Enter your Amazon [Account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) and your AWS region, then click **Continue**. 1. Confirm the information, then click **Sign up** to start the creation of your data share and your data should be available in Redshift within 12 hours. If you don’t see an incoming data share after 12 hours, verify that cluster encryption is enabled [in the AWS console](https://docs.aws.amazon.com/redshift/latest/mgmt/configuring-db-encryption-console.html). Amazon Redshift only displays shares in compatible clusters. ### Access your data share in Redshift Next, after 12 hours, access your data share from your Amazon Redshift account: 1. Navigate to your Amazon Redshift account to accept the Stripe data share. In Amazon Redshift, have an administrator go to the account-level **Datashares** tab in the console’s left navigation. 1. In the **From other accounts** section, go to a share entitled `share_[ACCOUNT_ID]`. Check the box next to the data share, then click **Associate**. 1. In the modal that opens, select the namespaces that have access to this data. If you want all Amazon Redshift clusters in this region to have access to this data, select **Associate the entire AWS account**. 1. Select the accepted share to open the Share details page, then click **Connect to database**. Next, connect to one of your existing databases, as you would in the Redshift query console, then click **Create database from datashare**. 1. In the following modal window, give the database a name (for example, “Stripe”). You can now query your Stripe directly in Amazon Redshift. > There are two views where the Amazon Redshift UI displays incoming data shares: account level view and cluster level view. When accepting the data share from Stripe, make sure you’re not viewing shares on an individual cluster. Instead, use the left navigation on the Amazon Redshift console to view all shares for your account. #### Databricks > Databricks support for Data Pipeline is in public preview. ### Link your Databricks account First, send all your up-to-date Stripe data and reports through the Dashboard: 1. On the [Data Pipeline settings](https://dashboard.stripe.com/settings/stripe-data-pipeline) page in the Dashboard, click **Sign up**. 1. From the drawer, select **Databricks**, then click **Continue**. 1. In your [Databricks console](https://accounts.cloud.databricks.com), click **New > Query**. 1. Copy and run the following query: ```sql select current_metastore(); ``` 1. Copy the result. It has the format `cloud:region:uuid` (for example, `aws:us-east-2:a1b2c3d4-e5f6-7890-abcd-ef1234567890`). 1. Paste the sharing identifier in the text field and click **Continue**. ### Access your data share in Databricks After Stripe sends the data share to your Databricks account, access it from your Databricks console: 1. In your Databricks console, click **New > Query** and run the following command to grant yourself provider access: ```sql GRANT USE PROVIDER ON METASTORE TO `your_email`; ``` Replace `your_email` with your Databricks account email address. 1. Navigate to **Catalog > Delta Sharing > Shared with me**. 1. Click the **stripe** share. 1. Click **Mount to catalog**. 1. Select **Create a new catalog** and enter a unique catalog name. 1. Click **Create**. 1. Verify that your Stripe data is accessible in the new catalog. ### Verify your account After mounting the catalog, complete the verification step in the Dashboard: 1. In your Databricks console, click **New > Query**. 1. Copy and run the verification query displayed in the Dashboard. The query retrieves a test value from your newly mounted catalog. 1. Copy the query result and paste it in the verification field in the Dashboard. 1. Click **Activate Databricks** to complete the setup. ### Change the warehouse account To change the warehouse account your Stripe account is connected to: 1. Turn off Data Pipeline from the Dashboard [settings page](https://dashboard.stripe.com/settings/stripe-data-pipeline). 1. Sign up for Data Pipeline again using the steps detailed above for the new warehouse account you want to connect to. To add another Stripe account to your warehouse account: 1. Follow the [sign up](https://docs.stripe.com/stripe-data/access-data-in-warehouse/data-warehouses.md#get-started) steps above for your new Stripe account. 1. Use the same account identifier as above for the respective warehouse. To find your Account ID, go to the Dashboard [settings page](https://dashboard.stripe.com/settings/stripe-data-pipeline) and locate **ID** under the **Connected data warehouse** section. ## Query Stripe data in your data warehouse In Snowflake, Amazon Redshift and Databricks, your data is available as secure views. To query your data, follow the steps below. #### Snowflake View your available Stripe data by navigating to **Views** in the database you created. For each table, you can also see the available columns by clicking on the table and navigating to **Columns**. #### Amazon Redshift RA3 View all your available Stripe data by navigating to **Tables and views** in the database you created. #### Databricks View your available Stripe data by navigating to **Catalog** in Databricks. Select the catalog you created during onboarding, then browse the available schemas and views. ## Financial reports in Data Pipeline To facilitate your financial close, you can access Stripe’s [reports](https://docs.stripe.com/stripe-reports.md) directly in your data warehouse. > At this time, financial reports aren’t available for Amazon Redshift or Databricks. Financial report templates have a `FINANCIAL_REPORT` prefix and are available as views in your data warehouse. ![](https://b.stripecdn.com/docs-statics-srv/assets/finrep.eb725f745cb57d3e03e813f96b3e8071.png) ### Generating financial reports in Snowflake You can format your dates with varying levels of precision: START_DATE = ‘2021-09-01’; START_DATE = ‘2021-09-01 00:00:00’; START_DATE = ‘2021-09-01 00:00:00.000’; Generating financial reports from Data Pipeline requires setting a few custom variables. These are the same variables you set when generating the report through the Dashboard or API: - `START_DATE` (varchar)—The starting date of the report (inclusive). - `END_DATE` (varchar) – The ending date of the report (exclusive). - `TIMEZONE` (varchar)—The time zone of non-UTC datetime columns. To set these variables and run the report query: 1. Create a new worksheet. 1. Set the database schema and required variables to your desired values. ```sql -- set schema based on the name you gave your Stripe database use schema db_name.stripe; -- set financial report template variables set (TIMEZONE, START_DATE, END_DATE) = ('UTC', '2021-09-01', '2021-10-01'); ``` > Run these lines of code separately before attempting to query tables that require them. Otherwise, you might receive an error that a session variable doesn’t exist. > > If you’re using the [Snowflake Connector for Python](https://docs.snowflake.com/en/user-guide/python-connector.html), set the session parameter `TIMEZONE` with the `ALTER SESSION SET TIMEZONE = 'UTC'` command. 1. After running the code that sets the necessary variables, query the view of the report you want to generate. For example, running: ```sql select * from FINANCIAL_REPORT_BALANCE_CHANGE_FROM_ACTIVITY_ITEMIZED; ``` Returns the same results that the itemised balance change from the activity report displays in the Dashboard or through the API: ![](https://b.stripecdn.com/docs-statics-srv/assets/report.601f8e6f124d2dbf1adc74388fa58025.png) > #### Need support for a different file format? > > If you want to upload files with a different structure or in a custom format, contact [Stripe support](https://support.stripe.com/contact/email?topic=third_party_integrations&subject=Stripe%20Data%20Pipeline%20\(SDP\)).