#Yeaasass

1 messages · Page 1 of 1 (latest)

flint forgeBOT
wary dock
#

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

wise lagoon
wary dock
#

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

wise lagoon
#

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?

wary dock
#

Exactly!

wise lagoon
#

Wonderful thank you. That does sound simpler than doing separate calls.

wary dock
#

Yeah, it is a pretty nice feature of the API. Can definitely make some flows a lot smoother