#MYoussef-subscription
1 messages · Page 1 of 1 (latest)
Hi! You could list all active subscriptions with https://stripe.com/docs/api/subscriptions/list
And then for each subscription look at the coupon applied with https://stripe.com/docs/api/subscriptions/object#subscription_object-discount
my case is i want to enable my site administrator to delete coupons from control panel but i want to check if this coupon is used before deleting it
i think it is a big process to list subscription then check for each one
what do you think ?
I understand, but I don't see any other option with the API.
In the Stripe dashboard if you look at a specific coupon you can see the list of subscription where it was applied:
can i get this list of subscriptions by coupon id ?
What do you mean? In the dashboard you click on a specific coupon, and you will see the subscriptions were this specific coupon was applied.
yes i want to get the list of subscriptions by coupon id from API, can i do that?
If you want to use the API, then you should use the solution I shared above (I don't think there's another way):
list all active subscriptions with https://stripe.com/docs/api/subscriptions/list
And then for each subscription look at the coupon applied with https://stripe.com/docs/api/subscriptions/object#subscription_object-discount