#Ryan-Tech

1 messages · Page 1 of 1 (latest)

glad roostBOT
spark marsh
#

Hi there!

#

Can you calrify what is your question exactly?

gusty pumice
#

Sorry so after a payments gone through your hosted checkout.
it redirects back to a success page with the session id.
Is there a way i can retrieve what coupon code was used at checkout?

spark marsh
#

Got it! This should be possible, give me a few minutes to look into this.

#

Found it!

#

You need to retrieve the Checkout Session with expand: ["total_details.breakdown"]

#

And you'll see the promo code used.

gusty pumice
#

Thanks i took a look
i retrieved a total_detail object as follows
{
"amount_discount": 19980,
"amount_shipping": 0,
"amount_tax": 0
}

#

oh wait im using api version 2020

#

changed to current and same object

spark marsh
#

Did you add this, as I mentioned above: expand: ["total_details.breakdown"]

#

This object won't be displayed by default, it needs to be expanded, as mentioned in the doc

gusty pumice
#

sorry just saw that bit two second sill try again

spark pike
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

gusty pumice
#

Perfect all sorted

spark pike
#

would you mind closing the thread then?