#Dharunkumar Natarajan

1 messages · Page 1 of 1 (latest)

shadow zephyrBOT
cosmic silo
#

basically I need to get the active redemptions for a coupon/promo code

shadow zephyrBOT
compact path
#

Good question, looking in to that. You can definitely get that info one way or another but I'll see if we have a way to do it without iterating through each subscription

#

Unfortunately not seeing much in the API itself. The easiest workaround that I can think of would be to add metadata to your customers when they have a discount applied and remove it when the discount is no longer active. You could then use the Subscription Search API to list all subscriptions with that metadata on them.

#

I can put in a feature request to add an easier way to list these to the API but I can't guaruntee that it will get added so it will be a good idea to have a workaround in the meantime

cosmic silo
#

thanks! when I see in the network tab in the dashboard, I can see an api request. Is there any way that I can use this to get the data somehow?

#

this api returns the customers who has used this promo/coupon code

compact path
#

Good catch! Just tested and it looks like that is an undocumented parameter that you can use

#

My apologies did not think to inspect the request like that. I thought we were getting it a different way but should have double checked

#

So yes you can just make a list customers call and add coupon: '123456' to your call and it should filter properly

cosmic silo
#

Thank you so much! just testes it out and it works

#

is there any way I can use this api with promo="DISCOUNT50" like that?

#

use the promo code instead of the coupon_id?

compact path
#

Good question. Will check in to that

#

Are you looking to differentiate which promo had the discount applied?

cosmic silo
#

yes, also to list all the customers who has used a specific promo code

shadow zephyrBOT
scarlet kelp
#

Since this isn't an official part of the public API there's no spec for that so I don't think it's possible -- pompey's suggest of tracking via metadata would be your best bet for future reference via Search API

cosmic silo
#

thanks!