By Rudderstack Team

How to load data from Square to Redshift

Square is a simple and powerful POS software for businesses. What if I want to get more data-driven and gather all my data from Square to my BI or custom analytics stack or to my data warehouse like Amazon Redshift? How can I analyze the data generated with Square? This guide is going to provide you with a clear picture of how to load data from Square to Redshift. We will use Square’s API to access and extract email-related data and load it into Redshift for further analysis.


You will need to write the code to get the data and make sure that this process will run every time new data is generated. Alternatively, in order to load your data from Square to Redshift, you can use products like RudderStack that can handle this kind of problem automatically for you.

What is Square?

Square is a simple and powerful POS software for businesses. It is designed to run on multiple devices, ranging from smartphones to a merchant’s counter, without requiring a couple of specialized equipment. As a Point of Sale software, it takes care of:

  • Digital receipts from your customers
  • Your product inventory
  • Sales reports
  • valuable analytics that you can use

to understand the performance of your business better. As a product, Square is suitable for both big and small businesses and scales accordingly to your needs.

The Point of Sale software of Square is free to download and use. It charges on a per-transaction basis. Square charges a flat, fixed rate of 2.75% of volume for all Visa, MasterCard, Discover, American Express, and other vendors transactions.

Additionally to the POS software, Square has a number of additional products, ranging from hardware that is needed for POS like:

  • Contactless chip readers to support EMV and NFC payments
  • MAGSTRIPE readers
  • or even stands to transform an iPad into a POS

to Payment and accounting related services like:

  • Payment processing
  • Invoice handling
  • Gift card management

Square has transformed from a POS software vendor to a complete payment platform which includes:

  • POS systems
  • Employee management
  • An app marketplace
  • Payroll services
  • and even appointment services

Finally, it is also offering a gateway to sell goods online, services to add the delivery for restaurants, and funding for small businesses.

As a platform, Square exposes a rich API that can be used to build applications that can be delivered via its app marketplace. This API is expressive enough to allow us to pull data that can be used for analytics. In this article, we will explore how we can use the Square API to pull this data.

What is Amazon Redshift?

Amazon Redshift is one of the most popular data warehousing solutions which is part of the Amazon Web Services (AWS) ecosystem. It is a petabyte-scale, fully managed data warehouse as a service solution that runs on the cloud. It is SQL-based and you can communicate with it as you would do with PostgreSQL, actually, you can use the same driver although it would be better to use the drivers recommended by Amazon.

You can connect either through JDBC or ODBC connections.

How to Extract my data from Square?

As a platform, Square exposes several different APIs that cover different needs.

  • E-commerce API, with which you can take payments using
  • Register API, which can be used to build your own applications for in-store or mobile payments.
  • Item & inventory management API.
  • Sales reporting & Analytics API.
  • Employee management API.

Square is currently maintaining two versions of the API, Connect v1 and Connect v2. There’s also an SDK for the Register API. It is possible that you might need to use both v1 and v2 of the Connect API, as not all endpoints have been implemented in the second and newest version. Mixing the two API versions together is encouraged by Square.

All the APIs that Square exposes are web APIs. As Web APIs follow the RESTful architecture principles, they can be accessed through HTTP. As a RESTful API, interacting with it can be achieved by using tools like CURL or Postman or by using HTTP clients for your favourite language or framework. A few suggestions:

Square also maintains official SDKs or libraries for the following languages:

Because of the popularity of Square, a number of unofficial libraries/SDKs are also implemented, so a quick search on Google or Github will help you find a library for your favourite framework or language.

Square API Authentication

In order to use the Square API, you first need to register a new application with Square. By doing that, you are also generating credentials that will be used to access the API endpoints.
To register your application:

  1. Go to https://connect.squareup.com/apps and sign in to your Square account.
  2. Click New Application and enter a name for your application.
  3. Click Create App.

The application dashboard displays your new app’s credentials. One of these credentials is the personal access token. This token gives your application full access to your own Square account. Copy its value to use in the next step.

Square API Rate Limiting

If Connect API endpoints receive too many requests associated with the same application or access token in a short time window, they might respond with a 429 Too Many Requests error. If this occurs, try your request again at a later time. The current rate is on the order of 10 QPS. This might change in the future and is not officially documented, so make sure that you properly handle our requests and responses.

Pull Data from the Square Platform

As mentioned earlier, Square exposes a number of APIs for different applications. Thus each one offers different opportunities for pulling useful data out of it. In this post, we will focus on how to get meaningful data out of the Square Connect API that can be used for analytics.

The Square Connect API allows us to use the Square platform to execute payment transactions, so a large number of endpoints are related to these tasks. We do not need to access these endpoints for analytic purposes. In a payment system, what we need to track and use as data for further analysis are events related to what is happening on our system. For example, we would like to be able to track when a new payment had happened, when