#MYoussef-subscription-coupon
1 messages ยท Page 1 of 1 (latest)
Hi ๐ you can make a request to update a subscription and apply a coupon by passing the ID for that coupon in the coupon parameter in that request:
https://stripe.com/docs/api/subscriptions/update#update_subscription-coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this is not what i mean, i already did that
i made a webhook to listen to invoice.paid (of subscription renewal) and it is working fine
i want to get the coupon id that applied to specific subscription while listen to invoice.paid
i check the documentation and i found that i can get it like that
but when i trigger my webhook i found that the subscription object is null although the subscriptionId parameter is not null
so,how to get the coupon id and how to get the subscription object in invoice.paid?
should i create another request to get the subscription object by id or is there any other way to load it with invoice object?
Yeah, you'll need to retrieve the subscription by using the subscription ID that is provided within the invoice object.