invoice plugin

58 views
Skip to first unread message

Pouyan Shalbafan

unread,
Jun 7, 2021, 9:12:37 AM6/7/21
to Kill Bill users mailing-list
hello
i have two questions from killbill contributors
1- is it possible to completely rewrite invoice object in invoice plugin and return one ? Or adjusting, is the only solution. (in one scenario i need to rebuild the generated invoice completely, is there any alternate )
2 - is there any solution about how to access usage data in invoice plugin, is there any documentation ? ( or we just have to follow up github codes ? )

Thank you in advance for helping me out. 

Pierre-Alexandre Meyer

unread,
Jun 7, 2021, 9:59:41 AM6/7/21
to Pouyan Shalbafan, Kill Bill users mailing-list
Hello,

You can only adjust the invoice. See https://docs.killbill.io/latest/invoice_plugin.html.

Regarding accessing usage data in your plugin, you can use the UsageUserApi for this: https://github.com/killbill/killbill-api/blob/master/src/main/java/org/killbill/billing/usage/api/UsageUserApi.java

Hope this helps,


--
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/84fece9d-2671-4c78-9491-d275560d76f8n%40googlegroups.com.


--
Pierre

Pouyan Shalbafan

unread,
Jun 7, 2021, 11:53:11 AM6/7/21
to Pierre-Alexandre Meyer, Kill Bill users mailing-list
Thanks, this helped, but there is still something im a little confuse about, it’s that part of doc which says :
 “For new invoices or if an invoice is still in DRAFT mode, invoice plugins are allowed to update existing items, instead of adding new ones, by respecting the invoice item id returned by Kill Bill. This can be useful for instance to update tax amounts

My perception is that i can rebuild the invoice by updating its existing items and adding some extra invoice item. Am i right ? 

Thanks.

Pierre-Alexandre Meyer

unread,
Jun 9, 2021, 9:35:47 AM6/9/21
to Pouyan Shalbafan, Kill Bill users mailing-list
Hello,

I'm not sure what you mean by "rebuild', but you can add new items, as well as update (some of) the existing items via the plugin.

Kind regards,
--
Pierre
Reply all
Reply to author
Forward
0 new messages