Square provides financial solutions for businesses. We can use Square’s API to extract and import data into Google Sheets. In this tutorial, you will learn how to connect the Square API to Google Sheets in 6 steps:
To pull data from the Square API to Google Sheets, first install and open the Apipheny Google Sheets add-on.
Apipheny is a no-code API integrator for Google Sheets that you can use to connect to the Square API, make unlimited API requests, connect to other API data sources, save API requests, schedule API requests, and more. Click here for more info about Apipheny.
1. Install Apipheny by opening the following link in on desktop and then clicking the Install button on the page: https://gsuite.google.com/marketplace/app/apipheny/966163326746
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In this menu, you should see Apipheny. Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
After logging into your Square account, go to the Developer Dashboard:
Then click the +Create your first application button:
Complete the Application Name field, check the Terms and Conditions checkbox, and then click the Save button:
Your app is now created:
Next, click the Open button in your newly created app:
In the menu on the left, click the OAuth item, then at the top of this page, choose Sandbox. Complete the Sandbox Redirect URL (enter any URL) and then click the Save button:
In the Credentials section, you’ll find the Sandbox Access Token. Click the Show link to reveal the value of the token and then copy and paste the value of the API key in a safe location, because you’ll need it in the next steps
If you already know your URL and endpoint, or if you want to use the same example URL as us, just skip to Step 5.
First, open the Square API documentation page: https://developer.squareup.com/reference/square
The menu on the left contains a list of categories, each with its own endpoints:
If you click on a category (eg. Orders), a list with specific endpoints will be expanded in the main section of the page, along with a short description of that category:
An example endpoint is Create order, which creates a new Order that can include information on products for purchase and settings to apply to that purchase. The URL for that endpoint is:
Each endpoint’s documentation contains its HTTP method (POST), its request URI, a short description of its purpose, the list of required permissions and the list of request body parameters.
On a black section on the right, you will find the cURL command, the headers and an example response:
Go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import Tab open, enter these details into the add-on:
API URL: In Step 4, we explained how you can find the Square API endpoint that you need. Now copy the complete URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query.
For this example, we are using the List merchants endpoint, which returns Merchant information for a given access token. The corresponding URL for this endpoint is:
If you’re following the same example, just copy and paste this URL into Apipheny, where it says API URL.
Headers: In the API Headers section, add two rows with the following key and value:
Header 1 Key: Square-Version Value: Bearer 2021-01-21 Header 2 Key: Authorization Value: Bearer <your_token>
Where <your_token> is the value of the token you obtained previously, in Step 3. There should be a space between Bearer and <your_token>.
Here’s what your API request should look like in Apipheny, if you’re following the same example as us:
Lastly, click the Run button at the bottom of the Apipheny add-on and then wait for the Square API data to be retrieved and added to your Google spreadsheet:
After making a successful request to the Square API, try querying a different Square API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as: