Stripe API

You can utilize the Stripe API to retrieve customer data for analytics directly into your Quadratic spreadsheet - using your preferred programming language.

To get started, you'll need your Stripe developer key(s):

Important Note
We recommend using the Restricted Keys feature at the bottom of your Stripe dashboard to grant only the permissions you'd like to expose in your spreadsheets. If exposed, Stripe data can include PII (Personal Identifiable Information) data.

Get Stripe balance using JavaScript

// Set your API key
let apiKey = "<API_KEY_HERE>";

// Define the endpoint
let url = "https://api.stripe.com/v1/balance";

// Make the request
let response = await fetch(url, {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${apiKey}`
    }
});

// Check if the request was successful
if (response.ok) {
    let balanceData = await response.json();
    return [Object.keys(balanceData), Object.values(balanceData)]; // Return the balance data to the spreadsheet
} else {
    console.log(`Error: ${response.status} - ${response.statusText}`); // Log the error to the console
    return null; // Return null or any other placeholder value to the sheet
}

Check out the Quadratic example sheet with Stripe API.

Need help making this connection? Feel free to contact us for assistance.

Quadratic logo

The spreadsheet with AI.

Use Quadratic for free