#min.k4501

1 messages · Page 1 of 1 (latest)

winged vaultBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

  • min.k4501, 2 hours ago, 22 messages
  • Min.K, 4 days ago, 28 messages
  • Min.K, 5 days ago, 45 messages
  • Min.K, 6 days ago, 7 messages
  • Min.K, 6 days ago, 3 messages
  • Min.K, 6 days ago, 3 messages
tepid bay
#

Hi there!

#

Does the code you shared above work or not?

winter charm
#

I will respond within 20 minutes.

Please do not close this thread.

tepid bay
#

this thread may close automatically because of inactivity. if that happens, feel free to reopene a new threads in #dev-help

winter charm
#

Hi

#

Hi there!
Does the code you shared above work or not?

=> It works.
However, if there is a coupon that was previously applied, it must be applied to the next subscription as well.

To do this, you must determine whether or not the coupon should be applied to the next subscription schedule based on the response received through the Create Subscription Schedule API.

warm maple
#

What does you mean by 'it must be applied to the next subscription as well'? The next phase where the downgrade happens?

#

Do you have some example object IDs I can look at? I suspect the coupon is removed by default if it's omitted from the update call

winter charm
winged vaultBOT
warm maple
#

They don't persist been downgrade/upgrades AFAIK

winter charm
#

I suspect the coupon is removed by default if it's omitted from the update call
=> Yes, that's right, and that's why you have to apply the coupon when you call the Update API.

warm maple
#

Ok, then I'm not sure what your question is?

winter charm
#

When I call the Create Subscription Schedule API to perform a download or upgrade, it seems to automatically create a phase.

I want to use the created phase to call the Update Subscription Schedule API.

To do this, I need to read the 0th or 1st index of the phase Array to see if the coupon will be applied to the next phase.

But sometimes the phase Array is only one, sometimes two.

warm maple
#

If your question is, 'how can I keep the existing coupon whilst scheduling a downgrade' the answer is I don't think you can – you need to re-apply the coupon on the new phase via the parameter shared

If that's not your question then can you articulate the problem clearly for me with some examples?

winter charm
#

If your question is, 'how can I keep the existing coupon whilst scheduling a downgrade' the answer is I don't think you can – you need to re-apply the coupon on the new phase via the parameter share

=> I want to let Stripe make its own decision about whether or not existing coupons should be kept while scheduling a downgrade.

warm maple
#

Then I'm afraid that is not possible today

winter charm
#

Let's say you create a coupon and make it available 2 times with repeating.

The first time the subscription was paid for via the Checkout Session API, the coupon was already redeemed the first time, so there is only 1 redemption left.

I want to make Stripe determine this on its own, since I can downgrade the subscription and still use it once more in the next subscription cycle.

So I was going to call the Create Subscription Schedule API and then manipulate the data by directly accessing the Array in a phase after that. I thought, why not just do this

warm maple
#

Yeah I know what you're describing, but it just doesn't work like that I'm afraid. Whenever you upgrade/downgrade a subscription to a new plan/price we will clear any existing discounts/coupons applied. You'll need to re-apply the coupon with the scheduled downgrade

winter charm
#

Yeah I know what you're describing, but it just doesn't work like that I'm afraid. Whenever you upgrade/downgrade a subscription to a new plan/price we will clear any existing discounts/coupons applied. You'll need to re-apply the coupon with the scheduled downgrade

=> Thank you so much for your clear answer. I apologize for the hassle, but can I ask one more question?

warm maple
#

Sure

winter charm
#

Here's an example.

You create a coupon with 3 redeemable offers and use it via the Create Checkout Session API to initiate a subscription. At this point, you've already redeemed 1 offer and have 2 left.

Later, I called the Create Subscription Schedule API to downgrade the subscription to a different product, and then called the Update Subscription Schedule API to add back the coupon I created above.

Last Question. When downgrading, will the number of coupon redemptions accumulate from the existing number? Or will the new count start over at 3?

warm maple
#

My understanding is that applying the coupon for the scheduled downgrade will count as a coupon 'redemption' and as such will decrement that usage count. So in your example it would now be at 1 remaining use after the downgrade

#

But should be easy enough for you to test and confirm!