#S60-Cosminacho-coupons

1 messages ยท Page 1 of 1 (latest)

hazy lantern
flat lion
#

Helloo!

#

lets see, I was not able to find anything

#

hmmmmm

#

pi_3L2YncBUHziHdjOs2kWleWPc

#

look at this

#

it has a coupon

#

it doesn't seem that the discount is catched

hazy lantern
#

not sure what you mean?

flat lion
#

I am making a test with a coupon that is 50% currently

#

I will send you the session ID in a sec

#

okk... I managed to get the general discount

#

from the finalized checkout ๐Ÿ™‚

hazy lantern
#

ok, so all good?

flat lion
#

hmmm....is there a way to find out the discount code used from the checkout page?

#

as soon as it's completed

hazy lantern
#

like there's a discount object it links to and that should have details of the coupon and promo code used

flat lion
#

it doesn't ...I think there is a different API call for that

hazy lantern
#

yep you would have to retrieve the Discount object or use the expand feature

#

I can try to help if you share some of the code you use and what you see

flat lion
#

I am doing this with Integromat if you're familiar with it

#

essentially I am doing this to get the completed session:

hazy lantern
#

oh, hmm.

flat lion
#

and API call to sessions that contains a query string with the payment intent ID.

#

This is essentially the output:

hazy lantern
#

this is quite hard if you're not a developer yourself writing the code and calling the API.

Anyway, you need to expand fields on the CheckoutSession object when you retrieve it.
So you need to pass ?expand[0]=total_details.breakdown to the GET URL, however that's done in the tool you use.

flat lion
#

gotchaa ๐Ÿ™‚

hazy lantern
flat lion
#

will check in a sec

#

๐Ÿ˜„

#

soo

#

it's something like this

#

but there is no coupon / discount data

hazy lantern
#

can you share the raw JSON that was returned?

flat lion
hazy lantern
#

oh, you are listing Sessions, not retrieving one of them

#

then it's data.total_details.breakdown you should expand

#

you only did data.total_details in your screenshot

flat lion
#

give me a sec

#

it worked !

Thank you so much!

hazy lantern
#

awesome!

flat lion
#

thank you !

tardy hinge
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!