#highgate-subscriptions

1 messages ยท Page 1 of 1 (latest)

blissful grotto
#

@prime pasture then I would look into SubscriptionSchedules for that kind of use case where you need the change to only happen at the end of the billing cycle

#

you can add or remove seats. If you add a seat you should be charged prorated for the rest of the month and the next full month
so you should pay the next month amount now at the time of changing the number of seats?

#

(trying to understand)

prime pasture
#

Let me try to explain as a user:

billing_cycle_anchor is 1st of each month.

I sign up at Service the 3rd of November. I will then be charged immediately the prorated amount. (3rd nov to 1st of dec).

The 6th of Nov I want to add 3 more seats, so stripe will then credit my existing seat (6th nov to 1st of dec) and add 4 seats prorated (6th nov to 1st of dec).

So far so good.

The 20th of Nov I want to remove one seat. I still have to pay for 4 seats until the 1st of dec. But the 1st of dec I will pay for only 3 seats (1st dec to 31 dec).

blissful grotto
#

so by default on 1st of December you would pay an invoice total that includes a few line items : upfront for 1->31 Dec for the current number of seats (3) , plus/minus accumulated proration line items generated throughout November for the changes made.

prime pasture
#

yes

blissful grotto
#

that is what happens by default is using a normal per-seat Subscription at least, so it doesn't require anything too special. Is this what you intend, or something else?

prime pasture
#

So far we've updated the subscription quantity, which works nicely when adding. But when you decrease it decrease it immediately.

#

If you add a seat the 10th of Nov and remove if the 20th of Nov, we still want to charge you until the next period starts (20 days), not only for those 10 days.

blissful grotto
#

hmm, increasing and decreasing should both do it immediately(they change the quantity immediately, exactly the same), so I'm not 100% following you there.

#

oh ok you want it to not work that way

prime pasture
#

Yes! ๐Ÿ˜„

#

I want it to increase immediately, not decrease until end of billing cycle.

blissful grotto
#

then yeah, as I said at the start, the only option is to not do the downgrade and now and instead schedule it to happen at the end of the cycle.

prime pasture
#

And then we just use the SubscriptionCycle

blissful grotto
#

it's unfortunately pretty complex

prime pasture
#

SubscriptionSchedule.

#

But can you create multiple SubscriptionSchedules in a period?

#

So every time a seat is removed we just create a SubscriptionSchedule that decreases by 1 at the end of the defined period.

blissful grotto
#

no, you'd have one Schedule that manages the Subscription, and can modify it at any time

#

yeah it's not really like that (like an object per-scheduled-change)

#

it's more like the Schedule 'dictates' the state of the subscription at various points of its lifecycle, through the concept of 'phases' that the underlying subscription moves between

#

so you mutate the Schedule object's phases to declare e.g. "Nov 1-31, use Price X w/ quantity 4", then "Dec 1-31, use Price X w/ quantity 3"

prime pasture
#

Ok @blissful grotto , thank you very much! Very informative answers ๐Ÿ™‚

prime pasture
#

So if I understand correctly. I start a subscription with 1 in quantity (3rd Nov). The 6th of Nov I add 4 more seats (quantity). The 20th of Nov I decide to remove 2 seats.

I then create a SubscriptionSchedule and attach to the current subscription. I say that in the first phase (3rd Nov - 30 Nov) quantity will be 5, and the next phase (1st Dec - 30 Dec) quantity will be 3. I also set the Schedule to have a release end_behaviour so when the schedule ends, it will continue with 3 seats.

#

If then the users changes his mind again, we just mutate the schedule to reflect the quantity changes?

#

At some point it will expire and release the subscription. If there will be new changes after that, we just create a new schedule, right?

blissful grotto
#

yep, at a high level that all seems good to me!