Outstanding items & matching

Read open items and match payments with invoices.

Matching links entry lines that offset each other, typically an invoice and its payment(s), by giving them the same matching number (MatchNo). Lines that are not matched yet make up the outstanding items.

Reading outstanding items

NeedEndpoint
A customer's outstanding debtscustomers.outstanding
A supplier's outstanding debtssuppliers.outstanding
Open sales invoices / credit notes and their linked paymentsinvoices.sales.outstanding.list
One open sales invoice and its linked elements (partial payments…)invoices.sales.outstanding.info
Unmatched lines of any accountaccount-histories.list with NotMatchedOnly: true

invoices.sales.outstanding.info requires the FolderId and one of:

  • the BookEntryId, or
  • the BookEntryNumber, formatted as {DaybookSearchKey}-{Number} (e.g. VEN-202409001).

Matching lines

matching matches a set of account history lines under one matching number.

{
  "FolderId": "83f26e75-f474-4b09-a1d3-aa698e18fbf0",
  "AutoGenerateMatchNo": true,
  "AccountHistoryIds": [
    "4f6a2c1e-8b3d-4a7e-9f0c-2d5b8e1a6c3f",
    "7e2b9d4a-1c6f-4e8b-a3d5-0f9c2b7e4a1d"
  ]
}
{ "Data": { "MatchNo": 15 } }

Rules:

  • all lines must have the same account type: 100 Customer, 200 Supplier or 300 General;
  • for customers and suppliers (100/200), all lines must belong to the same company;
  • for general accounts (300), all lines must belong to the same account.

Choosing the matching number

Either let the API generate it with AutoGenerateMatchNo: true, or provide your own MatchNo. To get the next free number beforehand, use:

Account typeEndpoint
Customermatching.next-number.customer
Suppliermatching.next-number.supplier
General accountmatching.next-number.account
📘

Matching at creation time

Invoices and operation lines accept a MatchNo when they are created. Combined with matching.next-number.*, this lets you post a payment already matched with its invoice.

Typical flow: reconcile a customer payment

  1. Find the open invoice with invoices.sales.outstanding.list (filter on CompanyIds).
  2. Post the payment with book-entries.banks.new on the customer's account.
  3. Retrieve the account history lines of the invoice and the payment (account-histories.list with CompanyId and NotMatchedOnly: true).
  4. Call matching with both line Ids.

Did this page help you?