#shayan-shokat_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/1273915123232276483
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
invalid_request_error GET: /v1/exchange_rates
Could you please share the Request IDreq_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_4VUhG2zGVYg4l8
Where did you find a reference to this API method?
Chat GPT and co-polit suggestion, but unable to find it in official documentation or any alternate api in the documentation
the use case is that we're taking payments in multiple countries and in are analytics, we need it in one single currency
This is not a valid API method.
can you guide me of any alternate API in stripe to convert currency?
You can find the used FX rate on the Balance Transaction object for each Charge.
Could you give me an example payment that you need converted?
I've setup a webhook on charge.succeed event to get the charge, it can be subscription creation, renewal or onetime payment, then I need to convert the amount on USD because we already have payment in CAD and AUD which will give inacurate outcome of I just take the amount without currencies
id: 'txn_XXX',
object: 'balance_transaction',
amount: 24000,
available_on: 1724198400,
created: 1723789351,
currency: 'usd',
description: 'Subscription creation',
exchange_rate: null,
fee: 918,
fee_details: [
{
amount: 918,
application: null,
currency: 'usd',
description: 'Stripe processing fees',
type: 'stripe_fee'
}
],
net: 23082,
reporting_category: 'charge',
source: 'ch_XXX',
status: 'pending',
type: 'charge'
}
it's not giving exchange rate against balance transaction, this one in USD, let's say I have to convert it in CAD, how should I proceed?
You will need to use another service to fetch the current exchange rate then.
no API in stripe for this?
No
got it, thanks @stiff scroll
Happy to help.