Allocate landed costs (freight, duty) to purchase receipt lines in Dynamics 365 Business Central using the itemCharges entity and purchaseOrderLineCharges API
Create an item charge record in Business Central (Item Charges page, type 'Purchase') or verify the existing item charge code to use as the charge type for freight allocation.
In a purchase order, add a charge line: POST to the purchaseOrderLines OData endpoint (or through the standard purchase order API) with a line of type 'Charge (Item)' referencing the item charge No.
Assign the charge to receipt lines using the Item Charge Assignment sub-page (purchaseOrderLineCharges if exposed via custom API or via UI); specify the qty to assign and the receive-line amounts.
For API-driven allocation, use an AL codeunit exposed as an OData unbound action that calls Codeunit 5805 (Item Charge Assgnt. (Purch.)) function SuggestAssignment to distribute costs proportionally by amount or quantity.
Post the purchase invoice that includes the charge line; Business Central then adjusts the inventory value (standard or average cost) for the associated receipt lines.
Verify the value entry adjustments: query the Value Entries (valueEntries endpoint or SuiteQL equivalent) filtered by Item Ledger Entry Type = Purchase and Adjustment = true.
Known gotchas
Business Central's standard API v2.0 does not expose item charge assignment sub-lines as a directly writable OData entity — allocation logic typically requires a custom AL API or an automation extension that wraps the standard codeunit, making a purely REST-based implementation non-trivial.
Landed cost charges must be assigned to receipt lines (not order lines) for the cost adjustment to flow into inventory valuation; assigning to order lines that have not yet been received results in the charge posting to a purchase accrual account rather than inventory.
If the purchase order uses invoice discounts, the item charge distribution by amount may produce rounding differences; Business Central rounds to the LCY decimal places setting, and the last assigned line absorbs any rounding remainder.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp