Skip to main content
TMT Platform integrates with the Banco de Venezuela (BDV/BCV) API for two purposes:
  1. Mobile payment verification — confirm that a Pago Móvil payment was received in the TMT BDV account
  2. Bank reconciliation — pull today’s account movements and load them into the reconciliation tables
Both functions use the apibdv API key configured in Firebase Functions and the cuentabdv account number. These are loaded from config/config.js.

conciliation_bdv

Fetches today’s movements from the BDV account and loads them into the PostgreSQL reconciliation tables (conc_conciliado_b and conc_conciliado_c). The function calls https://bdvconciliacion.banvenez.com/apis/bdv/consulta/movimientos with today’s date range and tipoMoneda: "VES", then processes each movement:
  • CREDITO movements → mapped as type NC (credit)
  • DEBITO movements → mapped as type ND (debit), also inserted into conc_conciliado_c
  • Duplicate prevention: checks conc_conciliado_b for existing no_docu before inserting

Endpoint

POST https://{region}-{project}.cloudfunctions.net/conciliation_bdv

Request

{
  "data": {}
}
No body parameters required. The function always fetches today’s movements.

Response

Success:
{
  "message": "Conciliacion Banco de Venezuela ",
  "status": 200,
  "data": {
    "data": {
      "movs": [
        {
          "referencia": "1234567890",
          "fecha": "2025-03-19",
          "importe": "150,00",
          "mov": "CREDITO"
        }
      ]
    }
  }
}
Error:
{
  "message": "Conciliacion Banco de Venezuela",
  "status": 400,
  "data": {
    "status": "error <error message>"
  }
}

Data inserted

For each movement, a row is inserted into conc_conciliado_b:
ColumnValueDescription
no_cia'1'Company ID
no_ctaBDV account numberFrom cuentabdv config
procedencia'A'Source: automatic
tipo_doc'NC' or 'ND'Credit or debit
no_docureferenciaBDV reference number
fechaISO timestampMovement date
montoimporteAmount in VES
no_fisicoreferenciaPhysical reference
serie_fisicoreferenciaSeries reference
Run conciliation_bdv daily (e.g., via Cloud Scheduler) to keep reconciliation data up to date. Follow with conciliation_process to match bank records against platform records.

mobile_payment_bcv

Verifies a Pago Móvil payment by querying the BDV API with the payer’s details.

Endpoint

POST https://{region}-{project}.cloudfunctions.net/mobile_payment_bcv

Request

data.ced_pag
string
required
Venezuelan national ID (cédula) of the payer.
data.tel_pag
string
required
Phone number of the payer.
data.tel_dest
string
required
Destination phone number (TMT’s BDV-registered phone).
data.referencia
string
required
Payment reference number provided by the payer.
data.fec_pag
string
required
Payment date in the format expected by the BDV API.
data.importe
string
required
Payment amount as a string (e.g., "150.00").
data.cod_ban_origen
string
required
Origin bank code (e.g., "0105" for Mercantil, "0102" for Banco de Venezuela).
{
  "data": {
    "ced_pag": "V-12345678",
    "tel_pag": "04241234567",
    "tel_dest": "04121234567",
    "referencia": "987654321",
    "fec_pag": "19/03/2025",
    "importe": "150.00",
    "cod_ban_origen": "0105"
  }
}

Response

Payment found:
{
  "message": "Conciliacion Pago movil BDV ",
  "status": 200,
  "data": {
    "resultado": {
      "estado": "EXITOSO",
      "referencia": "987654321",
      "monto": "150.00"
    }
  }
}
Error:
{
  "message": "Conciliacion Pago movil BDV ",
  "status": 400,
  "data": {
    "error": {}
  }
}
This function only verifies that a payment was received — it does not write to Firestore or PostgreSQL. Integrate the response into your order processing logic to mark transactions as confirmed.

Build docs developers (and LLMs) love