#akssharj-subscriptions
1 messages · Page 1 of 1 (latest)
here is the overview of the plan user is for exmaple before upgarde
@golden pewter hi! That API request just changes the items on the subscription to the new plan right now and creates proration invoice items as if the change happened at that timestamp.
It doesn't do anything to the billing cycle.
Hi @wary plume many thanks for your reply
is there a way the user could be charged at that moment and also the billing cycle to be advanced since the user paid for it
for example, here is what i see when i access the upcoming invoice
the fourth row is where the user also pays for the next billing cycle during the upgrade
that one that says 1 X ultimate
you can use proration_behavior:"always_invoice" to force a payment of the upgrade cost.
Otherwise the default is that the proration just happens in the next invoice for the subscription(as you see in that screenshot)
i tried that, but if i use always_invoice
the user is not billed for the next cycle, i see this in the proration preview
the fourth row is missing in this case
ah sorry to get you confused here
the reason why the above would be a issue is, the user for the upgrade to a higher plan pays very little and gets 5 days access to the higher plan where he can download all the necessary data
You started the subscription on X, 2021 date. It's a yearly plan so the next invoice will be created on X, 2022.
It is Y date today and you are changing the subscription plan. There's some prorated amount ($82).
What do you want to happen in terms of when the next invoice will be, is it still X,2022 or do you want it to be something else? Also when do you want the $82 prorated upgrade cost to be paid?
sorry for not adding more details earlier. below is what i am trying to achieve
- When user is upgrading to an higher plan < 3 months before renewal, i want the the user to pay upfront for the next billing cycle too, something that i showed in the first screenshot i shared, where the user pays
$9,430.02
- If the user tries to upgarde before 3 months to a higher plan, the user pays upfront the prorated amount for the current billing cycle and not for the next
sorry, would that make sense to you?
in case 1, since the user pays upfront for the next billing cycle too, i would expect the billing cycle date updated too (not sure if this expectation is correct)
let's take it 1 by 1.
i want the the user to pay upfront for the next billing cycle too,
do you want the time they upgrade to become the billing date as well? So if the next billing date is March 25th, and they upgrade on Feb 19th(within your 3 month window) : so they pay the next cycle now, what do they pay on March 25th now, and on March 25th the following year? or does the date change so their next invoice will be Feb 19th next year for instance?
sorry i am bit confused, i would want the user to pay upfront in the above scenario (< 3months before renewal), but would that mean the next billing date also changes? I would want to keep it the same (March 25th) and not Feb 19th
so the user pays the prorated amount, access to the higher plan for the date diffference + next year
on the same day user decided to upgrade
so for exmaple, the user pays
Unused time on professional after 16 Sep 2022 -$45.77 September 16, 2022, Friday September 21, 2022, Wednesday
Remaining time on Ultimate after 16 Sep 2022 $127.79 September 16, 2022, Friday September 21, 2022, Wednesday
but would that mean the next billing date also changes?
that's what I'm asking you
what behaviour do you want to happen
not to change the billing date
I would want to keep it the same (March 25th)
so let's say the plan is $1000 a year. You want them to pay $1000 on Feb 19th(plus some prorated amount), and then $1000 next month on March 25?
no sorry, let me construct a example, give me a moment
I gave an example above, can we work from that?
sorry, throwing more examples at me doesn't really help
ok 👍
i want them to pay proarted amount + 1000 for the next year
since they have payed upfront for the next year already, i dont bill on march 25, but bill them on march 25 the next to next year
sorry if that make sense
ok let's stop there
so on March 25 you want an invoice for $0 (or maybe no invoice at all)?
no invoice since they have paid
ok well there has to be an invoice unfortunately since that's how the Stripe Subscription works.
There's no good way inbuilt to get this flow you want, unless you change the billing cycle at the same time(like change it to Feb 19th when doing the upgrade). The way I'd do it I think is :
- add an invoice item for the price of the plan($1000) https://stripe.com/docs/billing/invoices/subscription#adding-draft-invoice-items
- do the upgrade to the new plan with
proration_behavior:"always_invoice", which generates an invoice for the proration + the $1000 amount - when that payment completes, you need to do something to avoid March 25th charging again. The easiest option would be to add a one-time use 100% off coupon to the subscription.
many thanks for the detailed explanation. If i change the billing cycle too, would it mean the user pays upfront on 19th Feb and is billed again the next year 19th
yes
- If the user tries to upgarde before 3 months to a higher plan, the user pays upfront the prorated amount for the current billing cycle and not for the next
so again. The next billing date is March 25th, and they upgrade on Nov 19th(outside your 3 month window) : what do they pay on Nov 19th? What do they pay on March 25th?
the user just pays the prorated amount upfront and is charged full amount for the whole year during the next billing cycle
then it's simply doing the upgrade like in the code you started with and passing proration_behavior:"always_invoice" !
ok @wary plume you are amazing, many thanks. this is helpful
just one more question @wary plume
i have now updated the code like this
@invoice = Stripe::Invoice.upcoming(
customer: current_user.stripe_id,
subscription: @subscription.stripe_id,
subscription_items: [
{id: stripe_subscription.items.data[0].id, deleted: true},
{price: @plan.stripe_id, deleted: false}
],
subscription_proration_date: (Time.zone.now + 360.days).to_i,
subscription_proration_behavior: 'always_invoice',
subscription_billing_cycle_anchor: 'now'
)```
i am seeing the above preview
proration date is in the future September 16, 2022, Friday
since i am setting the billing_anchorto now
i was expecting 1 × Ultimate (at €9,348.00 / year) to start from September 16, 2022, Friday
would that be a wrong expectation?
no, that's accurate. If you reset the billing cycle an invoice is immediately generated
that invoice will pull in any existing proration items , and also charge upfront for the next billing cycle
so if you change the cycle to now, then an invoice is generated that charges for the next billing cycle(which starts now, 21 Sep 2021), which is that line item; and then also includes the prorated line items.
you're previewing that invoice.
shouldnt the next billing cycle have the period start = September 16, 2022, Friday and period end = September 16, 2023, Friday
since my proration date is September 16, 2022, Friday
the proration date is not related to the billing cycle, so no
you're charging the customer 9.348.00 upfront (all subscriptions bill in advance) right now, so that's the billing cycle
and we could preview what would happen in that case
hmm no the billing cycle is not that. "the date when user effectively does the upgrade" is the proration date you passed
yes, ok. i thought setting billing_anchor to now would consider now as the date when the user does the upgrade (in future set to proration date)
so just to confirm, if the user upgrades on 16th Sept 2022 and i set the billing_anchor to now, the customer will be next billed 16th Sept 2023?
no, they will be billed right now when you make the API request.
"If you reset the billing cycle an invoice is immediately generated" as I mentioned
sorry, let me please provide some screenshots, still confused.
- I created a subscription and customer paid immediately, today and next invoice is due Sep 21, 2022
so far i am clear
now the customer decides to upgrade on September 16, 2022 and sees this preview
in a future date on 16th Sept 2022, i would assume that , the preview would have this
1 × Ultimate (at €9,348.00 / year) $9,348.00 September 16, 2022, Tuesday September 16, 2023, Wednesday ```
is this assumption correct?
where the date start and end date would be based on the date the user does this upgrade, which in this example would be 16th Sept 2022
yes, as far as I can tell
ok many thanks
it's based on the billing cycle, so if you do the upgrade and set billing_cycle_anchor:now, then the start of the period is the time you make the API request and the end of the period is 'then + (the billing interval of the plan being used e.g. a year)'
awesome, i think this is what i wanted to confirm. thanks again for the great help
the thing that got me consfused was i was assuming proraration_date would be used when using billing anchor now
but this clears it 🙂
thank you so much
no worries!