How to Extract Stripe Fees for Each Transaction Using the API

Easily extract Stripe fees per transaction using the API. Get to an accurate profit figure. Learn how to do it step by step ⭐️
Illustration with bold text 'Stripe Fees' on a light grey background, surrounded by pastel geometric shapes, related to Stripe transaction fee extraction.

Hide Me

Written By

Joshua
Reading time
» 4 minute read 🤓
Share this

Unlock exclusive content ✨

Just enter your email address below to get access to subscriber only content.
Join 114 others ⬇️
Written By
Joshua
READING TIME
» 4 minute read 🤓

Un-hide left column

Stripe is awesome. However it's important to know EXACTLY what you are spending on Stripe fees per transaction. Let's see how we can achieve this ⬇️

So you’ve received the data for the transaction via a Webhook. It all looks great and you want to import this to Xero, Quickbooks or Google Sheets – perfect! But then you realise – that you want to understand exactly what Stripe has charged for that transaction. How can you ever get a handle on your profit per order if you don’t know that?!

This guide is based around a scenario I’ve built in make.com – however it can be applied in any no code builder or your own hosted API process.

In this article 🔥

Downloads

The Video Guide

Setting the Stripe Webhook Up

To start receiving data from Stripe, you’ll need to subscribe to the webhook event which Stripe triggers when certain things happen.

To set up a webhook in your Stripe dashboard:

  1. Log in to your Stripe Dashboard.
  2. Navigate to DevelopersWebhooks.
  3. Click Add Endpoint.
  4. Enter your webhook URL (e.g., a Make.com webhook, your own API, or another automation tool).
  5. Select the events you want to capture. You’ll need the below event (you can subscribe to others also):
    • payment_intent.succeeded – Tracks successful payments.
  6. Click Save.
  7. Run a test payment to ensure you are receiving the correct data.

Accessing the fees after a Stripe transaction

Once the Stripe webhook is set up and capturing transactions, the next step is to extract the exact fees charged by Stripe for each payment. To do this, we need to access the Charges API endpoint and expand the balance transaction details.

🔗 Step 1: Retrieve the Charge ID

When Stripe sends a webhook event for a successful charge (e.g., charge.succeeded), it includes a charge ID in the response. This ID is crucial for retrieving detailed transaction data.

The charge ID will look something like this:

				
					{
  "id": "ch_1Nc1Xv2eZvKYlo2C1DfO9N8F",
  "amount": 10000,
  "currency": "gbp",
  "balance_transaction": "txn_1Nc1Xv2eZvKYlo2Cxyz",
  ...
}

				
			
🔄 Step 2: Call the Charges API

To get the full details of the charge, including Stripe fees, make a GET request to:

GET https://api.stripe.com/v1/charges/ch_1Nc1Xv2eZvKYlo2C1DfO9N8F

However, to include fee information, we need to expand the balance_transaction field. This allows us to access the detailed breakdown of processing fees and net payout.

🛠 Step 3: Expanding the Balance Transaction Fee

To retrieve fee details, modify the request to include ?expand[]=balance_transaction:
GET https://api.stripe.com/v1/charges/ch_1Nc1Xv2eZvKYlo2C1DfO9N8F?expand[]=balance_transaction

The API response will now include:

				
					{
  "id": "ch_1Nc1Xv2eZvKYlo2C1DfO9N8F",
  "amount": 10000,
  "currency": "gbp",
  "balance_transaction": {
    "id": "txn_1Nc1Xv2eZvKYlo2Cxyz",
    "amount": 10000,
    "fee": 290,  // Stripe fee in pence
    "net": 9710  // Amount after fee deduction
  }
}

				
			
📊 Step 4: Extracting Stripe Fees

From the response, we can now extract:

  • Total Amount Charged: amount (e.g., £100.00)
  • Stripe Fee: balance_transaction.fee (e.g., £2.90)
  • Net Amount Received: balance_transaction.net (e.g., £97.10)
➗ Step 5: Dividing by 100

Now that we’ve successfully retrieved the Stripe fee details, you may notice that Stripe returns all monetary values in the smallest currency unit (e.g., cents for USD, pence for GBP). This means that a fee of 290 actually represents $2.90 or £2.90.

To ensure accurate calculations and proper financial reporting, you will need to divide all amounts by 100 before displaying or storing them.

🎯 Conclusion: Accurately Tracking Stripe Fees for Perfect Profitability

Understanding exactly how much you’re paying in Stripe fees per transaction is crucial for accurate financial reporting and profit calculation. By following this guide, you’ve learned how to:

  • 🔗 Set up a Stripe webhook to capture transaction data in real time.
  • 💳 Access the Charges API to retrieve transaction details.
  • 📊 Expand the balance transaction to extract Stripe fees.
  • Convert values from cents to dollars (or other currency units).
  • Prepare the data for use in Google Sheets, Xero, or QuickBooks.

By automating this process, you eliminate guesswork and gain clear insights into your true profit margins. Whether you’re using Make.com, Zapier, or a custom API, integrating Stripe fee tracking into your workflow ensures better financial transparency.

🚀 What’s next? Now that you can extract Stripe fees accurately, consider automating further! Set up scheduled reports, track trends over time, or integrate AI-powered analysis for smarter financial decisions.

Happy automating! ⭐️

Last Updated

February 16, 2025

Category
Views
549
Likes
13

You might also enjoy 🔍

Minimalist digital graphic with a yellow-orange background, featuring 'Investing' in bold white letters at the centre and the 'Joshua Thompson' logo below.
Author picture
Caledonian’s strategic pivot into financial services, fuelled by fresh capital and two new investments.
This article covers information on Caledonian Holdings PLC.
Minimalist digital graphic with a yellow-orange background, featuring 'Investing' in bold white letters at the centre and the 'Joshua Thompson' logo below.
Author picture
Explore Galileo’s H1 loss, steady cash, and a game-changing copper tie-up with Jubilee in Zambia. Key projects advance with catalysts ahead.
This article covers information on Galileo Resources PLC.

Comments 💭

Leave a Comment 💬

No links or spam, all comments are checked.

First Name *
Surname
Comment *
No links or spam - will be automatically not approved.

Got an article to share?