Stripe to Snowflake

This page provides you with instructions on how to extract data from Stripe and load it into Snowflake. (If this manual process sounds onerous, check out Stitch, which can do all the heavy lifting for you in just a few clicks.)

About Snowflake

Snowflake is a data warehouse solution that is entirely cloud based. It's a managed service. If you don't want to deal with hardware, software, or upkeep for a data warehouse you're going to love Snowflake. It runs on the wicked fast Amazon Web Services architecture using EC2 and S3 instances. Snowflake is designed to be flexible and easy to work with where other relational databases are not. One example of this is the query execution. Snowflake creates virtual warehouses where query processing takes place. These virtual warehouses run on separate compute clusters, so querying one of these virtual warehouses doesn't slow down the others. If you have ever had to wait for a query to complete, you know the value of speed and efficiency for query processing.

Getting data out of Stripe

Getting your Stripe data into your data warehouse starts with pulling that data off of Stripe’s servers. You can do this using the Stripe API, and that documentation can be accessed here. Stripe’s API uses REST to allow customers to retrieve information on transactions and more.

Sample Stripe data

The Stripe API returns JSON-formatted data. Below is an example of the kind of response you might see when querying for a transaction.

Stripe\Charge JSON: {
  "id": "ch_1743p92eZvKYlo2Cw2JNErfI",
  "object": "charge",
  "amount": 10400,
  "amount_refunded": 0,
  "application_fee": null,
  "balance_transaction": "txn_1728rq2eZvKYlo2C91cyTIf5",
  "captured": true,
  "created": 1446791747,
  "currency": "usd",
  "customer": "cus_3nkNHu4SYjMlBC",
  "description": null,
  "destination": null,
  "dispute": null,
  "failure_code": null,
  "failure_message": null,
  "fraud_details": {
  "invoice": "in_1742qw2eZvKYlo2C4zE3pp4a",
  "livemode": false,
  "metadata": {
  "paid": true,
  "receipt_email": null,
  "receipt_number": null,
  "refunded": false,
  "refunds": {
    "object": "list",
    "data": [

    "has_more": false,
    "total_count": 0,
    "url": "/v1/charges/ch_1743p92eZvKYlo2Cw2JNErfI/refunds"
  "shipping": null,
  "source": {
    "id": "card_103nkN2eZvKYlo2CzNg6Clei",
    "object": "card",
    "address_city": null,
    "address_country": null,
    "address_line1": null,
    "address_line1_check": null,
    "address_line2": null,
    "address_state": null,
    "address_zip": null,
    "address_zip_check": null,
    "brand": "Visa",
    "country": "US",
    "customer": "cus_3nkNHu4SYjMlBC",
    "cvc_check": null,
    "dynamic_last4": null,
    "exp_month": 12,
    "exp_year": 2023,
    "funding": "credit",
    "last4": "4242",
    "metadata": {
    "name": null,
    "tokenization_method": null
  "statement_descriptor": null,
  "status": "succeeded"

Preparing Stripe data

This part can get tricky: you need to parse JSON in the API response and map each endpoint to a corresponding table in the destination database. That means you're going to have to know the datatypes for each endpoint. The Stitch Stripe Docs can give you a sense of what datatypes will come through the API.

Preparing data for Snowflake

Depending on the structure that you data is in, you may need to prepare it for loading. Take a look at the supported data types for Snowflake and make sure that the data you've got will map neatly to them. If you have a lot of data, you should compress it. Gzip, bzip2, Brotli, Zstandard v0.8 and deflate/raw deflate compression types are all supported.

One important thing to note here is that you don't need to define a schema in advance when loading JSON data into Snowflake. Onward to loading!

Loading data into Snowflake

There is a good reference for this step in the Data Loading Overview section of the Snowflake documentation. If there isn’t much data that you’re trying to load, then you might be able to use the data loading wizard in the Snowflake web UI. Chances are, the limitations on that tool will make it a non-starter as a reliable ETL solution. There two main steps to getting data into Snowflake:

  • Use the PUT command to stage files
  • Use the COPY INTO table command to load prepared data into the awaiting table from the prior step.

For the COPY step, you’ll have the option of copying from your local drive, or from Amazon S3. One of Snowflakes’ slick features lets you to make a virtual warehouse that will power the insertion process.

Keeping Stripe data up to date

So, now what? You’ve built a script that pulls data from Stripe and loads it to your destination, but what happens tomorrow when you have hundreds of new transactions?

The key is to build your script in such a way that it can also identify incremental updates to your data. Thankfully, Stripe’s API results include fields like “created” that allow you to quickly identify records that are new since your last update (or since the newest record you’ve copied). Last thing: set your script up as a cron job or continuous loop to keep pulling down new data as it appears.

Easier and faster alternatives

If all this sounds a bit overwhelming, don’t be alarmed. If you have all the skills necessary to go through this process, chances are building and maintaining a script like this isn’t a very high-leverage use of your time.

Thankfully, products like Stitch were built to solve this problem automatically. With just a few clicks, Stitch starts extracting your Stripe data via the API, structuring it in a way that is optimized for analysis, and inserting that data into your Snowflake data warehouse.