Issue: Lack of Granular “Amount to Apply” Control in Vendor Payments via Business Central APIs
Summary
When using Microsoft Dynamics 365 Business Central APIs to apply vendor payments or credit memos to invoices, there is no way to control partial application amounts per invoice or per credit memo.
This makes it impossible to implement common real-world payment allocation scenarios through the API, even though the UI fully supports them.
Problem Statement
Scenario 1: Paying Multiple Invoices with a Single Payment
Example
Payment amount: ₹1000
Invoice 1 remaining balance: ₹700
Invoice 2 remaining balance: ₹500
Expected behavior (UI supports this):
Apply ₹300 to Invoice 1
Apply ₹700 to Invoice 2
Actual API behavior:
The API automatically exhausts Invoice 1 fully (₹700)
Remaining ₹300 is applied to Invoice 2
No control over how much is applied to each invoice
➡️ There is no way to specify partial amounts per invoice via API.
Scenario 2: Partial Utilization of a Credit Memo
Example:
Credit Memo 1 balance: ₹1000
Want to apply only ₹100
Expected behavior:
Apply ₹100 from the credit memo
Keep ₹900 unused
Actual API behavior:
Credit memo is applied automatically
Partial usage cannot be specified
The system decides how much to apply
Scenario 3: Multiple Credit Memos with Selective Amounts
Example:
Credit Memo 1 balance: ₹1000 → want to use ₹100
Credit Memo 2 balance: ₹2000 → want to use ₹200
Total to apply: ₹300
Expected behavior:
₹100 from Credit Memo 1
₹200 from Credit Memo 2
Actual API behavior:
Entire ₹300 is consumed from Credit Memo 1
Credit Memo 2 is not touched
No ability to target specific credit memos
Root Cause (Technical Explanation)
The Apply Vendor Entries API:
APIV2 – Apply Vendor Entries (Page 30073)
Only exposes a boolean:
{ "applied": true )
Does NOT expose “Amount to Apply”
Uses Vendor Ledger Entry Buffer (temporary)Internally calls
Key Limitation: “Amount to Apply” is not a table field and is not exposed in the API
Even the discount applied for each invoices can't be specified.