Moving data from a payment platform like Braintree to an analytics platform like BigQuery is a vital step for the majority of businesses.The data in a payment platform can provide multiple key performance indicators (KPIs) that must be considered to improve business performance. Concepts like retention and churn rates can change your perspective on how well your business can do by modeling product payments.

Connecting Braintree to BigQuery can help you unlock deeper insights into customer preferences and market trends.This integration not only streamlines data management processes but also empowers organizations to make informed decisions and capitalize on emerging opportunities in today's fast-paced marketplace.

In this tutorial, you will learn more about the different methods for moving your data from Braintree to BigQuery to get the most out of your data. So, let’s get started!

Braintree Overview


Blog Post Image

Image Source

Braintree is a payment gateway service provided by PayPal. It enables businesses of different scales to accept payments from almost anywhere around the globe. The key features of Braintree involve secure transactionsmultiple payment methodssubscription-based billingautomation in the back-end process, and many more.

With the help of Braintree, you can expand your business’ market and reach more buyers. By leveraging several benefits of Braintree, you can drive higher conversion rates since it provides an optimized payment experience to the user.

Introduction to BigQuery

Blog Post Image

Image Source

BigQuery is a cloud-based, serverless data warehousing service provided by Google that enables you to gain valuable insights from data. Businesses of all sizes can leverage its powers to create strategies and optimize workflows according to their needs.

The main features of BigQuery include a unified interface that simplifies the data analytics workflow from data ingestion to insights generation. It also has a built-in AI assistant that can provide you with the code that you need to run on your data. BigQuery’s columnar storage format and its support for Massively Parallel Processing (MPP) help provide faster query results even for complex analytical queries over massive datasets.

Methods of Integrating Braintree to BigQuery

There are two simple methods for integrating your data from Braintree to Google BigQuery.

  • Method 1: Using Estuary Flow for Integrating Braintree to BigQuery
  • Method 2: Using Braintree API to Integrate Braintree to BigQuery

Method 1: Using Estuary Flow for Integrating Braintree to BigQuery

Estuary Flow is a SaaS-based extract, transform, load (ETL) platform that provides solutions for creating data integration pipelines without requiring extensive programming knowledge. It is one of the best real-time integration solutions that offers a hassle-free way of moving data between sources and destinations.

With over 300 connectors available, Estuary Flow supports a wide range of integrations to suit your preferences. Configuring your source and destination and running your data pipeline takes just a few minutes.


Step 1: Configure Braintree as the Source

  • After completing the login process on Estuary, you will be redirected to the dashboard.
Blog Post Image
  • Click on the Sources tab from the left-side panel.
Blog Post Image
  • Click on + NEW CAPTURE on the Sources page.
Blog Post Image
  • In the Search connectors box, search for Braintree. When you see the Braintree connector in the search results, click on its Capture button.
Blog Post Image
  • You will be redirected to the Braintree configuration page, where you must fill in the mandatory fields, including EnvironmentMerchant IDPrivate Key, and Public Key.
  • After populating the fields, click NEXT at the top right corner of this page, and then click SAVE AND PUBLISH. The connector will capture data from Braintree and convert it into Flow collections.

Step 2: Configure BigQuery as the Destination

  • Click on the Destinations tab on the left-side panel of the dashboard.
Blog Post Image
  • Click + NEW MATERIALIZATION on the Destinations page.
Blog Post Image
  • Create Materialization page will appear with a Search connectors field. Enter BigQuery in the field, and click the Materialization button when the Google Bigquery option appears.
Blog Post Image
  • Finally, you will be redirected to the Google BigQuery connector page, where you will be required to fill in the mandatory fields, such as Project ID, Region, Dataset, and Bucket, to set up BigQuery as the destination.
  • Under the Source Collections box on this page, you have the option of selecting a capture to link with your materialization.
  • After entering all the necessary fields, you can click on NEXTSAVE AND PUBLISH. This step will materialize your data from Flow collections into tables within your BigQuery dataset.

By following these steps, you can integrate Braintree to Bigquery in a no-code, easy-to-use environment.

Benefits of Using Estuary Flow

Here are some benefits of using Estuary Flow for data integration.

  • Change Data Capture (CDC): Estuary Flow processes data in real-time with the support of Change Data Capture to maintain the integrity of your data.
  • Built-in Connectors: Estuary Flow offers more than 300 no-code configuration connector options, making creating ETL pipelines effortless.
  • Scalability: With Estuary Flow, you can scale your data according to your specific requirements. Its flawless architecture allows horizontal scaling for fluctuating data volumes and workloads.
  • Built-in Testing Features: Estuary Flow allows you to transfer quality data with built-in testing and quality check features. These features ensure the accuracy of the transfer of your data from source to destination.

Method 2: Using Braintree API to Integrate Braintree to BigQuery

In this method, you will use the Braintree API to integrate Braintree to BigQuery. Here are the steps that will help with this integration.

Step 1: Extract Data from Braintree

Braintree offers exposure to its API key to integrate products with payment services. You can access the API with the help of various client (iOS, Android, Web) and server (Ruby, Python, JavaScript, PHP, .NET, Java) SDKs.

