Skip to main content
The conciliation_summary function returns a financial snapshot for a custody account by aggregating data from all reconciliation tables. It provides a single object (resumen) that lets you quickly assess how much has been reconciled, what is still pending, and whether the bank and platform balances align.

conciliation_summary

POST /conciliation_summary
Request
{
  "data": {
    "no_cta": "001-123456-78",
    "from": "2024-01-01",
    "to": "2024-01-31"
  }
}
data.no_cta
string
required
The custody account number to summarize. Used as the primary filter across all reconciliation tables.
data.from
string
Start date for filtering reconciled and non-reconciled records. Applied to the fecha_reg column in conc_conciliacion, conc_noconciliado_c, and conc_noconciliado_b. Does not affect the balance (saldodia_*) lookup.
data.to
string
End date for filtering reconciled and non-reconciled records. Applied to the fecha_reg column.

Response

Response — summary found
{
  "message": "Resumen ",
  "status": 200,
  "data": {
    "message": "Resumen ",
    "resumen": {
      "saldodia_banco": 50000.00,
      "saldodia_cia": 49800.00,
      "saldo_conciliado_banco": 48000.00,
      "saldo_conciliado_cia": 48000.00,
      "saldo_pendiente_banco": 500.00,
      "saldo_pendiente_cia": 300.00,
      "total_ajustes": 200.00,
      "transfe_transito": 0
    }
  }
}
Response — account not yet initialized (opens from Firestore) When no balance record exists in conc_saldos_banco for the requested account, the function looks up the custody account in Firestore and seeds an initial balance record from opening_balance.
{
  "message": "Saldo Actualizado ",
  "status": 200,
  "data": {
    "message": "Saldo Actualizado volver a consultar ",
    "opening_balance": 50000.00
  }
}
When you receive the “Saldo Actualizado” response, the initial balance has been written to conc_saldos_banco. Call conciliation_summary again to get the full resumen object.
Response — account not active for reconciliation
{
  "message": "Cuenta no activa para conciliacion ",
  "status": 400,
  "data": {
    "message": "Cuenta no activa para conciliacion"
  }
}
Response — account not found
{
  "message": "Cuenta no encontrada ",
  "status": 400,
  "data": {
    "message": "Cuenta no encontrada "
  }
}

Response fields

data.resumen.saldodia_banco
number
Current bank balance for the account. Sourced from conc_saldos_banco.saldo_banco. This is the reference balance used to compare against the platform.
data.resumen.saldodia_cia
number
Current platform/company balance. Sourced from conc_arckmc.sal_dia_ant (prior day balance in the platform’s accounting table).
data.resumen.saldo_conciliado_banco
number
Sum of monto_b across all matched records in conc_conciliacion for the requested account and date range. Represents the total bank-side amount that has been successfully reconciled.
data.resumen.saldo_conciliado_cia
number
Sum of monto across all matched records in conc_conciliacion for the requested account and date range. Represents the total platform-side amount that has been successfully reconciled.
data.resumen.saldo_pendiente_cia
number
Sum of monto in conc_noconciliado_c for the account and date range. Represents platform transactions that have not yet been matched to a bank record.
data.resumen.saldo_pendiente_banco
number
Sum of monto in conc_noconciliado_b for the account and date range. Represents bank entries that have not yet been matched to a platform record.
data.resumen.total_ajustes
number
Sum of monto_ajuste from the conc_ajustes table. Represents the total value of manual adjustments applied to the account. Date range is not applied to this figure — it uses only no_cta as a filter.
data.resumen.transfe_transito
number
Transfers in transit. Always returns 0 in the current implementation; reserved for future use.

Interpreting the summary

A fully reconciled account will show:
saldodia_banco  ≈  saldo_conciliado_banco + saldo_pendiente_banco + total_ajustes
saldodia_cia    ≈  saldo_conciliado_cia   + saldo_pendiente_cia
If saldo_pendiente_cia or saldo_pendiente_banco is non-zero, there are outstanding items that require review. Use noconciliation_data_cia and noconciliation_data_b to retrieve the individual records, then apply conciliation_ajustes to resolve them. If saldo_conciliado_banco and saldo_conciliado_cia differ, the matched pairs have different amounts on each side — this can happen with currency conversion or rounding and should be investigated.
The total_ajustes value is queried without a date range filter. If you are comparing a specific period, keep in mind that total_ajustes may include adjustments from outside the from/to window.

Data sources

FieldSource tableColumn
saldodia_bancoconc_saldos_bancosaldo_banco
saldodia_ciaconc_arckmcsal_dia_ant
saldo_conciliado_bancoconc_conciliacionsum(monto_b)
saldo_conciliado_ciaconc_conciliacionsum(monto)
total_ajustesconc_ajustessum(monto_ajuste)
saldo_pendiente_ciaconc_noconciliado_csum(monto)
saldo_pendiente_bancoconc_noconciliado_bsum(monto)

Build docs developers (and LLMs) love