#trueinviso
1 messages ยท Page 1 of 1 (latest)
Hi ๐
What do you mean by the "old subscription". Aren't you updating an existing susbcription?
I mean the old price that's connected to the subscription. So they are removing a lower tier price in favor of a higher tier price
I think this would require multiple update to achieve the proration behavior you are describing
Are both prices on the same billing cycle interval?
I'm trying to keep the new price on the same billing cycle interval as the old one, so I want the billing cycle interval to remain unchanged
I'd like to immediately charge a prorated amount of the upgraded price
Okay that will preserve the billing cycle
So you want the customer to pay for the 2 weeks of the higher tier price, but not get credited the unused time on the lower tier?
at them moment I'm trying this:
{
items: [...],
billing_cycle_anchor: "unchanged",
proration_behavior: "always_invoice",
}
And what is the result you get?
you can see that it gives a $50 credit for the first price they paid for
the price of the new on is $135, and today was the sign up day
Which is expected
right, I"m trying to not credit the $50, only prorate the remaining time in the billing cycle
which may not be possible
if I pass proration_behavior "none" then it won't credit the $50, but will it prorate the remaining time?
If you pass "none" neither proration will be generated
what if I cancel the current subscription, and create a new one with the same billing cycle?
will it charge a prorated amount for the remainder of time?
or is there a better way to achieve the same thing?
๐ Hopping in here
๐
Just to make sure I have this right - when you do an update you want to ONLY charge the prorated amount for the remaining time on the new price? You don't want to credit back the unused time on the old price?
correct, I have to manually credit unused time on the old price because it's a plan that gives site credit.
So there's a couple of options here, but to transparent all of them would be workarounds - there's not "simple" way to accomplish the behavior you want
- You could use the Upcoming Invoice API to calculate what the proration debit should be, use
proration_behavior: noneto make the update on the Subscription, and then create the Invoice charging for the proration yourself. (And a variation of this would be to calculate the proration yourself w/o our upcoming invoice API)
- Something else you could try (I haven't tested this end to end, so if you want to try this definitely test it fully in testmode) if use
proration_behavior: create_prorationswhen you update the Subscription. This will immediately generate two InvoiceItems that reflect the credit and debit prorations but it won't invoice them immediately. At that point, you can delete the credit proration, and then generate + charge for an Invoice that only has the debit proration on it
how exactly would the upcoming invoice api do the calculation? wouldn't it use the same calculation method as the subscription update for prorations?
Yes it'd use the same calculation method, but the Upcoming Invoice api will break it down into separate line items (one for the credit, and one for the debit). You'd use the Upcoming Invoice API and just look for the specific debit proration item