Skip to content

Payments, billing and compliance

Reconciling sales, payments and electronic invoices: three separate states

Separates the sale (commercial), the payment (financial) and the e-invoice validated by the DIAN (tax), and proposes matching them by their keys (order, reference/transaction ID, CUFE) in a periodic close. Includes a matrix of 8 combinations with a decision for each, a synthetic one-week example, 5 mistakes, a checklist and 4 FAQs; tax matters are referred to your accountant.

In this guide
A receipt, a payment card and a printed invoice lined up and joined by a green light line; a hand touches the card.

On Friday someone asks "how much did we sell this week?" and three answers come up: the CRM's, the payment gateway report's and the invoicing software's. None of them is wrong. Each one measures a different state of the same transaction, and the trouble starts when the team treats them as one.

Closing a period well means checking, sale by sale, what was agreed, what was collected and what was invoiced, and explaining why they differ when they do. Tax decisions are validated with your accountant.

Three questions about the same transaction

The sale is the commercial state: what you agreed to sell, to whom, for how much and on what terms; it lives in the accepted quote, the order or the CRM. The payment is the financial state: how much money moved, by what method and when it reached your account; it lives in the gateway, the bank or the cash register. The invoice is the tax state: whether there is an electronic invoice validated by the DIAN, Colombia's tax authority, and delivered to the buyer.

The three often drift apart, and not by mistake. A sale can be closed without payment, because it was on credit; a payment can arrive without you knowing which sale it belongs to; an invoice can exist while collection is still pending. Reconciling is not forcing them to say the same thing, but explaining every difference with evidence. Master data across systems is covered in the guide on connecting CRM, inventory and billing without duplicating information; the focus here is the close.

When an invoice is invoiced

The electronic sales invoice goes through prior validation. According to the DIAN, it is the process that checks that invoices and debit and credit notes meet the rules of the technical annex, so the document can then be delivered to the buyer together with the validation receipt.