Braintree eases the integration process by providing client libraries in seven different languages. This guarantees better security, platform support, and backward compatibility.


Before starting to extract data from Braintree, you need to ensure that the prerequisites for this process are satisfied. The following credentials are required to start working with Braintree data.

  • Public key: A unique public ID for each user.
  • Private key: A unique secret identifier for each user.
  • Merchant ID: Credentials of gateway account.
  • Environment: Sandbox that is used for testing and production.

With Braintree’s API, you can access different resources that offer varied benefits, including effective analysis of the resources present in your Braintree environment. Braintree’s SDKs help manipulate all of the resources; you can use the SDKs to obtain data, which you can store locally for analytics purposes.

For instance, if you want to obtain the data of all customers associated with your business, a simple Java SDK code can aid in gaining this information.

CustomerSearchRequest request = new CustomerSearchRequest()  .id().is("the_customer_id"); ResourceCollection<Customer> collection = gateway.customer().search(request); for (Customer customer : collection) {  System.out.println(customer.getFirstName()); }

This code helps conduct a search to obtain all the information regarding the client ID that you specified; this information will include all the relevant information about transactions, payment and methods, among other information. Braintree’s search engine executes complex queries with ease.

Step 2: Data Preparation

In this step, you must ensure that the data produced from the above step is in a format compatible with BigQuery since an error might occur if the data is not aligned with BigQuery. As of now, BigQuery supports Avro, CSV, JSON, ORC, or Parquet formats.

Additionally, you need to confirm the data types to be used in BigQuery. For an overview of the data types BigQuery deals with, refer to BigQuery data types.

Step 3: Loading Data to BigQuery

There are multiple sources through which you can load your Braintree data into BigQuery, and you can follow the BigQuery documentation to learn more. Here are two of the ways to load data to BigQuery manually:

  • Loading a set of records in batches.
  • Steaming individuals or a batch of records.

After you’ve accessed your Braintree data and converted it into a specified format, you need to load it to tables in a BigQuery dataset. First, you need to transfer your data to Google Cloud Storage (GCS) so that the data can be extracted from GCS and transferred to BigQuery. For this, you can run the code given below by specifying the required arguments, which perform an HTTP POST request for uploading data directly to a bucket in GCS.

POST /OBJECT_NAME HTTP/2 Host: Date: DATE Content-Length: REQUEST_BODY_LENGTH Content-Type: MIME_TYPE X-Goog-Resumable: start Authorization: AUTHENTICATION_STRING

Finally, you can run an SQL query on BigQuery Console to ingest that data into BigQuery:

LOAD DATA {OVERWRITE|INTO}  [{TEMP|TEMPORARY} TABLE] [[project_name.]dataset_name.]table_name [[OVERWRITE] PARTITIONS (partition_column_name=partition_value)] [(  column_list )] [PARTITION BY partition_expression] [CLUSTER BY clustering_column_list] [OPTIONS (table_option_list)] FROM FILES(load_option_list) [WITH PARTITION COLUMNS  [(partition_column_list)] ] [WITH CONNECTION connection_name] column_list: column[, ...] partition_column_list: partition_column_name, partition_column_type[, ...]

You can follow these links to get a better understanding of the arguments used, partition-espressiontable_option_listload_option_list, and column.

The LOAD DATA methods can store data in the BigQuery table. If the table already exists, this code appends the data to it. If not, this code creates a new table with the specified name and then appends your Braintree data to it.

Limitations of Using Braintree API for Integration

Certain limitations must be considered before starting the data integration process from your Braintree account to BigQuery using the Braintree API key.

  • Data Complexity: As mentioned in Step 2 of this method, the data extracted from Braintree might not be compatible with BigQuery. Ensuring data compatibility with BigQuery-supported formats may require additional efforts for transformation.
  • Time Consumption: Using Braintree API for the integration process can increase the amount of time involved in moving data from source to destination. Due to the time-consuming nature of this process, it isn’t suitable for real-time integration or analytics, as it might need constant monitoring and maintenance.
  • Lack of Automation: This process requires you to perform certain tasks manually, hence lacking automation capabilities. Additionally, manual intervention increases the chances of errors and data integrity issues.


By integrating Braintree with BigQuery, you can use your customer’s data to analyze and visualize potential opportunities. This can give you insight into how your customers behave, payment trends associated with features, and many other vital metrics.

For a Braintree-BigQuery integration, you can use the Braintree API. However, this method is associated with limitations, including being time-consuming, effort-intensive, and error-prone. 

You can also opt for data integration platforms like Estuary Flow to transfer your Braintree data. Flow provides essential benefits, offering you access to more than 300 connectors and supporting capabilities such as near real-time synchronization, millisecond latency, and an intuitive no-code platform to configure your pipelines. By leveraging Flow, you can ensure cost-effective, reliable, and streamlined Braintree to Google BigQuery integration.

Want to integrate data from multiple sources to the destination of your choice in near real time? Sign up to get started with Estuary Flow today.

Start streaming your data for free

Build a Pipeline