Hello everyone,
We are integrating Kill Bill with our subscription backend, and I would appreciate some guidance from the community regarding one part of the renewal flow.
Our system has the following sequence for subscription creation and renewal:
We create an account in Kill Bill (child account) and link it to a parent billing account when applicable.
A subscription is created using the requested plan.
Kill Bill generates an invoice on the billing account based on catalog rules.
Before renewal, our backend checks the active subscription status.
A future invoice is generated for the correct billing account.
We use the invoice balance to initiate the external payment (PayU).
When PayU sends a callback to our backend, we:
Validate the callback signature
Load the subscription and the corresponding billing account
Fetch invoices associated with that account
Identify the pending invoice for renewal
Build a PaymentTransaction for external payment
Post the external payment to Kill Bill using:
POST /1.0/kb/invoices/{invoiceId}/payments?externalPayment=true
Our expectation is that Kill Bill will record this payment and update the invoice balance accordingly.
Even though:
The subscription is created successfully
The renewal invoice is generated
The external payment gateway reports a successful transaction
The callback handler runs without throwing any exceptions
The invoice balance in Kill Bill does not change, and there is no payment reflected under the account or invoice.
Additionally, in the Kill Bill container logs, we do not see any entries indicating that an external payment was applied, nor do we see errors coming from the payment API.
So the issue appears to be that the external payment call is not being processed or is not reaching the correct invoice/account within Kill Bill, despite being invoked from our backend.
Is there any known behavior where external payments may be silently ignored or not applied unless certain account or invoice conditions are met?
Are there specific flags or account attributes (e.g., delegated payment settings, invoice states) that could prevent the external payment from being accepted?
Is there a recommended way to trace external payment posting inside Kill Bill (specific logs or plugins) to verify whether the request is being received?
What is the best practice to reliably map renewal invoices to the correct account, especially in a setup with parent/child billing relationships?
We are running Kill Bill 0.24.10 in Docker using the standard Kill Bill image.
The backend interacts with Kill Bill via the Java client.
Invoice creation and subscription creation work as expected; the issue is isolated to invoice payment posting.
Any suggestions, debugging pointers, or similar experiences would be very helpful.
Thank you in advance for your guidance.
Regards,
Harish kukkala