21:17:00.570 [qtp452800031-50] WARN c.n.b.j.mappers.ExceptionMapperBase - Bad request com.ning.billing.invoice.api.InvoiceApiException: No invoice to generate for account c1628cfa-1d24-43f4-a109-a08581d13ed6 and date 2014-02-26 at com.ning.billing.invoice.api.user.DefaultInvoiceUserApi.triggerInvoiceGeneration(DefaultInvoiceUserApi.java:204) ~[killbill-invoice-0.8.12.jar:na]
I think I am fundamentally misunderstanding the Kill Bill approach and that's discouraging.
Some of our plans are fixed rate (e.g. $50/month). Some of them are usage based ($1/1000 widgets).
From what I can see, when a subscription is created, an invoice is created & the payment method is invoked. An entry is also created in the notification table which triggers the creation of the next invoice. That approach makes sense for fixed rate plans.
What strategy should we adopt for plans which have a usage component? How does Kill Bill incorporate usage? I suspect I will be referred to the meter plugin (https://github.com/killbill/killbill-meter-plugin).
I found /1.0/kb/invoices/{invoice-id}/payments?externalPayment=true
I found /1.0/kb/invoices/charges?requestedDate=2014-02-26, but that creates a new invoice every it is invoked.
I found /1.0/kb/invoices?accountId=c1628cfa-1d24-43f4-a109-a08581d13ed6&targetDate=2014-03-01&dryRun=yes but couldn't create an invoice
I get the following:
2015-03-19 11:38:59,231 [qtp7868747-19] INFO o.k.b.invoice.InvoiceDispatcher - Generated null invoice for accountId 72a775a2-de30-4d9b-ace0-9aa5227729bd and targetDate 2015-04-14 (targetDateTime 2015-04-14T16:38:58.434Z)
2015-03-19 11:38:59,256 [qtp7868747-19] INFO c.s.j.a.c.filter.LoggingFilter - 164 * Server out-bound response
164 < 404
164 < Content-Type: application/json
164 <
Not sure what is happening here.