Get the fee from a Stripe PaymentIntent
A Stripe PaymentIntent has no fee or net field. Its latest_charge is a Charge, and the Charge's balance_transaction records what the payment did to your Stripe balance, fee included. Expand both in one call:
curl https://api.stripe.com/v1/payment_intents/pi_3QxExample \
-u "sk_test_YOUR_KEY:" \
-d "expand[]"="latest_charge.balance_transaction" \
-G
{
"id": "pi_3QxExample",
"object": "payment_intent",
"amount": 5000,
"status": "succeeded",
"latest_charge": {
"id": "ch_3QxExample",
"object": "charge",
"amount_captured": 5000,
"balance_transaction": {
"id": "txn_3QxExample",
"object": "balance_transaction",
"type": "charge",
"amount": 5000,
"fee": 175,
"fee_details": [
{ "amount": 175, "currency": "usd", "type": "stripe_fee" }
],
"net": 4825,
"status": "pending"
}
}
}
On API version 2022-08-01 or older, expand charges.data.balance_transaction instead. The balance transaction fields that matter:
| Field | What it holds |
|---|
fee | Every fee on this transaction, in the smallest currency unit, positive. |
fee_details | The fee split by type: stripe_fee, application_fee (a Connect platform's cut), payment_method_passthrough_fee, tax, or withheld_tax. |
net | amount minus fee: what reached your balance. |
status, available_on | Whether the net is still pending, and when it becomes available. |
fee_details splits the fee by who charged it, not by how it was priced. A card's international or currency-conversion surcharge sits inside the one stripe_fee amount.
When the balance transaction isn't there yet
Stripe's documentation says the PaymentIntent must be captured and have a status of succeeded before its fees are available. That rules out an authorization you haven't captured and an ACH Direct Debit payment still in processing. Even after success, the expansion can come back empty: since API version 2024-04-10 the default capture_method is automatic_async, and Stripe creates the balance transaction in the background. The Charge's balance_transaction can be null right after confirmation.
The dependable path is the charge.updated event, which Stripe sends when balance_transaction is set. Read the fee in that handler and store it, rather than in the code that confirms the payment. On IC+ pricing, Stripe says the balance transaction doesn't carry payment fee information at all, and points to its Payment fees report instead.
Refunds and disputes are separate balance transactions
The Charge's balance transaction describes the charge "not including refunds or disputes." Each refund has its own balance_transaction, and a dispute has a balance_transactions list for the funds withdrawn and any reinstated. Stripe doesn't return its original processing fee when you refund, so a fully refunded payment still cost you its fee.
| What it cost | Where Stripe keeps it | The catch |
|---|
| The processing fee | PaymentIntent > latest_charge > balance_transaction: fee, fee_details, net | Only once the PaymentIntent is captured and succeeded, and with the default automatic_async capture the balance transaction can arrive after that. |
| Each refund | Refund > balance_transaction | A separate object per refund. The charge's balance transaction leaves refunds out. |
| A dispute | Dispute > balance_transactions[] | A list: funds withdrawn, and funds reinstated if you win. |
| The order it belongs to | Your database, keyed by PaymentIntent ID or metadata | Stripe has no order object, so the join to a sale is yours to keep. |
Fees per order on Stripe
Stripe has no order object, so the fees for a sale are yours to assemble. A typical setup stores each PaymentIntent ID against your order row, handles charge.updated to copy in the fee once the balance transaction exists, and handles refund and dispute events to add their balance transactions as they post. An order paid in two payments, or refunded twice, needs every one of those rows joined before its margin is right. A nightly job usually backfills whatever a webhook missed. Stripe payout reconciliation walks through the same join at month end.
Flint puts the fee on the payment
Flint is a payments API with orders built in, and every payment intent reports what it cost. No expansion and no second object: retrieve the payment intent and the fee is there.
curl https://api.withflintpay.com/v1/payment-intents/pi_01KEZF7C0012ZTCGDTXP9S02QD \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": {
"payment_intent_id": "pi_01KEZF7C0012ZTCGDTXP9S02QD",
"order_id": "ord_01KEZF7C0054GQKJ142A8X367A",
"status": "succeeded",
"captured_money": { "amount": 5000, "currency": "USD" },
"processing_fee_money": { "amount": 210, "currency": "USD" },
"processing_fee_details": [
{ "type": "base", "amount_money": { "amount": 175, "currency": "USD" } },
{ "type": "fixed", "amount_money": { "amount": 35, "currency": "USD" } }
],
"add_on_fees": [],
"merchant_net_money": { "amount": 4790, "currency": "USD" }
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}
processing_fee_details itemizes how the fee was priced, not just who charged it. Alongside base and fixed, an international_card, currency_conversion, manual_entry, or tap_to_pay entry appears when that surcharge applied, and the entries always sum exactly to processing_fee_money. Invoice, subscription, and automatic tax fees are listed one by one in add_on_fees, and merchant_net_money is what you keep after all of them and any platform fee. A payment for an order carries its order_id, so the fee is already attached to the sale.
Every fee on an order, in one request
Balance transactions filter by order_id. One request returns the order's payments, refunds, and disputes, each with its fee_money and net_money. Here the order above was later refunded $10.00:
curl "https://api.withflintpay.com/v1/balance-transactions?order_id=ord_01KEZF7C0054GQKJ142A8X367A" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"balance_transaction_id": "btxn_01KEZF7C00Q8M2W6R4T9V3X5YA",
"type": "refund",
"status": "available",
"currency": "USD",
"amount_money": { "amount": -1000, "currency": "USD" },
"fee_money": { "amount": 0, "currency": "USD" },
"net_money": { "amount": -1000, "currency": "USD" },
"order_id": "ord_01KEZF7C0054GQKJ142A8X367A",
"related_resource": { "resource_type": "refund", "resource_id": "ref_01KEZF7C00B5D7F9H1K3M5P7RT" }
},
{
"balance_transaction_id": "btxn_01KEZF7C00DDB37NDTWTG7DDNW",
"type": "payment",
"status": "available",
"currency": "USD",
"amount_money": { "amount": 5000, "currency": "USD" },
"fee_money": { "amount": 210, "currency": "USD" },
"net_money": { "amount": 4790, "currency": "USD" },
"order_id": "ord_01KEZF7C0054GQKJ142A8X367A",
"related_resource": { "resource_type": "payment_intent", "resource_id": "pi_01KEZF7C0012ZTCGDTXP9S02QD" }
}
],
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4G"
}
Sum net_money for what the order left in your balance, and sum fee_money on its own for what it cost in fees. Don't subtract the fees from the net again. A dispute posts here too, with any processor dispute fee in its fee_money. To store fees as they happen, subscribe to balance_transaction.created: the payment's event carries the fee, with the order_id on it. An order paid in several payments lists each of them, and GET /v1/payment-intents?order_id=... returns each payment's breakdown.
A period of fees as a CSV
For month end, generate a payments_itemized_v1 report. Each row is a succeeded payment with order_id, the processing fee and each of its components, each add-on fee, any platform fee, and merchant_net_money. The reconciliation guide matches the same balance transactions to your bank deposits.
On your own Stripe account
Flint can set up the Stripe account your business processes on, so you don't need one of your own. Already processing on Stripe? Connect that account and keep its pricing. Stripe takes its fee from each payment as usual, and Flint reports both fees on the payment intent: processing_fee_money is Flint's, and provider_fee_money is Stripe's, read from the payment's Stripe balance transaction. merchant_net_money subtracts both. Because Stripe creates its balance transaction after the payment, Stripe's fee and the net can appear a little after Flint's fee does. The payment's Flint balance transaction splits its fee_money into flint and processor_fee entries in fee_details.
Stripe and Flint, side by side
| What you need | Stripe PaymentIntents | Flint |
|---|
| Fee for one payment | Expand latest_charge.balance_transaction on the PaymentIntent and read fee. | processing_fee_money on the payment intent, with no expansion. |
| What makes up the fee | fee_details entries typed stripe_fee, application_fee, tax, and others. The surcharges inside Stripe's fee aren't itemized. | processing_fee_details: base, fixed, and each surcharge that applied, summing exactly to the fee. Add-on fees are listed separately in add_on_fees. |
| What you kept | net on the charge's balance transaction. | merchant_net_money on the payment intent, after every Flint, add-on, and platform fee. |
| Refunds and disputes | One balance transaction per refund and a list per dispute, each found from its own object. | Rows in the same balance transactions list, each carrying the order_id. |
| Everything one order cost | Your join: PaymentIntent IDs stored against the order, then every charge, refund, and dispute. | GET /v1/balance-transactions?order_id=... and sum net_money. |
| A period in a spreadsheet | Stripe's reports, joined to your orders table. | payments_itemized_v1: every succeeded payment with each fee, the net, and order_id. |
The processing fees guide has the formula, the published rates, and when each fee becomes final, and the money movement API reference has every balance transaction field.
Questions, answered
Why is there no fee on the Stripe PaymentIntent?
Stripe records fees on balance transactions, not on the PaymentIntent. The PaymentIntent's latest_charge points to a Charge, and the Charge's balance_transaction holds fee, fee_details, and net. Retrieve the PaymentIntent with expand[]=latest_charge.balance_transaction to get all three in one call.
Why is balance_transaction null on my Stripe charge?
Either the PaymentIntent hasn't succeeded yet, as with an uncaptured authorization or an ACH Direct Debit payment that is still processing, or Stripe hasn't created the balance transaction yet. Since API version 2024-04-10 the default capture_method is automatic_async, and Stripe creates the balance transaction in the background after the payment succeeds. Listen for charge.updated, which arrives when balance_transaction is set, and read the fee then.
Does Stripe return its fee when I refund a payment?
No. Stripe's refunds documentation says its processing fees from the original transaction aren't returned. The refund gets its own balance transaction for the refunded amount, and the original charge's fee stays where it was.
How do I see the fee on Stripe with IC+ pricing?
Stripe says IC+ users can't retrieve payment fee information from the balance transaction and should use its Payment fees report instead.
Can I get the fee before the payment is made?
Not from the API. Stripe's fee appears on the balance transaction after the payment succeeds, and Flint reports its fee when the fee becomes final. On Flint the fee follows a published formula: the percentages that apply are added, rounded half up once, and the fixed amount is added once per payment, so you can compute what a payment will cost from your rates.
When does the fee appear on a Flint payment intent?
When it is final: at capture for cards, Apple Pay, Google Pay, and Affirm, and when the payment succeeds for ACH debit, usually days after you confirm it. An authorization you haven't captured, or an ACH payment still processing, has no fee fields yet. A payment that is never captured, such as a canceled hold or a declined card, is never charged.
How do fees work when Flint runs on my own Stripe account?
Stripe takes its fee from each payment as usual, and Flint reports it beside its own. processing_fee_money is Flint's fee, and provider_fee_money is Stripe's, which Flint reads from the payment's Stripe balance transaction once Stripe creates it. merchant_net_money subtracts both, so it appears once both are verified. Until then, read the payment intent again later or wait for the balance_transaction.created event.
Do refunds or disputes change the fee on a Flint payment?
No. The payment's processing fee and add-on fees stay as charged, and Flint charges nothing to refund. A refund posts a balance transaction with fee_money of 0, and a dispute's balance transaction carries any processor dispute fee in its own fee_money. List the order's balance transactions to see all of them together.
Sources