Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/scoria02/marbes2021_backend/llms.txt

Use this file to discover all available pages before exploring further.

The banking layer in Marbes sits underneath every lending and collection operation. Banks are the containers that hold TCOL funds; their fee configurations (costos) determine how bank charges are applied to individual transactions. When funds need to move between accounts — for example after a client repays a loan — the fund movement system creates a traceable audit trail. This guide covers each banking operation available through the API. All requests require a valid JWT token in the Authorization header.

Managing banks

List all banks

curl -X GET https://your-server:7780/api/bancos/ \
  -H "Authorization: Bearer YOUR_TOKEN"
Returns an array of all registered banks with their ID, name, and status fields.

Create a bank

curl -X POST https://your-server:7780/api/bancos/ \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Banco de Venezuela",
    "codigo": "0102",
    "tipo": "comercial"
  }'
Banks are referenced by UUID (id_banco) throughout TCOL and TPROD records. Create all banks you need before onboarding investors or clients.

Bank costs (costos)

Bank costs define the standard fee percentage a specific bank charges for processing transfers. These values populate the costo_banco field automatically when a bank is selected during TCOL or TPROD creation.

List all bank cost records

curl -X GET https://your-server:7780/api/bancos/costos \
  -H "Authorization: Bearer YOUR_TOKEN"

Create a bank cost entry

curl -X POST https://your-server:7780/api/bancos/costos \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id_banco": "banco-uuid",
    "porcentaje": 0.25,
    "descripcion": "Standard wire transfer fee"
  }'

Get costs for a specific bank

curl -X GET https://your-server:7780/api/bancos/{idBanco}/costos \
  -H "Authorization: Bearer YOUR_TOKEN"

Update a bank cost entry

Use the cost record’s own id (not the bank’s id) to update it:
curl -X PUT https://your-server:7780/api/bancos/costos/{id} \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "porcentaje": 0.30,
    "descripcion": "Updated fee after bank policy change"
  }'
Updating a cost record only affects future TCOL and TPROD records. Existing records retain the costo_banco value captured at the time they were created.

Moving funds between TCOL accounts

When you need to transfer a portion of one TCOL’s available balance to another — for example when consolidating funds before a lending round — use the fund movement endpoint. Every move is recorded in the movement trace.
curl -X POST https://your-server:7780/api/bancos/tcol/mover-fondos \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id_tcol_origen": "tcol-origen-uuid",
    "id_tcol_destino": "tcol-destino-uuid",
    "monto": 5000,
    "observacion": "Consolidating funds for February lending round"
  }'
The origin TCOL must have sufficient available funds (disponible_activo) to cover the transfer amount. The system will reject the request if the balance is insufficient.

Adding funds to a TCOL from a TPROD repayment

When a client repays a loan, the repaid amount is credited back to a TCOL account. Use the fondos endpoint to record the incoming repayment:
curl -X POST https://your-server:7780/api/bancos/tcol/{id}/fondos \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id_tprod": "tprod-uuid",
    "monto": 11500,
    "referencia": "REF-REPAGO-2026-001",
    "fecha": "2026-03-10"
  }'
Replace {id} with the UUID of the TCOL account receiving the repayment.
The monto here should be the total repayment amount — principal plus commission — that the client returned. This matches monto_total on the TPROD record.

Viewing the TCOL movement trace

Every fund movement in or out of a TCOL creates a trace entry. Retrieve the full movement history for a TCOL to audit how its balance changed over time:
curl -X GET https://your-server:7780/api/bancos/tcol/{idTcol}/traza \
  -H "Authorization: Bearer YOUR_TOKEN"
The response lists movements in chronological order, including the type of operation (incoming collection, outgoing loan, inter-TCOL transfer, repayment), the amount, the BCV rate at the time, and the responsible employee.

Client bank accounts

Credit clients can have multiple bank accounts on file. These are used when disbursing loan funds via bank transfer.

Add a bank account for a client

curl -X POST https://your-server:7780/api/bancos/clientes/{idCliente}/cuentas \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id_banco": "banco-uuid",
    "cuenta": "01020135750000115296",
    "telefono": "+58-414-9876543",
    "estatus": "activo"
  }'
id_banco
string
required
UUID of the bank where the client holds the account.
cuenta
string
required
Full account number at that bank.
telefono
string
Mobile number linked to the account for mobile banking transfers.
estatus
string
Account status: activo or inactivo. Defaults to activo.

List banks with accounts for a client

Returns all banks where the client has at least one active account:
curl -X GET https://your-server:7780/api/bancos/clientes/{idCliente}/bancos \
  -H "Authorization: Bearer YOUR_TOKEN"
Only accounts with estatus = activo appear in this response. Deactivate accounts instead of deleting them to preserve audit history.

Build docs developers (and LLMs) love