Two data sources
Reconciliation operates on two parallel sets of records stored in PostgreSQL:| Side | Table | Description |
|---|---|---|
| CIA (Company/Platform) | conc_conciliado_c | Transactions loaded from the TMT platform — payouts, wire transfers, and payment references from orders_transactions. |
| Banco (Bank) | conc_conciliado_b | Bank statement entries imported from the financial institution. |
no_docu (document number). The reconciliation engine matches records by comparing the last 8 characters of no_docu across both sides, along with tipo_doc (document type: NC for credit notes, ND for debit notes) and monto (amount).
Reconciliation outcomes
After running the reconciliation process, records are routed to one of three destinations:conc_conciliacion— Matched records. Both sides agree; the transaction is reconciled.conc_noconciliado_c— CIA records with no matching bank entry.conc_noconciliado_b— Bank records with no matching CIA entry.
conc_conciliado_c and conc_conciliado_b are flagged procesado = true so they are not processed again.
Payout distribution on match
When a CIA record of typeNC is successfully matched to a bank record, the reconciliation process automatically calculates and creates payout records in Firestore (orders_payout) and PostgreSQL. The distribution logic splits the transaction amount between fixed costs (Pago Costo Fijo) and variable costs (Pago Costo Variable) for both TMT and the event client, based on the financial setup stored in the event’s setup/financial document.
Reconciliation Process
Step-by-step workflow, all process functions, and request/response examples.
Reconciliation Summary
Query the summary of reconciled and pending balances for a custody account.