"Metered Usage" with upfront payment (credits/points)
Hi,
how would I implement a credit based system like postmark does?
What I want basically is something like this:
- Users can purchase (packets of) credits
- Using feature X costs one credit per usage
- Once all credits are used up - access to feature X is denied
- Users can stock up credits any time - credits don't expire
- Users can set up auto-renewal of credits, e.g. when credits are < 10% of last credits purchase, a credit-package is automatically purchased
is that possible?
Thanks!
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 27 Feb, 2013 12:53 PM
Hi Dominik - You can do that with tracked items. The standard way to do it is to track the amount of usage over the billing period and then charge for the amount used at the end of the period. You can do it in reverse, too. The technique isn't documented so I'll describe it here:
So, that's the pricing plan config for prepaid credits. The other piece is the act of prepayment and recording the amount currently allocated. Use a one-time invoice to charge for a block of credits. The charge uses the customer's payment method on file so it can be a "one click" buying experience. You could even make it automatic. Upon a successful charge for more credits, use the CG API to add the amount purchased to the customer's current quantity of the item.
The key API calls are:
invoices/new
- https://cheddargetter.com/developers#one-time-invoice - Transact a one-time invoice for any amount of credits for any price. You could use the pricing plan item over amount config to determine the cost of each credit.customers/add-item-quantity
- https://cheddargetter.com/developers#add-item-quantity - Upon a successful prepayment, update the customer's quantity.customers/new
- https://cheddargetter.com/developers#add-customer - You can also charge for and record initial quantity on new customer creation.Let us know if you have questions.
Jess Pendley closed this discussion on 21 Nov, 2013 07:35 PM.