#trueinviso-prorations
1 messages · Page 1 of 1 (latest)
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.
- trueinviso-invoice-retry-and-draft-finalization, 19 hours ago, 36 messages
Hello there
Are you changing the interval here? Like from monthly to annual? Or is the interval staying the same?
It is going to be pretty hard to just prorate some items here... you are likely to need a lot of custom code to do that.
Can you tell me more about your use-case?
interval stays the same, but we have "add ons" for subscriptions, and one add on in particular can't be prorated, the other ones are prorated. So when a user upgrades the subscription the "unlimited" add on needs to be full price, and the rest prorated while maintaining the same billing cycle anchor
Hmm okay yeah this will be complicated but it is possible.
What you want to do is basically add an Invoice Item for the non-prorated add-on before you actual make the update, then you update without the non-prorated add-on Price yet added (in order to force proration on the other ones) but that one will be charged via the Invoice Item, then you update the Subscription again to add the non-prorated add-on Price but you set proration_behavior: none on that update request so that there is no proration and nothing happens, but the Subscription will charge for that new add-on at the next cycle.
ok, I think that makes sense:
Use this to update the subscription, which will charge the amount I want, then call update again with prorate none
thanks I'll test it out soon
The price specified is set to type=recurring but this field only accepts prices with type=one_time.
I get this error
I guess I have to just do a manual invoice?
You don't want to set proration_behavior: always_invoice -- that will reset the billing cycle anchor. And yes, in this case you are just adding a one-time item so that it charges the full amount, then you will actually add the recurring Price in a third update
Err sorry you can just do it in two updates here actually
The price specified is set to type=recurring but this field only accepts prices with type=one_time.
But this error seems to indicate I can't use a "recurring" price. So, I guess I need to just do something like this?
customer: gateway_customer.id,
subscription: gateway_subscription.id,
collection_method: "charge_automatically",
})
Stripe::InvoiceItem.create({
customer: gateway_customer.id,
currency: "USD",
amount: prorated_pro_plan_amount,
description: "Full price for unlimited plan",
subscription: gateway_subscription.id,
})```
No you don't need to create an Invoice at all
Actually let's pause
Maybe I misunderstood
Do you want to charge immediately here?
When you said "I don't want to change the billing cycle anchor" that meant to me that you wanted to wait to charge until the following natural billing cycle
So if I set proration to "none" then it doesn't charge immediately unless I change the billing cycle anchor to "now"
unless I am mistaken?
Correct
so I want to charge immediately for the "unlimited" price but without any proration and without changing the billing cycle end date
Ah okay thanks for clarifying
In that case then you have it correct above that you want to create a one-off Invoice yourself here
And just charge the added Invoice Item
ok, thanks
What about subscription schedules, the upgrade scenario works fine. But sometimes they remove an add on and add another. Add ons that are removed, are removed at the end of the billing cycle. So I'm using a subscription schedule for this, one phase adds the new plans and keeps the ones that were removed. At the end of the billing cycle it moves to a phase the removes the add ons they don't want. But it's the same issue where I can't have different proration behaviors for items.
Hmm yeah that is definitely more complicated.
I already have a class that can calculate prorations how I need them, so I should probably just set proration "none" and charge it manually?
Yeah I think you will basically have to use manual calculations
And then have it set up going forward for future months after you do that manual calculation and charge
Don't really see another way to handle this
ok thanks