#Swarnali
1 messages · Page 1 of 1 (latest)
hello! do you have a PaymentIntent id for me to look at?
i have a webhook with paymentintent.succeeded event
it is working
need to also note these 2 data
can you share the PaymentIntent or event id for me to take a look?
i have not made any payments with coupon code yet
i understand that, can you share the object id so that i can take a look at how you're currently integrating?
stripe webhook id we_1NcQddSHjRN6CC0iDt1xwPGg
that's the webhook endpoint id, can i get the event id? or PaymentIntent id? the event id starts with evt_ and PaymentIntent id starts with pi_
evt_3Nck1WSHjRN6CC0i1buhpKWi
you should be able to get the coupon id by retrieving the checkout session object with total_details.breakdown expanded. so that they can get the coupon ID from total_details.breakdown.discounts[0].discount.coupon.id
how to do that from payment intent succeeded event object
you can't, the payment_intent.succeeded event object doesn't contain any data about the coupon
i suggest you listen for the checkout.session.completed event instead, and then request the Checkout Session, and expand [0] total_details.breakdown
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.