#eoghanobrien_checkout-coupons-multicurrency

1 messages ยท Page 1 of 1 (latest)

hallow nicheBOT
#

๐Ÿ‘‹ 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/1305649725327933531

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

vague citrus
#

๐Ÿ‘‹

hazy jungle
#

Hi, taking a look here

vague citrus
#

Thanks!

hazy jungle
#

You can listen to checkout.session.completed event and look at amount_discount for the discounted amount.

#

However, I think you're asking how to attain the discount id from the events

vague citrus
#

yes, I'm specifically looking for a coupon code

#

It seems I can listen for customer.discount.created but that seemed strange

hazy jungle
#

testing this on my end reql quick, hang tight

vague citrus
#

Got it, okay, thank you!

marsh hazel
#

Hi ๐Ÿ‘‹

Are you applying discounts to specific line items in your Checkout Sessions?

vague citrus
#

not to the line item per se, I'm applying it using the discounts.*.coupon option

marsh hazel
#

Ack. Then my colleague's approach is correct. I was just hopeful. you could get it from the line_items.data.discouts property

vague citrus
#

got it, can I do that and still get No cost orders?

marsh hazel
#

How do you mean?

vague citrus
#

nevermind, I checked the API docs, I can't pass a discount.coupon to a line item so it's moot, thanks for checking in though

#

actually, while I have you - if I pass a amount_off coupon with an amount and currency will that amount only be applied if the customer's currency matches the currency of the coupon? Or will it dynamically adapt the amount off in say usd to whatever the presentment currency is?

marsh hazel
#

I would think it would only apply if the currencies matched but have you tested this?

vague citrus
#

I haven't been able to get the alternate currency to show

marsh hazel
#

You can use a dummy value for the customer_email parameter like test+location_FR@example.com to spoof a customer from France so it'll trigger a EUR presentement currency

vague citrus
#

Ah - that's cool, thanks for that little nugget! Looks like it will try to base the discount on settlement and adapt for presentment - awesome

#

is there a cheat sheet with more hot tips like that!

marsh hazel
#

Unfortunately not that I know of. It's in our public docs somewhere, that's how I found out. But I've since implemented a dropdown with some useful emails to test multi-currency prices so I haven't had to look in a while

vague citrus
#

well thank you for your help! have a good one ๐Ÿ‘

marsh hazel
#

Sure thing! It's why we're here ๐Ÿ™‚