#theglobe
1 messages · Page 1 of 1 (latest)
Are you passing the coupon in a checkout session? What kind of payments are these?
there are times where I am passing the coupon prefilled (https://checkout...../F?prefilled_promo_code=promocode) and sometimes the user adds them manually
it's a pre made Stripe checkout page
the payment is for a product (not a subscription, but a one-time purchase product)
Should be able to listen to https://stripe.com/docs/api/events/types#event_types-checkout.session.completed then
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Discount data is on the session: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-discounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, so I am using the checkout.session.completed as the event for my webhook, but it's not passing the coupon
Can you send me a checkout session id then?
Where you passed a coupon
Or a checkout.session.completed event ID where you passed a coupon?
cs_live_b1B9oSWE7bmXBjPH0IzW0g0yEM22rxRlBy20uOX5AN5yE5TDRVjHbcAngv
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Ah right
It's because line_items isn't included in the event body by default. See the note here: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You so you'll need to retrieve the session object and expand it
oh okay. I will try that then. thank you so much