#natalia_91907
1 messages · Page 1 of 1 (latest)
Are your customers applying promo code through checkout sessions?
yes they are
OK, there's no API to retrieve the redemption history. You need to listen to checkout.session.completed event, expand breakdown to the discounts list (https://stripe.com/docs/api/checkout/sessions/object?lang=php#checkout_session_object-total_details-breakdown-discounts-discount), from there you can find the promo code (https://stripe.com/docs/api/discounts/object?lang=php#discount_object-promotion_code).
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Based on these information, you'll then update your DB to record which customer used this promo code.
Ok thank you, so there is no way to get this information on the business level from Stripe portal?
In Dashboard, you can find a "active redemptions" for each coupon, but there's no "active redemption" for promo codes. So yes you need to build it by yourself.