#arn4v-checkout-coupon
1 messages · Page 1 of 1 (latest)
Is it possible to restrict existing coupons to a particular product?
Edit only lets me edit the name
no that's not possible to change after the fact
and you just said you are re-using the same product id anyways right?
I'm reconsidering it, if it's possible to disable these coupons which don't have any restrictions to our old product ids only
Can you suggest a migration path that we can do ourselves then?
The problem is, we now want to shift to applying coupon as discount on checkout session creation instead, which would allow us to restrict coupons as we want (like in case where we've heavily subsidized a product w/ a new priceId, and don't want an additional discount to be applied on top of the already subsidized price)
We want to remove coupons/discounts from customers that already have it, and save them in our db, so we can move to checkout scoped discounts
It's hard to help without a lot more specificities. Like what are those coupons, why are they still on Customers as Discounts, what to you plan to do with those long term, are they "forever" or something else, etc.
Hi, stepping in as koopajah needs to step away. Catching up
Making sure that I understand the ask fully, currently you have coupons on the customers. These coupons are expected to expire in 12 months. Now, you would like to move away from this and apply these coupons on the checkout, https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts instead. You're currently seeking to identify how to best transition to this on the customers that already have coupons?
Yes
I assume these customers have subscriptions, is that correct?
Some of them yes, many of them don't have active subscriptions.
I'm talking to a teammate on how to best achieve this. My initial thought is to remove the coupon on these customers (by setting the coupon to an empty string), then create new products and apply the new coupons to these products.
They agree with the above recommendation, and the only way to migrate is to remove these coupons from the customer by running a loop, then creating the products and apply the new coupons to the product.
That was my initial thought as well, but we'd have to iterate over well over thousands of customers.
Considering pagination fetches 100 at a time + we'd have to do async work inside the loop, I was trying to find an alternative approach.
I didn't see anything about filtering customers by coupon existence/specific coupon. That would be way easier.
The closest is by listing all customers, https://stripe.com/docs/api/customers/list and looking at the data.discount hash.
Got it. Thank you.