Recommendations for handling tracked item counts
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?
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 16 Mar, 2011 01:03 PM
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 Posted by alex on 16 Mar, 2011 01:08 PM
We're dealing with thousands to millions per customer, per month.
Support Staff 3 Posted by Marc Guyer on 16 Mar, 2011 03:14 PM
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.
Dean closed this discussion on 16 Jan, 2013 04:21 PM.