Usage tracking

73 views
Skip to first unread message

Ali md Moussawi

unread,
Mar 22, 2023, 9:17:41 AM3/22/23
to Kill Bill users mailing-list
hi there,

I want to get the usage of a user on daily, weekly, and monthly base . How to do it using kill Bill APIs 

thanks in advance,
Ali Moussawi.

Pierre-Alexandre Meyer

unread,
Mar 23, 2023, 7:57:53 AM3/23/23
to Ali md Moussawi, Kill Bill users mailing-list
Hi Ali,


Kind regards,


--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/113362d1-7032-4c1c-981b-276f309d4405n%40googlegroups.com.


--
Pierre

Ali md Moussawi

unread,
Mar 23, 2023, 8:37:39 AM3/23/23
to Kill Bill users mailing-list
I read the documentation and I didn't find my needs because of that I asked here.

Pierre-Alexandre Meyer

unread,
Mar 23, 2023, 10:58:12 AM3/23/23
to Ali md Moussawi, Kill Bill users mailing-list
Hi Ali,

As you can see, the API accepts startDate and endDate parameters. By tweaking these values, you can get usage on a daily, weekly, and monthly basis.

I hope this helps!

Ali md Moussawi

unread,
Mar 24, 2023, 5:01:41 PM3/24/23
to Kill Bill users mailing-list
but this is not efficient Imagine I want to get the daily usage I have to call the usage API of 30 times.

Pierre-Alexandre Meyer

unread,
Mar 25, 2023, 4:25:36 AM3/25/23
to Ali md Moussawi, Kill Bill users mailing-list
Hi Ali,

Keep in mind that Kill Bill isn't supposed to be used as a metering system. As a matter of fact, we encourage to record already rolled-up usage data points in Kill Bill, and keep the highly granular data in a dedicated metering system.

Kind regards,

sh...@methodmaker.co.nz

unread,
Mar 25, 2023, 10:52:12 PM3/25/23
to Kill Bill users mailing-list
Hi Guys,

There is an outstanding usage API enhancement request to get the API to return daily totals for a given date range. See https://github.com/killbill/killbill/issues/1756 for more information.

Message has been deleted

stephane brossier

unread,
Mar 28, 2023, 12:19:49 PM3/28/23
to sh...@methodmaker.co.nz, Kill Bill users mailing-list
We have already released our version 0.24.0 - any increment 0.24.x needs to keep the java api compatible, so we can't simply add this new apis. The easiest option would be to implement an endpoint in a plugin, and do the query against the Kill Bill core usage table. We typically don't encourage doing this, but if you are stuck and this is important for your use case, this is the best option. 

Shaun Forgie

unread,
Mar 28, 2023, 4:43:47 PM3/28/23
to stephane brossier, Kill Bill users mailing-list
HI Stephane,

Ok we will look to create a usage plugin that deals with returning daily usage records.

One of the other issues we have is that we would like to deal with entering retrospective daily usage records for previous billing periods. An example to clarify - 2 usage units were recorded for a given day last month. The billing cycle for that subscription has run and those 2 days have been charged for on an invoice item. 3 usage units were missed or not received until the next billing period had started. We would like to record the additional 3 usage units against the same day for the previous month. Obviously the usage will be charged for in the current billing cycle. But...how does the API deal with this? Ideally it would show billed and unbilled usage for a given day yes?

Rgs
Shaun
--
Shaun Forgie [Principal] - Method Maker Ltd
57a McIntyre Rd, Manukau 2022, Auckland, New Zealand
Mobile +64 21 666 910
Reply all
Reply to author
Forward
0 new messages