#min.k4501
1 messages · Page 1 of 1 (latest)
hi!
answer to both questions I think is that it should be in breakdown at https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown I think, you have to explicitly expand that field to see it
Let's take this a step further: how do we know that the coupon was redeemed in the webhooks that are delivered when the subscription and one-time payment are completed?
it's the same answer
when you receive the webhook you can call the CheckoutSession Retrieve API, expand the total_details.breakdown field, and inspect the returned JSON from the API
But for subscriptions, coupons can be applied multiple times. Can I check from the invoice.paid event if a coupon was applied to a payment generated by a subscription?
sure, there is a discounts field on each Invoice which contains that information. https://stripe.com/docs/api/invoices/object#invoice_object-discounts