> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dolfinai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Three-way matching & supplier credits

> Purchase orders, delivery notes, and match groups bring three-way matching to bills, alongside supplier credit notes and a bill validation check.

<Update label="2026-06-30" tags={["Feature","Release"]} description="Three-way matching">
  ## New

  ### Purchase orders

  Record what an organisation has committed to buy. [Create a purchase order](/api-reference/endpoint/purchase-orders/create-purchase-order) with its lines, [list](/api-reference/endpoint/purchase-orders/list-purchase-orders) and [retrieve](/api-reference/endpoint/purchase-orders/get-purchase-order) them, and [update](/api-reference/endpoint/purchase-orders/update-purchase-order) the header and lines in place. [Close](/api-reference/endpoint/purchase-orders/close-purchase-order) a PO once it's fulfilled or [cancel](/api-reference/endpoint/purchase-orders/cancel-purchase-order) it — both stop future matching while keeping existing allocations. POs are trusted platform data, so they don't go through approval.

  ### Delivery notes

  Capture what was actually received. [Create a delivery note](/api-reference/endpoint/delivery-notes/create-delivery-note) with its received lines, [list](/api-reference/endpoint/delivery-notes/list-delivery-notes), [retrieve](/api-reference/endpoint/delivery-notes/get-delivery-note), and [update](/api-reference/endpoint/delivery-notes/update-delivery-note) them, then [close](/api-reference/endpoint/delivery-notes/close-delivery-note) or [cancel](/api-reference/endpoint/delivery-notes/cancel-delivery-note) when done.

  ### Three-way matching

  Reconcile a bill against what was ordered and what was received. See the [three-way matching guide](/guides/three-way-matching) for the full workflow. [Allocate a bill line](/api-reference/endpoint/matching/add-allocation) against a PO line (price) and/or a delivery-note line (receipt quantity), or [remove an allocation](/api-reference/endpoint/matching/remove-allocation) to unmatch. Read a [bill's match group](/api-reference/endpoint/matching/get-a-bills-match-group) or [any match group](/api-reference/endpoint/matching/get-match-group) to see bill lines, allocations, and price-vs-PO variances derived at read time, plus fuzzy suggestions for unmatched lines. [Resolve a line's variance](/api-reference/endpoint/matching/resolve-a-match-line) — accept it, or accept and update the catalog — and [undo a resolution](/api-reference/endpoint/matching/undo-a-line-resolution) at any time. You can also list the bills matched to a [purchase order](/api-reference/endpoint/purchase-orders/list-bills-matched-to-a-purchase-order) or [delivery note](/api-reference/endpoint/delivery-notes/list-bills-matched-to-a-delivery-note).

  ### Supplier credit notes

  Record value a supplier owes the organisation — a faulty-goods credit, an overcharge, a returned order — as a **supplier credit note**. It's a positive document scoped to a supplier: you [create it](/api-reference/endpoint/supplier-credit-notes/create-supplier-credit-note) in draft, [issue it](/api-reference/endpoint/supplier-credit-notes/issue-supplier-credit-note) to make the credit available, then [apply it](/api-reference/endpoint/supplier-credit-notes/apply-supplier-credit-to-a-bill) to one or more bills you owe that supplier. Applying nets the credit against the bill, reducing what's left to pay (`outstanding`). Bills are never negative — they simply reach a zero balance once enough credit is applied. Every application is [reversible](/api-reference/endpoint/supplier-credit-notes/reverse-a-supplier-credit-application), returning the credit to the note. Drafts can be [deleted](/api-reference/endpoint/supplier-credit-notes/delete-supplier-credit-note) before issue, and you can [list](/api-reference/endpoint/supplier-credit-notes/list-supplier-credit-notes) or [retrieve](/api-reference/endpoint/supplier-credit-notes/get-supplier-credit-note) notes and [list the applications](/api-reference/endpoint/supplier-credit-notes/list-supplier-credit-applications) against one.

  Per-supplier, per-currency [available balances](/api-reference/endpoint/supplier-credit-notes/get-supplier-credit-balance) and a full [credit ledger](/api-reference/endpoint/supplier-credit-notes/get-supplier-credit-ledger) (every issuance and application, newest first) are exposed as read endpoints, so you can reconcile supplier credit the same way you'd reconcile a customer's. You can also see [which credits have been netted against a bill](/api-reference/endpoint/bills/list-a-bills-supplier-credit-applications).

  Three webhook events keep your systems in sync automatically:

  * `supplier_credit_note.issued` — fired when a credit note is issued and its credit becomes available.
  * `supplier_credit.applied` — fired when credit is netted against a bill.
  * `bill.credited` — fired against the underlying bill (with its reduced `outstanding`) whenever credit is applied.

  See the [supplier credit notes guide](/guides/supplier-credit-notes) to get started.

  ### Bill validation

  [Validate a bill](/api-reference/endpoint/bills/validate-a-bill) before acting on it. Dolfin checks that line items reconcile to the subtotal, that subtotal plus tax equals the total, that required header fields are present, and that bank details are well-formed — so you can catch inconsistencies early.
</Update>
