#justin - schedules + promo codes
1 messages ยท Page 1 of 1 (latest)
Hello, good question. I am not sure our recommended way to apply promo codes for subscriptions on a schedule but am looking in to it.
cool cool, at least I'm not crazy!
Can you try adding the promo code again and send me the request ID (req_123) from the call that gets that error?
Yeah no worries, subscription schedules are one of our most complex API concepts
you want me to try adding a promo code to a subscription schedule you mean?
the error I was talking about in the above was when I was trying to apply a discount to an invoice like so (using ruby): Stripe::Invoice.update('in_1LUx5LHZaSBcFk7iOXaL0dwM', discounts: [{discount: 'di_1LUxHRHZaSBcFk7iw69tEA1p'}])
resulting in req_4iqqRICn8NAPHv
but that was a very last-ditch attempt to solve this problem, it doesn't feel right anyway
There we go, thank you. Not 100% if that will be relevant in the end but I wanted to make sure to have it on hand
sounds good! it feels like the missing piece here is having SubscriptionSchedules take a promotion_code parameter. I guess I want to confirm that doing so is impossible right now, and if that's the case figure out what the next best thing will be.
And thanks for your help
Still looking in to this but a quick update: I think the reason that the discount isn't applying is that the discount was added after the invoice was generated. I will probably need to look in to how to apply them to existing subscriptions like this in a moment/
And it looks like the way to apply the discount would be by setting coupon in the phase(s) for your subscription, but I forget if you need to apply it to each phase or just the first one and it won't be overwritten as long as you don't specify coupon in another phase
Do you have a quick test that you can run now to try adding coupon to just the first phase?
yeah that was actually my original approach. it seemed to work but then didn't:
- Create
SubscriptionSchedulewithcoupon(this makes the invoice work) - Update the
Subscriptioncreated by theSubscriptionSchedulewithpromotion_code
but the problem was that it redeemed the coupon, and then redeemed the promo code, and it was set to "one redemption per customer" (so this method results in double-redemption)
using a coupon in the first phase works beautifully, but the missing piece there is the promo code redemption.
what kind of test would you like me to run?
here's one with coupon in the first phase of the SubscriptionSchedule and the Subscription subsequently updated with a promotion_code: sub_1LUytgHZaSBcFk7ibf2BdjyY
Thank you for the info. Can you elaborate on why the second call to add the promotion code is necessary? Is the counter not updated correctly if you only use the coupon code in a phase?
that's exactly right
the second call is my attempt to redeem the promo code, but the issue I ran into is that it literally redeems the promo code/coupon twice
Gotcha. I am having trouble finding if there is a good way to do this myself at the moment so I am reaching out to my colleagues for help. I'll let you know what we can find
thanks, I've set liberal notifications on this thread
So it turns out you are correct, this is not currently possible in the API. It is on the roadmap but in the meantime you will need to track this redemption count yourself
is it possible to go about this from another angle? for example, applying the promo code to the invoice generated for the Subscription when the SubscriptionSchedule is created?
Hi there ๐ taking over for @narrow timber
Give me a few minutes to get caught up.
for example, applying the promo code to the invoice generated for the Subscription when the SubscriptionSchedule is created?
I think this would run into other problems. If I understand correctly, I think the redemptions would work as expected, but the coupon would be applied to the invoice and then there would be no subsequent applications of it for any other invoices/subscriptions
the discount object represents a single application of a coupon or promo code right?
I only want the promo code to apply to the first phase of the SubscriptionSchedule anyway. but when I tried to do this, I got the error described above (#1006652318156062741 message)
Ahhh, right right. Sorry about that oversight. I completely forgot that it doesn't work like that on the invoice level.
I can't think of another way to get this to work the way you're hoping. Hate to give that answer, but I don't know if this is possible without tracking redemptions on your end
so you think I can't apply a promo code directly to an invoice?
Correct. For invoice-level discounts you would either have to use Customer Balances, add negative invoice items, or add a second price that is a cheaper version of a product's usual price.
well crud. as far as this being on the roadmap, is that on the order of years away?
I would be really surprised if it wasn't released before the end of the year. I can't really elaborate beyond that, as it's not obvious what the release timeline is. I'm just judging by the work I can see that's been done on it already.
Likewise! Cheers
oh actually, if I could ask one followup?
I used SubscriptionSchedules because I needed to:
- Apply one price in the first month of the subscription
- Apply another price for all subsequent months
is there a better way to do this? The only alternative I could think of was to have my own scheduled job for updating the subscription but that seemed a lot more error-prone than letting Stripe deal with it for me
Subscription Schedules is definitely the best way to do that without having to meticulously curate a whole (likely pretty fragile) workflow to handle the switch from the first price to the second. Plus all the issues with proration that come along with that.