#dopeboyz

1 messages · Page 1 of 1 (latest)

wicked nymphBOT
sharp kite
#

Hi there, cancel is a terminal state and you can't resume a subscription if it's already cancelled. You need to create a new one

cinder berry
#

But i am not deleting or cancelling it completely i am just updating the subscription and setting canceled_at_periodend to true

sharp kite
#

how could i resume the subscription with last schedule subscription after cancelled -> this is your original ask and you said after cancelled

#

Anyway, you can change the canceled_at_period_end flag to false if you don't want it get cancelled at the end of the period.

cinder berry
#

Yeah but i am resuming the subscription within period end

wicked nymphBOT
noble herald
#

👋 Taking over this thread, catching up now

#

Sorry, I don't quite understand your question. Has your subscription been cancelled? If the subscription is cancelled, it will not be possible to resume subscription. Or do you mean that you schedule the subscription to cancel in the future date, but you decide not to cancel it anymore?

cinder berry
#

Let me explain it

#

A user buy a subscription and its an monthly plan. If user decide to cancel the subscription so in our sever we are just changing the subscription cancelledAt_period_end to true.
Becoz a user can resume it's subscription within current period

noble herald
#

Yup! So what is the problem here?

cinder berry
#

My scheduled Subscription gets losed

noble herald
#

Can you share the subscription ID (sub_xxx), so that I can take a look?

cinder berry
#

All i want is when i resume the user subscription i want start last schedule subscription also

noble herald
#

My scheduled Subscription gets losed
What do you mean by getting lose? When the subscription schedule is created, you should store the Subscription Schedule ID to perform any update later. Could you share the subscription ID (sub_xxx) that the issue you described, so that I can take a look?

cinder berry
#

Sure

#

When user cancel it's subscription i am releasing the subscription

#

sub_1MjvYQA6RSS0ndD1rvMakb2K

noble herald
#

Let's step back a bit. What's your subscription schedule for? If you set cancel_at_period_end on the subscription object itself, why do you need a subscription schedule?

cinder berry
#

In our app we have a portal when a user can invite mulitple user to use their services and we are using schedule update to update the subscription amount from next billing cycle

noble herald
#

I see! Since subscription cancellation at period end and subscription schedule are two different processes, why do you release subscription when the customer's subscription is cancelled at the end of the period? You should just keep the subscription schedule without releasing it

cinder berry
#

When i update the subscription without releasing the schedule it's throws error that you can't cancel a subscription with active schedule subscription

noble herald
#

Ah yes! Cancelling subscription with cancel_at_period_end also shouldn't have any active subscription schedule

#

One way I can think of is:

  1. Before cancelling subscription with cancel_at_period_end and release subscription schedule, your database should keep track the phases that will be changed in the future
  2. Release the subscription schedule and cancel the subscription with cancel_at_period_end
  3. Only when the customer decides not to cancel the subscription (resume the subscription before cancellation), then you create new subscription schedule with the information saved in Step 1
cinder berry
#

And what info i should keep track of?

#

Upcoming phase?

noble herald
#

This one: "using schedule update to update the subscription amount from next billing cycle"

#

Yup

cinder berry
#

Alright thanks