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.

A loan (TPROD — transaction product) is the core lending record in Marbes. It captures the borrower, loan amount, commission structure, bank costs, and repayment term. Before disbursing, you can pre-allocate funds using Control de Fondos to ensure the lending capacity exists. Once created, a TPROD goes through a status workflow — from pendiente to aceptado — before funds are released. This guide covers each step. All requests require a valid JWT token in the Authorization header.
1

Create a credit client

A credit client is a borrower. You must register them before creating a loan.
curl -X POST https://your-server:7780/api/negocios/cliente \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Carlos",
    "apellido": "Mendoza",
    "cedula_rif": "V-20987654",
    "email": "[email protected]",
    "tipo": "natural",
    "credito": 50000,
    "referido": "REF-005",
    "telefono": "+58-212-5550100",
    "fecha_registro": "2026-02-10"
  }'
nombre
string
required
Client’s first name.
apellido
string
required
Client’s last name.
cedula_rif
string
required
National ID (V-########) or company tax ID (J-########).
email
string
required
Contact email address.
tipo
string
required
Client type: natural (individual) or juridico (company).
credito
number
required
Approved credit limit for this client.
referido
string
required
Referral code for the person or channel that introduced this client.
telefono
string
required
Contact phone number.
fecha_registro
string
Registration date in YYYY-MM-DD format. Defaults to now if omitted.
Save the returned client id — you’ll use it when creating the TPROD.
2

Pre-allocate funds with Control de Fondos

Control de Fondos lets an operator reserve a portion of available TCOL funds for a specific lending window before any loans are issued. This step is optional but recommended when multiple executives share a common pool of funds.
curl -X POST https://your-server:7780/api/negocios/control-fondos \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "operador_id": "operador-uuid",
    "ejecutivos_ids": ["ejecutivo-uuid-1", "ejecutivo-uuid-2"],
    "id_compania": "compania-uuid",
    "id_banco": "banco-uuid",
    "fecha_inicio": "2026-02-10",
    "fecha_fin": "2026-02-28",
    "moneda": "USD",
    "tasa_bcv": 36.50,
    "monto_asignado": 30000,
    "observacion": "Batch for February lending round"
  }'
operador_id
string
required
UUID of the operator who owns this fund allocation.
ejecutivos_ids
array
required
Array of executive UUIDs authorized to lend from this allocation.
id_compania
string
required
UUID of the company the funds belong to.
id_banco
string
required
UUID of the bank where funds are held.
fecha_inicio
string
required
Start date of the allocation window in YYYY-MM-DD format.
fecha_fin
string
required
End date of the allocation window in YYYY-MM-DD format.
moneda
string
Currency of the allocation: VES, USD, or EUR. Defaults to USD.
tasa_bcv
number
required
BCV exchange rate at the time of allocation.
monto_asignado
number
required
Total amount reserved for lending in this window.
observacion
string
Optional notes about this allocation.
Each time a TPROD is created from this allocation, the system decrements monto_disponible and increments monto_usado. You can check the current balance at any time with GET /api/negocios/control-fondos.
3

Create a TPROD loan

A TPROD records a loan disbursement to a client. The monto field is the base loan amount; the final amount collected from the client includes the commission.
curl -X POST https://your-server:7780/api/negocios/tprod \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id_banco": "banco-uuid",
    "id_cliente": "cliente-uuid",
    "monto": 10000,
    "monto_comision": 15,
    "costo_banco": 0.5,
    "moneda": "USD",
    "tasa_bcv": 36.50,
    "plazo_cantidad": 30,
    "plazo_opcion": "dias",
    "referencia": "TPROD-2026-001",
    "fecha_inicio": "2026-02-10",
    "estatus": "pendiente",
    "garantia": "Pagaré notariado",
    "responsable_id": "empleado-uuid"
  }'
id_banco
string
required
UUID of the bank from which funds are disbursed.
id_cliente
string
required
UUID of the credit client receiving the loan.
monto
number
required
Base loan amount in the specified currency. This is the principal disbursed to the client.
monto_comision
number
required
Commission as a percentage of monto (e.g., 15 for 15%). The system calculates the total amount the client must repay as monto + (monto × monto_comision / 100).
costo_banco
number
Bank processing cost as a percentage (e.g., 0.5 for 0.5%). Optional — defaults to 0.00.
moneda
string
required
Loan currency: VES, USD, or EUR.
tasa_bcv
number
required
BCV exchange rate at the time of disbursement.
plazo_cantidad
number
required
Numeric repayment term (e.g., 30 for thirty days).
plazo_opcion
string
required
Term unit: dias (days), mes (months), or ano (years).
referencia
string
Bank transfer reference for the disbursement. Can be updated later.
fecha_inicio
string
required
Disbursement date in YYYY-MM-DD format.
estatus
string
Initial status. Defaults to pendiente.
garantia
string
Description of the guarantee backing the loan.
responsable_id
string
UUID of the employee responsible for this loan. Defaults to the authenticated user if omitted.

Fee structure

The total repayment amount a client owes is computed as:
monto_total = monto + (monto × monto_comision / 100)
The costo_banco is a separate operating cost charged by the bank for processing the transfer and does not affect the client’s repayment amount. Both are stored on the TPROD record for reporting purposes.
4

Accept TPROD records in bulk

Once guarantee documents are in order, an operator can accept one or more TPROD records in a single call. This transitions them from pendiente to aceptado and releases the funds from the bank’s available balance.The request is multipart/form-data because guarantee files can be attached alongside the JSON payload.
curl -X POST https://your-server:7780/api/bancos/tprod/aceptar-lote \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F 'ids=["tprod-uuid-1","tprod-uuid-2"]' \
  -F "garantia=@signed_guarantee.pdf"
The ids field is a JSON array of TPROD UUIDs. Guarantee files uploaded here are attached to each TPROD in the batch. Existing guarantee metadata is preserved.
5

Update a single TPROD record

To update the status or add a reference/observation to a single TPROD — for example when a repayment arrives or when moving a loan to mora (delinquency) — use:
curl -X POST https://your-server:7780/api/bancos/tprod/{id} \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "estatus": "mora",
    "observacion": "Client missed payment due 2026-03-10"
  }'

TPROD statuses

StatusMeaning
pendienteLoan created but not yet approved or disbursed.
aceptadoLoan approved and funds released to the client.
devueltoFunds returned before disbursement was finalized.
rechazadoLoan rejected — funds were never disbursed.
moraClient is delinquent — repayment is overdue.

Check available funds before lending

Before creating a TPROD, verify that the target bank has enough available balance. Use GET /api/negocios/bancos/{idBanco}/disponible to retrieve the current available funds:
curl -X GET https://your-server:7780/api/negocios/bancos/{idBanco}/disponible \
  -H "Authorization: Bearer YOUR_TOKEN"
To check only the funds reserved through Control de Fondos (excluding general TCOL balance):
curl -X GET https://your-server:7780/api/negocios/bancos/{idBanco}/disponible-control \
  -H "Authorization: Bearer YOUR_TOKEN"
Creating a TPROD against a bank with insufficient available funds will not be automatically blocked by the API — the available balance check is a manual step. Always verify before disbursing.

Build docs developers (and LLMs) love