#geo_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1488250320877392114
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! Taking a look ๐
I see that the Charge was for 6100 GBP and there was a platform fee (AKA application fee) for 319 GBP. Is this the fee you're referring to? Or do you see a currency conversion fee?
Ah I see that the platform fee of 319 GBP was converted to 416 USD. Are you looking for an event to show the 416 USD or the exchange rate used?
Sorry, got hit with a confirm your phone number thing here and that turned into a journey lol
yes, I'd like to store the fee in gbp and also the converted amount to usd
in the charge.succeeded event I only see the gbp one but not the other
I really just want the usd amount
Thanks for clarifying! Let me see if I can find an event or endpoint that exposes the converted amount...
thank you for the help
No problem, thanks for your patience!
You should be able to listen for application_fee.created events: https://docs.stripe.com/api/events/types#event_types-application_fee.created
Then, you can expand the balance_transaction: https://docs.stripe.com/api/application_fees/object#application_fee_object-balance_transaction
And that amount should be the USD amount you're looking for: https://docs.stripe.com/api/balance_transactions/object#balance_transaction_object-amount
I guess I can look at the docs but if you know, when does that event trigger?
It triggers when an application fee is created on a charge so in your case, when the 319 GBP was taken from the total and converted to 416 USD ๐
hmm is there an api from which I can extract the same information?
just trying to explore which approach makes the most sense
Yep! You can get the application_fee and/or balance_transaction directly from the Charge object:
awesome! I think I can take it from here, thank you so much for your help!
You're welcome, good luck!
sorry are you still around
Yes, how can I help?
does stripe.balanceTransactions.retrieve contain this information? I see it has a fee and field_details props
can't tell from the api docs
also I can't tell which prop I'm supposed to take from these?
Sorry for the delay! I was double checking what I told you before. Looks like charge.balance_transaction won't give you what you want. You need to stick to charge.application_fee.balance_transaction.amount which will be in your platform's settlement currency (USD). Please try that and let me know if it works!
Also, this diagram shows how all the objects are related if you're curious: https://docs.stripe.com/connect/direct-charges?platform=web#flow-of-funds-with-fees