> ## 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.

# Delivery-line match conflicts name the bill holding the line

> Allocating a delivery-note line another bill already holds now returns its own error code, carrying the bill and the allocation to remove.

<Update label="2026-08-04" tags={["Change","Breaking"]} description="Delivery-line match conflicts">
  ## Breaking

  ### A held delivery-note line has its own error code

  A delivery-note line's received quantity is counted across every bill, so allocating a line another bill already matched is refused. That refusal used to be `Match.DnOverReceipt` — the same code you get when a supplier bills for more than was ever delivered, even though the two need opposite responses from a reviewer.

  [Adding an allocation](/api-reference/endpoint/matching/add-allocation) now returns `Match.DnLineHeld` when the quantity you asked for fits inside what was received but is already matched elsewhere. The response names the bill holding it:

  ```json theme={null}
  {
    "code": "Match.DnLineHeld",
    "detail": "Delivery-note line '9c2f…' received 12 and 12 is already matched to 'INV-283654'. …",
    "data": {
      "deliveryNoteLineId": "9c2f…",
      "quantityReceived": 12,
      "quantityMatched": 12,
      "quantityAvailable": 0,
      "heldBy": [
        {
          "billId": "0f41…",
          "invoiceNumber": "INV-283654",
          "matchGroupId": "b5fa…",
          "matchAllocationId": "7d38…",
          "matchedQuantity": 12
        }
      ]
    }
  }
  ```

  To move the line to your bill, [remove the allocation](/api-reference/endpoint/matching/remove-allocation) named by `matchGroupId` and `matchAllocationId`, then post yours again. A match can only be changed while the bill holding it is in review — if that bill has been approved, the removal returns `Match.BillNotInReview` and the line cannot be reassigned.

  `Match.DnOverReceipt` keeps its original meaning: more than was ever received on that line. You still get it when releasing the other bill's hold would not free enough quantity for your request.

  **What to check.** The HTTP status is still `409`, so error handling keyed on the status is unaffected. If you branch on the error `code`, a conflict that previously arrived as `Match.DnOverReceipt` now arrives as `Match.DnLineHeld`.

  ## Updates

  ### Finding which bill holds a delivery note

  To answer the same question before you hit the error, [list the bills matched to a delivery note](/api-reference/endpoint/delivery-notes/list-bills-matched-to-a-delivery-note), and read `matchedQuantity` and `fullyMatched` on each line of [the delivery note](/api-reference/endpoint/delivery-notes/get-delivery-note). The [three-way matching guide](/guides/three-way-matching) covers the reassignment flow end to end.
</Update>
