How to connect the Stripe API to Google Sheets

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, we’ll show you how to connect the Stripe API to Google Sheets in 5 steps:

  1. Install the Apipheny Google Sheets 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 add-on for Google Sheets

Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

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

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 endpoint, or you want to use the same example 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 endpoints should be appended to this base URL.

Step 4.) Enter your Stripe API request 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.


API Tutorials



API Knowledge

What is an API?
What is an API URL?
What are parameters?
What is an endpoint?
What is an API key/token?
What is basic authentication?
What are headers?
What is a GET request?
What is a POST request?