The supplier resends an invoice, one employee uploads its XML and another enters the PDF as a new purchase. At month end, the business has two liabilities for one delivery. Detecting duplicate supplier documents begins with identifying the document, not comparing filenames or amounts. Different files may represent one invoice. Two invoices with identical amounts may be legitimate purchases. Make that distinction before stopping or approving a payment. The review should leave evidence of what repeated and why the team accepted or rejected the additional record, rather than simply removing the file that looked familiar.
Distinguish repeated files, bills and payments
A repeated file is another copy of the same evidence. A duplicate bill record represents the same obligation twice. A duplicate payment is a second outflow settling something already paid, even when only one bill exists. Each needs a different search. Inspecting attachments will not rule out repeated transfers. Checking the bank will not find every duplicate purchase that has not yet been paid. When a supplier raises a query, identify which situation the team is investigating. Otherwise someone may delete a copied PDF while leaving the duplicated liability or extra bank payment unresolved.
Use the electronic document's identity
Hacienda's official API documentation uses the document key to identify an electronic document and query its state. Compare that identity inside the XML instead of trusting a name such as 'final-invoice.xml'. Keep issuer, receiver and document type available for context. A credit note referencing an invoice is not another copy of the invoice. Fiscal states also belong to specific documents. An email saying 'accepted' does not settle a duplicate review if nobody has established which document was queried. Identity tells you which document you have; the commercial evidence tells you which transaction it represents.
Example: two files for one CRC 113,000 purchase
On Monday, a spare-parts invoice for CRC 113,000 arrives through email and becomes bill B-501. On Tuesday, an employee manually uploads 'resent-parts.xml'. Both XMLs have the same key and receiver. This is another arrival of the same document, not a second delivery. Find B-501 and review its lines before adding relevant evidence there. If a manually entered bill B-517 also exists from the PDF, investigate whether it represents the same liability before scheduling payment. Recognizing the repeated imported key does not automatically establish what that separate manual record was intended to cover.
Tario's XML import checks whether the company already has a bill with that document key. A uniqueness constraint on company and key also protects against simultaneous imports of the same document. That collision is handled as already imported instead of creating another purchase because of a resend. This is a specific identity safeguard. It is not universal detection of similar invoices, repeated images or manually entered purchases without keys. Those cases still require comparison of supplier, number, dates and lines. Describe the protection accurately so the payment team does not stop performing checks the import cannot perform.
- Same company and XML key: find the existing bill first.
- Same supplier and number but no XML: request the original and inspect both records.
- Only amount and date match: investigate; do not assume a confirmed duplicate.
- One bill has two payments: compare bank references and applications.
- A credit note references the invoice: inspect its effect without treating it as a copy.
- The receiver is another company: do not use that document to complete this purchase.
Avoid false positives on recurring purchases
August and September rent both cost CRC 350,000. The supplier sends both invoices on September 3, so their amounts and dates are similar. Discarding one without reading the service period could remove a valid obligation. Compare keys, numbers and descriptions. Distinct documents covering distinct months should remain available for the accountant's date review. Conversely, different keys do not prove two services occurred: the supplier may have billed the same service twice under separate numbers. That case needs the contract and supplier confirmation. Matching rules are prompts for investigation, not evidence that the underlying commercial transaction happened only once or twice.
Resolve existing records without hiding the history
Pause preparation of the second payment while the case is clarified. Review whether each bill is a draft, recognized or paid and which movements it generated. Agree the appropriate void or reversal flow with the accountant rather than deleting posted transactions to clean the list. Retain both references and the decision. If two transfers already occurred, the supplier may need to refund the extra amount or agree to apply it later. Correcting the accounting record does not return the money. A payment request should cite the existing bill reference and current balance, not merely attach a newly received PDF.
For B-501, completion means one active CRC 113,000 obligation with payments explaining its actual balance, plus an explanation of B-517 if it existed. Record how each copy arrived. Review incidents by cause: resends, double entry, confusion between companies or repeated payment. Each cause suggests a different control, such as centralized reception or requiring bill references on payment requests. Where manual documents lack keys, agree a supplier-and-number search while retaining original numbering. These are company procedures. They improve review without promising that the system will recognize every visually similar file or every commercial billing mistake.