Recommendations for handling tracked item counts

alex's Avatar

alex

15 Mar, 2011 11:24 PM

We're struggling a bit with how to correctly handle tracked item counts. Here are our assumptions:

1) We don't implicitly know next the billingDateTime for a customer.
2) We need to update the customer's tracked items to exactly match the actual items in our app. Items created in our app prior to the billingDateTime should be included on the current invoice, while items created after the billingDateTime should be included on the next invoice.

When it comes to billing, it appears as though timing is critical. Should we attempt to set the tracked item counts immediately prior to the billingDateTime? In order to make that work, we'll need to look at the CG record for each customer, extract and store the billingDateTime, then schedule a job to run just prior to the billingDateTime. If for whatever reason we fail to update the tracked items at exactly the correct time, the invoice will be incorrect and we will need to manually correct the error.

It seems as though a better approach would be for CG to call our app, just prior to billing, to ask for tracked item counts for the billing period (it could provide the start and end dates to the billing cycle). If our app responds with an unintelligible response, then it tries a few more times before giving up and emailing us to let us know there is a problem.

Are we overthinking this? What are your recommendations for handling tracked items?

  1. Support Staff 1 Posted by Marc Guyer on 16 Mar, 2011 01:03 PM

    Marc Guyer's Avatar

    Hi Alex -- How often does an item get used? In other words, approximately how often does the number of items change for a customer?

  2. 2 Posted by alex on 16 Mar, 2011 01:08 PM

    alex's Avatar

    We're dealing with thousands to millions per customer, per month.

  3. Support Staff 3 Posted by Marc Guyer on 16 Mar, 2011 03:14 PM

    Marc Guyer's Avatar

    I see. Then some fancy engineering is necessary...

    Off the top of my head... maybe set item quantity periodically throughout the billing period -- possibly based on a probability or "on demand" when a customer checks their stats.

    Certainly the main thing is to make sure CG has the accurate amount of an item as of the billingDatetime. A scheduled job is probably the answer. You might need to logically shift the billing period back by a few hours or so to make sure there's enough time to update CG. If quantity is set even 1 second after the billingDatetime, it will be on the next billing period.

  4. Dean closed this discussion on 16 Jan, 2013 04:21 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