#Yeaasass
1 messages · Page 1 of 1 (latest)
You will want to look at the balance transaction object that is attached to the charge. Balance transactions have fee information and a field that shows the net amount you got after the fee:
https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-fee
https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-net
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ahh that's perfect, thank you.
Of course, glad I could help. Also if you aren't already using expansion, it may be helpful here. You can get all the way to these balance transaction objects when retrieving/listing payment intents so it can save you a couple of API calls https://stripe.com/docs/api/expanding_objects#expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Very nice, we'll look into that as well. THanks.
So how would you retrieve the balance transaction from a Payment Intent? I see balance transaction in the response for "retrieve a charge" but do not see it in the response for "retrieve a payment intent".
Oh actually I see there is "latest charge". So we'd retrieve a payment intent, expand the latest charge, and then expand the balance transaction from there?
Exactly!
Wonderful thank you. That does sound simpler than doing separate calls.
Yeah, it is a pretty nice feature of the API. Can definitely make some flows a lot smoother