How to integrate Stripe with Google Sheets using the Stripe API

Stripe is an online payment processing software for internet businesses. Stripe’s payment APIs power commerce for businesses of all types and sized from startups all the way to Fortune 500 companies.

In this tutorial, I’ll show you how to connect the Stripe API to Google Sheets in 5 steps:

  1. Install the Apipheny Google Sheet’s add-on
  2. Get your Stripe API Key
  3. Choose your Stripe API Endpoint
  4. Enter your Stripe API request into Apipheny
  5. Run the Stripe API Request in your Google Sheet

Step 1.) Install and open the Apipheny API add-on for Google Sheets

To pull data from the Stripe API into Google Sheets without writing any code, 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 make unlimited API requests to the Stripe API, connect to unlimited API data sources, save your API requests, schedule API requests to refresh on a hourly or daily basis, and more. Click here for more info about Apipheny. There’s a free trial included.

1. Install Apipheny by opening the following link in on desktop and then clicking the Install button on the next page: https://gsuite.google.com/marketplace/app/apipheny/966163326746

You can install the Apipheny add-on in the G-Suite Marketplace
You can install the Apipheny add-on in the G-Suite Marketplace

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons option in the top menu. In the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets, as you can see in this screenshot:

After you've installed the Apipheny add-on, open it in your Google Sheet by clicking Add-ons > Apipheny > Import API
After you’ve installed the Apipheny add-on, open it in your Google Sheet by clicking Add-ons > Apipheny > Import API

Step 2.) Obtain a Stripe API key

Next, log in to your Stripe account.

Every account comes with separate keys for testing and for running live transactions.

Each account has four keys, organized as two pairs. One pair of keys is publishable (for test mode) and one pair of keys is secret (for live mode).

Your API keys are always available in the Dashboard > Developers > API keys:

Accessing my Stripe account API Keys
Accessing my Stripe account API Keys

On the API keys page, click the “Reveal test key token” button to display your API secret key.

Copy and paste your secret key in a safe location because you will need it in the next steps.

Get your Stripe API secret key on the API keys page in your Developer Dashboard
Get your Stripe API secret key on the API keys page in your Developer Dashboard

Step 3.) Choose your Stripe API Endpoint URL

In this section, we’ll show you how to browse the Stripe API documentation to find the exact Stripe API URL that retrieves the specific information you need from your Stripe account, also known as an endpoint.

If you already know your Stripe API URL/endpoint, or you want to use the same example Stripe API URL as us, just skip to Step 4.

To choose your endpoint, first open the Stripe API documentation page: https://stripe.com/docs/api

The menu on the left of that page contains a “Get started guide” and a list named “CORE RESOURCES”, which contains a list of categories, and each category has its own endpoints:

Stripe API documentation
Stripe API documentation

If you click on an API category, the page will scroll to that category’s section, which contains a list of associated endpoints for that API category.

For example, when clicking the “Customers” API category, the page scrolls to an introduction section and a list of the 5 available endpoints for this category:

  • Create a Customer
  • Retrieve a customer
  • Update a Customer
  • Delete a Customer
  • List all Customers

An example Stripe API endpoint is List all Customers, and this is what the whole API URL for this endpoint looks like:

https://api.stripe.com/v1/customers

Each endpoint’s documentation contains descriptions of the endpoint’s purpose, the available parameters, and the expected response.

On a separate column on the right, you can find the CURL request to the endpoint and an example response:

"List all customers" Stripe API endpoint example
“List all customers” Stripe API endpoint example

All API calls to the Stripe API should be made with this base URL:

https://api.stripe.com/v1/

All Stripe API endpoints should be appended to this base URL.

Step 4.) Enter your Stripe API URL into the Apipheny add-on

Now 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:

Method: At the top of the Apipheny add-on, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the Stripe REST API endpoint that you need. Now copy and paste your complete Stripe API URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query (if applicable).

For this example, we are using the Balance endpoint that returns your Stripe balance. This is what the whole URL looks like:

https://api.stripe.com/v1/balance

If you want to follow the same example as us, just copy and paste this API URL into Apipheny, where it says “API URL”.

Headers: In the “Headers” section of Apipheny, add one row with the following key and value:

Key:
Authorization
Value:
Bearer <your_secret_key>

Replace “<your_ secret _key>” with the value of your token that you got in Step 2. Don’t forget to put the word “Bearer” before your key, with a space between “Bearer” and “your_ secret _key”, like this:

Stripe API request entered into the Apipheny add-on in Google Sheets
Stripe API request entered into the Apipheny add-on in Google Sheets

Step 5.) Run the Stripe API Request

Finally, to pull Stripe data into your Google Sheet, click the Run button at the bottom of the Apipheny add-on and then wait for the Stripe API data to be imported into your Google Sheet.

Stripe API data imported into Google Sheets by connecting the Stripe API to Google Sheets using the Apipheny add-on
Stripe API data imported into Google Sheets by connecting the Stripe API to Google Sheets using the Apipheny add-on

After making a successful request to the Stripe API, try querying a different Stripe API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

  • Save and schedule your Stripe API request
  • Make a POST request to the Stripe API (if available)
  • Use the custom =APIPHENY() function to call the Stripe API request inside a cell of your spreadsheet
  • Create a Stripe API request by referencing the value of a cell in your Stripe API URL with three curly braces eg. {{{Sheet1!A1}}}

If you want to get Stripe data into Google Data Studio, just follow the same steps above and then connect your Google Sheet to Google Data Studio.

Pull API data into Google Sheets – Apipheny Demo

Related articles:

Related Posts