When is a new invoice created for recurring plans?
Hi,
In our system we have to count out a customer's tracked items before calling set item quantity on CG.
I am a little unclear when it comes to the transition between billing periods.
The createdDatetime
of the current invoice appears
to correspond to the transactedDatetime
of the
previous invoice's transaction, rather than the
billingDatetime
of the previous invoice.
This leads me to question what the trigger is for the creation
of a new invoice? Is it a successfully transacted current invoice?
billingDatetime
lapsing on the current invoice? What
about when payments fail?
We will be updating CG with item quantities regardless of the status of any of the invoices (as long as the customer is not cancelled).
I need a completely unambiguous way of determining, knowing the current date and using the customer XML, for what span of time to be counting tracked item quantities for when calling set item quantity.
I have my guesses, but I have no way of knowing how correct they are without understanding how billing periods really work.
Any help is super appreciated,
Thanks.
Edit: According to your final comment in this discussion
(http://support.cheddargetter.com/discussions/problems/32-when-are-o...),
I should only care about billingDatetime
when
calculating the timespan. Is this correct?
So, the time span, with 100% precision, and a guarantee that item quantities would not get allocated to the wrong billing period, would be:
invoice[2]/billingDatetime
through to
invoice[1]/billingDatetime
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Marc Guyer on 04 Jun, 2012 12:57 PM
Hi Alex -- A pending invoice is created just in time. In other words, it can be as soon as exactly at the moment of
billingDatetime
or sometime after but only when it is "needed". Ifcustomers/get
, for instance is requested afterbillingDatetime
has passed for the latest invoice, the new pending invoice is created prior to returning the response.That's exactly correct.
2 Posted by Alex on 04 Jun, 2012 01:06 PM
Excellent, thank you, that puts me at ease.
Marc Guyer closed this discussion on 04 Jun, 2012 01:30 PM.