#adi.rishi
1 messages · Page 1 of 1 (latest)
hmmmm, can you point me to which doc / guide you're referring to to create multiple currencies for your Price?
alternatively, how are you creating multiple currencies? Are you just creating multiple Prices for a product - one for each currency?
Hey, sure thing. I'm using this doc - https://stripe.com/docs/payments/checkout/multi-currency-prices
Basically when you go to add a price, you can add more than one currency
so, when a user is sent to checkout, they get the correct local currency if I've made it beforehand
the issue is that I also want to show the user the price of the subscription before they get sent to checkout, and I want to show it in their local currency
trying to find a good way to do that right now
You can try Retrieve Price API expanding currency_options. Try it and let me know if that show all you need
Right, so I tried that. (see screenshot for price object)
When I make a call to GET https://api.stripe.com/v1/prices/price_1OJUeRSAZfucDubGMhZuWWiW
I get this back
{
"id": "price_1OJUeRSAZfucDubGMhZuWWiW",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1701667503,
"currency": "inr",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_OtVLHGcc5QJbuB",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 3900,
"unit_amount_decimal": "3900"
}
It doesn't seem to have currency options, which confused me a lot
You want to expand currency_options https://stripe.com/docs/expand
AMAZING, thank you, I didn't realise expanding properties was thing
So I'll have to do the work to detect user country in my own code right?
Any tips on how to do so? How does Stripe detect which country a user is in?
And I guess for my second question, will I have to basically figure it out and do it via the API, there is no nice way to enable all currencies in one go right?
Yes you will have to detect your customer country, ie, by looking at their IP Address.