#drzajwo_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/1268561214326177802
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Your Price is a multicurrency Price
So it is localizing based on your location
I assume you are in the US, so it is localizing to USD
Ah sorry I see what you are saying
This is server-side on creation
I was using the vpn to move my location to UK, then when I was issuing subscription currency was properly detected to GBP (producs default is USD but supports GBP)
I assume USD is set as the default on the Price though, one sec.
Yep USD is the default
soo is it then configuration issue?
No it is fine, your top level Subscription response shows currency: 'gbp'
to return same currency as one on which subscripition was issued?
Really all of this is handled by us automatically based on geolocation
You are doing the correct thing here
If you want to create a Subscription for a UK customer
You can see the initial Invoice was generated in GBP
So that Subscription is locked into GBP now
so when getting subscription I should get GBP?
because now stripe.subscriptionItems.retrieve returns me currency: usd
If you are concerned about the actual currency of the Sub then you should look top level
Not at the subscriptionItem
so my goal is to retrieve subscriptionItem with the currency on which the transaction was made. Any hint how to do that? I don't get what top level is :/
You retreive the Subscription itself using https://docs.stripe.com/api/subscriptions/retrieve, not the Subscription Item
Then you can either expand the latest_invoice to see the actual data about the most recent invoice
Or you can look at the currency on the Subscription (which is what I mean by top level): https://docs.stripe.com/api/subscriptions/object#subscription_object-currency
You don't want to look at the Subscription Item as the Price itself will just show you data about the default currency/amount.
ah! got it now! thanks!!
๐