When is a new invoice created for recurring plans?

Alex's Avatar

Alex

03 Jun, 2012 01:41 AM

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

  1. Support Staff 1 Posted by Marc Guyer on 04 Jun, 2012 12:57 PM

    Marc Guyer's Avatar

    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". If customers/get, for instance is requested after billingDatetime has passed for the latest invoice, the new pending invoice is created prior to returning the response.

    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
    

    That's exactly correct.

  2. 2 Posted by Alex on 04 Jun, 2012 01:06 PM

    Alex's Avatar

    Excellent, thank you, that puts me at ease.

  3. Marc Guyer closed this discussion on 04 Jun, 2012 01:30 PM.

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

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM