#GORR
1 messages · Page 1 of 1 (latest)
What event are you listening to right now?
I need the promo code data and custom field data in the webhook trigger
I mean what webhook event (i.e., invoice.paid) are you listening to?
Invoice payment succeeded
OK, you should retrieve the invoice object and expand the discounts (https://stripe.com/docs/api/invoices/object?lang=php#invoice_object-discounts) to view the coupon and promo codes
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks for waiting, have you tried my suggestion to get the discounts and view the coupon and promo codes inside it?
still not received
Can you share with me the code?
Hey,
Hello
How could I get promo code and invoice payment succeeded data in same trigger
Which event are you handling?
Event first i created is payment succeeded
But I'm not receiving any data of promo codes in the event
payment_intent.succeeded?
Invoice.succeeded in webhook
I guess you mean invoice.payment_succeeded. If so, that will return an Invoice object which will contain an expandable discounts field: https://stripe.com/docs/api/invoices/object#invoice_object-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.
You'll need to make an additional API call to expand that field, and it'll contain the promotion_code field: https://stripe.com/docs/api/discounts/object#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.
Do we get customer data on that webhook??
The invoice.payment_succeeded event includes the full Invoice object, including the customer field: https://stripe.com/docs/api/invoices/object#invoice_object-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Depending on what details you need, you may need to expand that too
but even though i created a new webhook for promotion.code.updated i'm not receiving the customer or incoice details
Why are you listening for promotion_code.updated events? I didn't recommend you do that
how do i map the promocode to the cutomer invoice then?
I explained that above:
I guess you mean invoice.payment_succeeded. If so, that will return an Invoice object which will contain an expandable discounts field: https://stripe.com/docs/api/invoices/object#invoice_object-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.
You'll need to make an additional API call to expand that field, and it'll contain the promotion_code field: https://stripe.com/docs/api/discounts/object#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.
By additional API call, I mean to retrieve the Invoice and expand the field. We don't contain expanded fields in webhook payloads
what will be the event?
invoice.payment_succeeded
for promo codes?
for when an invoice is paid. And then you look at the invoice and can see which if any promo code was used, and then update your records to know that a certain promo code was redeemed
there's no specific event to tell you directly what you want, you have to do it this way
But in invoice i checked and didn't find any!
which promo code applied was not seen on the invoice!
what's the ID in_xxx of the Invoice where that happened?
the coupon name was visible, but promo code is not tracked .
BAB52F09-0001
in_1N6mgFAQ4Feo03OkMNLkcKiD
will have a look in a little while
is there any zoom call support for stripe?
no
i have created a coupon for 10% discount, in that coupon in created 41 promo codes,
Now i need to find which promo code is used by the customer / particular invoice !
this is the problem i'm facing now
I know
so if you look at the event : https://dashboard.stripe.com/events/evt_1N6mgLAQ4Feo03OkubHvB0k0 you can see that the promo code is in the discount field , exactly as my colleague said
But in invoice i checked and didn't find any!
how did you check, what code did you use or so on?
but every time when a customer applies the code do i have to check the code to identify the promo code applied?