#_Rick-coupons
1 messages ยท Page 1 of 1 (latest)
Hi @lilac drift! To know when a payment link was paid, you can listen to the checkout.session.completed event. And in the Checkout object there should be somewhere the coupons applied (if any).
Hi @wooden cave, I've been looking at the checkout session with Stripe CLI stripe get "/v1/checkout/sessions/cs_test_b1HCIy2XvyowSjtZAUPmCxoFEiVnjKzqfuuW4yWeBbIhDEW2QRaEw10HRM" and in the response body there is nothing about the discount that was applied, nor in the line items, but I can see that it was applied and it shows up on the generated receipt ๐ค
It should be possible, please give me a few minutes to figure this out ๐
Sure thing, thanks ๐
Found it!
In the Checkout Session it's in total_details.breakdown.discount
https://stripe.com/docs/api/checkout/sessions/object?lang=python#checkout_session_object-total_details-breakdown
You will need to expand the response to see this field: https://stripe.com/docs/expand