#philip-staccs
1 messages · Page 1 of 1 (latest)
Hi there!
The code you shared adds the coupon to the customer and it should work. Can you clarify what is the issue? You would like to apply the coupon in a specific currency?
it works but it only uses the default currency
I want to use the ones inside currency_options
as we have 5 currencies on our services
I'm not sure how coupons work with multiple currencies. Can you share the customer ID (cus_xxx) where you added the coupon?
cus_MwCOqK22ThxLUp
Thanks! Give me a few minutes to look into this.
I see you made this request to add the coupon: https://dashboard.stripe.com/logs/req_FFtl8jy54pXREu
And it's using the SEK currency, which is the default of the coupon.
yes but how do I use the currencies inside currency_options?
I have no use for the default one
there are no other customer exampels cause the fail
they*
I can do this in a GET
const getCoupon = await stripe.coupons.retrieve(
coupon,
{ expand: [`currency_options`] }
)
which returns
"currency_options": {
"dkk": {
"amount_off": 40000
},
"eur": {
"amount_off": 5000
},
"nok": {
"amount_off": 50000
},
"sek": {
"amount_off": 50000
}
},
but how do I specify it in the customer object?
Good question. In this case since the customer has no set currencies, then the default currency of the coupon is automatically applied. Give me a few minutes to run some tests.
What I see in my tests:
- If the customer has no default currency set, then applying a coupon with multiple currencies will always use te default currency by default. I don't see a way to force the currency in this case.
- If the customer already has a default currency set, then applying a coupon with multiple currencies will automatically apply the correct currency.-
You can learn more about customer's default currency here: https://support.stripe.com/questions/setting-a-customers-default-currency
yes, seems correct. Thank you!
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!