BC - Webhook for an invoice paid in full (closed)

Hi, I’m looking to implement a webhook in Business Central (SaaS) to trigger a notification whenever a vendor invoice is fully paid (closed). However I’ve listed the supported webhooks using the /webhookSupportedResources endpoint, and I can’t see any that are suitable. I tried using the “v2.0/vendorPayments” resource, but that just triggers create/update/delete events when a line in a payment journal is changed. Can anyone recommend a suitable webhook, or is it possible to write a custom one for this purpose?

Many thanks,
Jonathan

1 Like

Hello Jonathan, you’ve hit a common architectural wall with standard Business Central (BC) webhooks!

You are correct: the vendorPayments webhook only tracks changes to the payment journal lines. Since the “fully paid/closed” status is a business logic state change (resulting from posting the application of the payment), there is no direct out-of-the-box standard endpoint for it.

The Solution: Custom AL Event

The reliable way to solve this is by building a custom AL extension:

  1. Event Subscriber: Create an AL Codeunit that uses an Event Subscriber to listen for the precise moment the payment application is posted and the Vendor Ledger Entry is finalized as closed (Remaining Amount = 0).

  2. Custom API/Push: Inside the subscriber, you can either update a Custom AL API Page (which an external system can poll) or directly push a notification to your external service using AL HTTP client calls.

Since this requires diving into BC’s AL events, if you are hitting architectural roadblocks or need help building and testing the custom AL extension, we would be happy to offer a free audit session. We can analyze the exact event required, help you implement the solution, and define the scope of your integration.

Feel free to email me directly at hardik.gupta@allgrowtech.com.