#mtanzi-bulk-coupon-delete
1 messages · Page 1 of 1 (latest)
Hi there 👋 no, there is not a way to take bulk actions on those types of objects.
oh thanks.. so the only way is to fetch the list and then iterate and call the delete API call?
Exactly
thank you!
is there a way to retrieve the coupon passing the name?
Basically my problem is that I am writing a migration screipt to port the coupon from chargebee into stripe and I want to make sure they don't get duplicated if the script need to be run multiple time
my idea was :
- iterate over all the coupon in chargebee
- check if the coupon exist in stripe (checking the name)
- if present delete it
- create the new coupon
what's the best way you would recommend for point 2?
Hm, that is a bit tricky since we don't have a name filter when listing coupons.
In your position I'd probably list/export the coupons from both systems, and then write a script to compare the lists looking for and noting the differences. Then I'd only take action on the differences.