#S60-Cosminacho-coupons
1 messages ยท Page 1 of 1 (latest)
generally, looking at https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown when handling the checkout.session.completed event should let you know that
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
not sure what you mean?
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 ๐
ok, so all good?
hmmm....is there a way to find out the discount code used from the checkout page?
as soon as it's completed
looking at https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown when handling the checkout.session.completed event should let you know that
like there's a discount object it links to and that should have details of the coupon and promo code used
it doesn't ...I think there is a different API call for that
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
I am doing this with Integromat if you're familiar with it
essentially I am doing this to get the completed session:
oh, hmm.
and API call to sessions that contains a query string with the payment intent ID.
This is essentially the output:
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.
gotchaa ๐
if you do that then the information I mentioned will be there, since it's not included by default, you have to explicitly ask for it(https://stripe.com/docs/expand#includable-properties)
will check in a sec
๐
soo
it's something like this
but there is no coupon / discount data
can you share the raw JSON that was returned?
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
awesome!
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!