#Jeff Jin
1 messages · Page 1 of 1 (latest)
Hello, yes there is a way to get this via the API. You have to retrieve a couple layers of objects
Basically a successful PaymentIntent will have a list of charges, the first Charge in that list will be the successful one, that charge has a balance_transaction property that represent the funds from that charge going to your account, on that balance transaction there is a fee property that shows the stripe fee that was charged
Can you tell me a bit more about how and when you would like to look up those fees? I am happy to link to our API references that are useful here
Hi, @slim geode thank you for your help. I want to retrieve the processing fee after i create a payment intent.
using stripe card.
So when doing that, you can use expansion to get this fee back along with the rest of the payment intnet info https://stripe.com/docs/payments/run-custom-actions-before-confirmation
If you expand charges.data.balance_transaction, you can go from your payment intent, to the first charge in its charges list, to that charge's balance_transaction property, and to that balance transaction's fee https://stripe.com/docs/api/balance_transactions#balance_transaction_object-fee
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The code that I mentioned should do that. One sec I can link to each field:
The payment intent has a list of charges https://stripe.com/docs/api/payment_intents/object#payment_intent_object-charges-data
The successful charge in that list will have a balance transaction https://stripe.com/docs/api/charges/object#charge_object-balance_transaction
And the balance transaction will have the fee in its fee property https://stripe.com/docs/api/balance_transactions#balance_transaction_object-fee
Oh, thank you