Resolution 165 of 2023, now compiled in Resolution 227 of 2025 (the DIAN's Single Resolution), sets out the requirements. Three matter for reconciliation. The invoice is deemed issued when it is validated and delivered to the buyer. Each invoice carries its CUFE (unique electronic invoice code), and credit and debit notes carry their own CUDE and must reference the prefix, number and CUFE of the invoice they modify. And the invoice records the payment terms, cash or credit with its term, and the payment method when it is a cash sale.

In practice, "we generated it in the software" is not the same as "it is invoiced". If prior validation rejects the document, the invoice was not issued. The FAQ on the DIAN's invoicing microsite states that a rejected invoice is not voided with a credit note: the reported errors are corrected and it is transmitted again with the same number. Confirm that procedure with your technology provider.

When a payment is paid

The payment has its own states. Wompi's events documentation, for example, states that the transaction.updated event reports that a transaction changed, usually to a final status such as APPROVED, DECLINED, VOIDED or ERROR, and includes the amount in cents and the reference your system sent.

An approved transaction is not yet money reconciled in your bank. Stripe documents a payout reconciliation report: each payout to your account corresponds to a batch of payments, refunds, disputes and fees, and the report places it by its estimated arrival date, which is not always the date your bank posts the deposit. Those are the rules of those two gateways; check how yours works. Recording each payment only once against its order is covered in the guide on approved payments and duplicate fulfillment; this one starts afterwards.

The keys that tie the records together

RecordKey to keepWhere it appears
SaleOrder number or accepted quoteCRM, store or order system
PaymentReference sent to the gateway and transaction IDGateway dashboard or report
PayoutDate, net amount and payout identifierBank statement or payout report
InvoicePrefix, number and CUFEInvoicing software
AdjustmentNumber and CUDE of the credit or debit noteInvoicing software

The rule that saves the most hours: the reference you send to the gateway is the order number, not free text, and that number also goes on the invoice if your software allows it. If someone has to search by customer name and approximate amount, reconciliation depends on their memory.

What to do when they do not match

The matrix turns the most common combinations into a decision. When the action touches taxes, invoice dates or advance payments, your accountant decides.

SalePaymentInvoiceWhat it meansWhat to do
ConfirmedApproved and paid outValidated and deliveredComplete closeFile the three keys together
ConfirmedApprovedNo invoicePending invoicingCheck with the accountant when it should have been issued
ConfirmedNo paymentValidated, on creditOpen receivableFollow the term on the invoice
UnidentifiedApprovedNo invoiceUnapplied paymentSearch by reference; do not invoice blindly
ConfirmedApprovedRejected by the DIANThe invoice does not exist yetCorrect and retransmit with the technology provider
Cancelled or returnedApprovedValidatedAdjustment missingAssess the credit note and refund with the accountant
ConfirmedPayout lower than invoicedValidatedFee, withholding or other deductionExplain the difference; do not touch the invoice
ConfirmedTwo approved paymentsValidatedPossible overpaymentCommercial and financial review before refunding

Two temptations keep coming back: using the gateway report as a sales report, although it leaves out credit sales and direct transfers, and adjusting the invoice to match the payout, when the invoice reflects the sale and fees and withholdings are booked by the accountant. The reconciliation matrix that comes with this guide records each combination in your close with evidence, owner and date.

One week, with invented data

The case is fictional; it is not a client case or a RealStack result. A parts distributor closes the week with five sales in the CRM for COP 4,200,000. The gateway shows four approved transactions for COP 3,150,000, and the invoicing software, five validated invoices for COP 4,200,000.

Matching by keys turns up three differences. A COP 1,050,000 sale was on 30-day credit: it has a validated invoice and no payment, and that is not an error, it is a receivable. One transaction carried "spare parts payment" as its reference instead of the order number; it was found by amount and date, and since then the payment link carries the order reference. And the bank payout was lower than the sum of approved transactions, because of the fees shown in the gateway report. Nobody touched the invoices: the difference was explained and the accountant decided how to book it. The close did not end in "everything matches", but in "everything is explained".

The close, step by step

  1. Set the cut-off: start and end date and time, with the time zone, because each system may report in a different one.
  2. Export the three records for the same period, with the credit notes.
  3. Match by keys, not by name or amount; anything that does not match goes to review.
  4. Classify each difference with the matrix: receivable, pending invoicing, unapplied payment, pending adjustment or payout difference.
  5. Assign each case to a person, with a date. Tax matters go to the accountant.
  6. Keep the evidence: exports, decisions and who approved. If volume means the close no longer fits in a spreadsheet, see when a spreadsheet stops being enough for your operation.

A sign the close works: unapplied payments go down from one close to the next and no difference is left without a written cause.

Where this guide ends

It organizes operations; it does not define when to issue an invoice, how to handle advance payments, withholdings or VAT, or how to book fees: your accountant decides that based on your activity and current regulations. Nor does it replace accounting bank reconciliation or certify compliance with the DIAN. If your operation needs to connect these records, the Operations page explains how RealStack approaches connecting processes in phases; the scope of any work is defined in a proposal.

Related guides

  • How to connect CRM, inventory and billing without duplicating information https://realstack.tech/en/knowledge/connect-crm-inventory-and-billing-without-duplicate-data
  • An approved payment is not a reconciled order: prevent duplicate fulfillment https://realstack.tech/en/knowledge/payment-webhooks-duplicate-fulfillment
  • When a spreadsheet stops being enough for your operation https://realstack.tech/en/knowledge/when-spreadsheet-stops-being-enough
  • Operations: connect your processes https://realstack.tech/en/operacion

Bring it to your business

Sales, payment and invoice reconciliation matrix

CSV template to close a period by matching, sale by sale, the commercial status, the payment and the electronic invoice. Use it to classify each difference, keep evidence and assign who resolves it, without changing documents to make them match.

View resource
If the gateway approved the payment, can I consider the sale invoiced?

No. An approved payment is a financial state. The electronic invoice is deemed issued when the DIAN validates it and it is delivered to the buyer. They are two separate records matched by their keys.

Is an invoice rejected by the DIAN voided with a credit note?

According to the FAQ on the DIAN's invoicing microsite, no: the reported errors are corrected and it is transmitted again with the same number. Confirm the procedure with your technology provider and your accountant.

Why doesn't the bank payout match the invoiced total?

There may be gateway fees, withholdings, payouts that group several days or credit sales not yet paid. Explain it with the gateway report and let the accountant define how to record it; do not modify the invoice.

How often should I reconcile sales, payments and invoices?

It depends on your volume and what you agree with your accountant. What matters is a fixed cut-off, the three records for the same period and no difference left without a cause and an owner.

Authorship and sources

Author: Andrés Florez · RealStack