In the Direct Banking extension we store additional references or metadata when the Sales and Purchase invoices are posted.
These references are used to match the remittance information in the transaction (the transaction description that was entered when making a payment).
Examples of these references are Document No., External Document No., and Payment References.
When the remittance information of the bank transaction contains one or more references, then that entry is stored in a list of matching candidates.

If there is no match at all on remittance information but outstanding invoices exists that match on amount (either an exact match on one invoice of the sum of all outstanding invoices) then these entries are also added to the list of matching candidates. .

In the second phase of invoice matching, these matching candidates are evaluated on amounts.
Does the total amount of the outstanding invoices for one account match with the amount of the transaction?
Or was the payment intended for one specific outstanding invoice?
This is what is determined in the final stage of invoice matching.
The next chapter describes some details about the considerations in this step.