#draesia.
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.
- draesia., 10 minutes ago, 2 messages
Hi thanks, sorry it wouldn't let me reply in the previous thread
What exactly are you trying to do? If you have a subscription, you should be modifying the quantity on that directly
So we used to wait for invoice.upcoming and then modify the subscription; however there is an issue due to the time difference between that event and the payment happening.
Because we do not know the exact quantity until the invoice creation, We wanted to update the quantity on invoice.created, right before we finalize it.
I was hoping I could do that with InvoiceItem update, but as you rightly pointed out- I was mistakenly putting an invoice list item instead.. however there is no InvoiceItem for this Invoice, only Subscription.
So that then makes me wonder if updating the Subscription to the correct quantity would work, but it didn't seem to on my first test.
We kinda have a P1 where 670 payments are wrong by like £10
Can we take a step back and understand why you need to adjust quantity in the first place? Is this some kind of usage based billing?
Yes, but the usage is in the future..
So the payment last night covers a period from 1st Nov - 1st Dec
The usage in that period often changes the night before as the Schools are scheduling lessons last minute.
We plan to change from a Subscription based system to just use Mandates and create intents from our side; however that work isn't ready to be released yet so we're looking for a band-aid fix.
Ideally the usage would be updated whenever an update to it happens; however our own implementation of this doesn't work very well for some reason (its all a mess which is why its being rewritten)
So it seemed like the easiest way to fix it for the time being is to just update the draft invoice when it's created, right before we finalize it.
However I'm having issues with that also
well if you're specifically talking about a Price with recurring.usage_type=metered , that doesn't really work since at the time that invoice.created has happened, the new billing cycle has started, so any changes you make or usage you report is now for the new period, not the one the invoice was charging for.