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 contracts and documents endpoints cover the full lifecycle of legal paperwork for credit clients: generating a pre-filled PDF, creating a contract record linked to a product (TPROD), uploading a signed copy, and downloading or deleting stored files. A parallel set of endpoints handles client vinculos (legal links). A final pair of endpoints manages multi-document uploads for credit client records, supporting both multipart/form-data and raw PDF body. All endpoints require a valid JWT bearer token.

Generate contract PDF

GET /api/rrhh/contrato/pdf Generates and streams a pre-filled contract PDF for a given contract record. The response body is the raw PDF binary; callers should save it with a .pdf extension.
id_contrato
string
required
UUID of the contract to render as PDF.
curl -X GET "https://api.marbes.org/api/rrhh/contrato/pdf?id_contrato=contrato-uuid-001" \
  -H "Authorization: Bearer {token}" \
  --output contrato.pdf
The response uses the following headers when successful:
HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="contrato-{id}-{timestamp}.pdf"
Cache-Controlno-cache, no-store, must-revalidate
400
{
  "success": false,
  "message": "El parámetro id_contrato es requerido"
}
500
{
  "success": false,
  "message": "Error al generar el PDF del contrato"
}

Create client contract

POST /api/rrhh/contrato/new Creates a new contract record linked to a product (TPROD). The contract starts in pendiente status until a signed PDF is uploaded.
contrato_id
string
required
ID of the TPROD (product) this contract is linked to.
tipo_contrato
string
required
Contract party type. Accepted values: persona_natural, empresa.
version_contrato
string
required
Version identifier for the contract template (e.g., "2024-v1").
monto_maximo
number
required
Maximum credit amount covered by this contract.
moneda
string
required
Currency code (e.g., "USD", "VES").
plazo_meses
number
required
Term in months.
tasa_interes
number
required
Interest rate (as a decimal, e.g., 0.12 for 12%).
tasa_moratoria
number
required
Late-payment penalty rate (as a decimal).
fecha_firma
string
required
Signing date in ISO 8601 format (YYYY-MM-DD).
fecha_vencimiento
string
required
Expiration date in ISO 8601 format (YYYY-MM-DD).
plazo_maximo_desembolso
number
Maximum disbursement period in days.
representante_nombre
string
Legal representative name (required for empresa contracts).
representante_cedula
string
Legal representative ID.
representante_cargo
string
Legal representative title.
empresa_razon_social
string
Company legal name.
empresa_rif
string
Company tax ID.
empresa_registro_mercantil
string
Commercial registry reference.
empresa_circunscripcion
string
Commercial registry jurisdiction.
tipo_garantia
string
Guarantee type description.
descripcion_garantias
string
Full description of the guarantee.
email_notificaciones
string
Email address for contract notifications.
telefono_notificaciones
string
Phone number for contract notifications.
direccion_notificaciones
string
Physical address for contract notifications.
curl -X POST "https://api.marbes.org/api/rrhh/contrato/new" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "contrato_id": "tprod-uuid-001",
    "tipo_contrato": "persona_natural",
    "version_contrato": "2024-v1",
    "monto_maximo": 50000,
    "moneda": "USD",
    "plazo_meses": 24,
    "tasa_interes": 0.12,
    "tasa_moratoria": 0.03,
    "fecha_firma": "2024-05-06",
    "fecha_vencimiento": "2026-05-06"
  }'
201
{
  "success": true,
  "message": "Contrato creado exitosamente",
  "data": {
    "id": "cliente-contrato-uuid-001",
    "contrato_id": "tprod-uuid-001",
    "tipo_contrato": "persona_natural",
    "estatus": "pendiente",
    "created_at": "2024-05-06T12:00:00Z"
  }
}
400
{
  "success": false,
  "message": "El TPROD tprod-uuid-001 no existe"
}

Upload signed contract PDF

POST /api/rrhh/contrato/cliente/:id Uploads a signed PDF for an existing contract and moves it from pendiente to aprobado status. Only PDF files are accepted. Send the file as multipart/form-data.
id
string
required
UUID of the contract (TPROD ID).
file
file
required
The signed PDF file. Field name: file. Must be application/pdf.
curl -X POST "https://api.marbes.org/api/rrhh/contrato/cliente/tprod-uuid-001" \
  -H "Authorization: Bearer {token}" \
  -F "file=@/path/to/contrato_firmado.pdf"
200
{
  "success": true,
  "message": "PDF del contrato cargado y aprobado",
  "data": {
    "id": "cliente-contrato-uuid-001",
    "estatus": "aprobado",
    "pdf_path": "contratos/tprod-uuid-001/contrato_firmado.pdf",
    "aprobado_por": "editor-uuid-001",
    "updated_at": "2024-05-06T14:30:00Z"
  }
}
400
{
  "success": false,
  "message": "Solo se permiten archivos PDF"
}

Delete pending contract

DELETE /api/rrhh/contrato/cliente/:id Deletes a contract that is still in pendiente status. Contracts that have already been approved cannot be deleted through this endpoint.
id
string
required
UUID of the contract to delete.
curl -X DELETE "https://api.marbes.org/api/rrhh/contrato/cliente/tprod-uuid-001" \
  -H "Authorization: Bearer {token}"
200
{
  "success": true,
  "message": "Contrato eliminado exitosamente"
}
400
{
  "success": false,
  "message": "Solo se pueden eliminar contratos en estado pendiente"
}

Download signed contract PDF

GET /api/rrhh/contrato/cliente/:id/download Streams the signed PDF binary for a contract. The response body is the raw PDF.
id
string
required
UUID of the contract to download.
curl -X GET "https://api.marbes.org/api/rrhh/contrato/cliente/tprod-uuid-001/download" \
  -H "Authorization: Bearer {token}" \
  --output contrato_firmado.pdf
404
{
  "success": false,
  "message": "El contrato no tiene un PDF firmado"
}

Create client vinculo

POST /api/rrhh/vinculo/new Creates a new vinculo (legal link) record for a credit client. Structure mirrors the contract payload but uses cliente_id instead of contrato_id.
cliente_id
string
required
UUID of the credit client this vinculo belongs to.
tipo_contrato
string
required
Party type. Accepted values: persona_natural, empresa.
version_contrato
string
required
Template version identifier.
monto_maximo
number
required
Maximum amount covered.
moneda
string
required
Currency code.
plazo_meses
number
required
Term in months.
tasa_interes
number
required
Interest rate (decimal).
tasa_moratoria
number
required
Late-payment rate (decimal).
fecha_firma
string
required
Signing date (YYYY-MM-DD).
fecha_vencimiento
string
required
Expiration date (YYYY-MM-DD).
representante_nombre
string
Legal representative name.
representante_cedula
string
Legal representative ID.
representante_cargo
string
Legal representative title.
empresa_razon_social
string
Company legal name.
empresa_rif
string
Company tax ID.
tipo_garantia
string
Guarantee type.
descripcion_garantias
string
Guarantee description.
email_notificaciones
string
Notification email.
telefono_notificaciones
string
Notification phone.
direccion_notificaciones
string
Notification address.
curl -X POST "https://api.marbes.org/api/rrhh/vinculo/new" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "cliente_id": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
    "tipo_contrato": "persona_natural",
    "version_contrato": "2024-v1",
    "monto_maximo": 30000,
    "moneda": "USD",
    "plazo_meses": 12,
    "tasa_interes": 0.10,
    "tasa_moratoria": 0.02,
    "fecha_firma": "2024-05-06",
    "fecha_vencimiento": "2025-05-06"
  }'
201
{
  "success": true,
  "data": {
    "id": "vinculo-uuid-001",
    "cliente_id": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
    "estatus": "pendiente",
    "created_at": "2024-05-06T12:00:00Z"
  }
}

Upload signed vinculo PDF

POST /api/rrhh/vinculo/cliente/:id Uploads a signed PDF for a vinculo. Accepts multipart/form-data. Only PDF files are accepted.
id
string
required
UUID of the client the vinculo belongs to.
file
file
required
Signed PDF file (application/pdf). Must be the first file in the multipart payload.
curl -X POST "https://api.marbes.org/api/rrhh/vinculo/cliente/c1d2e3f4-a5b6-7890-cdef-123456789abc" \
  -H "Authorization: Bearer {token}" \
  -F "file=@/path/to/vinculo_firmado.pdf"
200
{
  "success": true,
  "message": "PDF del vínculo cargado exitosamente",
  "data": {
    "id": "vinculo-uuid-001",
    "estatus": "aprobado",
    "pdf_path": "vinculos/c1d2e3f4/vinculo_firmado.pdf",
    "updated_at": "2024-05-06T15:00:00Z"
  }
}
400
{
  "success": false,
  "message": "Solo se permiten archivos PDF"
}

Update vinculo status

PUT /api/rrhh/vinculo/cliente/:id/estatus Updates the status of a client vinculo.
id
string
required
UUID of the client the vinculo belongs to.
estatus
string
required
New status. Accepted values: activo, finalizado, cancelado, pendiente, revision.
curl -X PUT "https://api.marbes.org/api/rrhh/vinculo/cliente/c1d2e3f4-a5b6-7890-cdef-123456789abc/estatus" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"estatus": "activo"}'
200
{
  "success": true,
  "message": "Estatus del vínculo actualizado",
  "data": {
    "id": "vinculo-uuid-001",
    "estatus": "activo",
    "updated_at": "2024-05-06T16:00:00Z"
  }
}
400
{
  "success": false,
  "message": "El estatus debe ser uno de: activo, finalizado, cancelado, pendiente, revision"
}

Download vinculo PDF

GET /api/rrhh/vinculo/cliente/:id/download Streams the signed vinculo PDF binary.
id
string
required
UUID of the client the vinculo belongs to.
curl -X GET "https://api.marbes.org/api/rrhh/vinculo/cliente/c1d2e3f4-a5b6-7890-cdef-123456789abc/download" \
  -H "Authorization: Bearer {token}" \
  --output vinculo.pdf
404
{
  "success": false,
  "message": "El vínculo no tiene un PDF firmado"
}

Upload client credit documents

POST /api/rrhh/clientes-creditos/:id/documentos Uploads one or more documents for a credit client. This endpoint is designed to integrate with n8n automation flows and supports two content-type modes.
This endpoint accepts two mutually exclusive body formats. Send either a raw PDF binary or a multipart/form-data payload — not both. If the request body is a raw PDF (Content-Type: application/pdf), the entire body is treated as a single document. If the request is multipart/form-data, files must be attached under the field name data.
id
string
required
UUID of the credit client to attach documents to.
Content-Type
string
Set to application/pdf when sending a raw PDF body. Omit (or set to multipart/form-data) for multipart uploads.
X-Tipo-Documento
string
Document type label stored alongside the file (e.g., cedula, contrato, comprobante). Falls back to the tipo_documento body field, then defaults to "documento".
X-File-Name
string
Original filename for raw PDF uploads (e.g., cedula.pdf). Auto-generated if omitted.
data
file[]
For multipart/form-data uploads: one or more PDF files under the field name data.
curl -X POST "https://api.marbes.org/api/rrhh/clientes-creditos/c1d2e3f4-a5b6-7890-cdef-123456789abc/documentos" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/pdf" \
  -H "X-Tipo-Documento: cedula" \
  -H "X-File-Name: cedula_identidad.pdf" \
  --data-binary @/path/to/cedula.pdf
success
boolean
required
true on success.
guardados
object[]
List of successfully stored document records.
201
{
  "success": true,
  "guardados": [
    {
      "id": "doc-uuid-001",
      "id_cliente_credito": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
      "tipo_documento": "cedula",
      "filename_original": "cedula_identidad.pdf",
      "ruta_archivo": "documentos/c1d2e3f4/cedula_identidad_1714992000000.pdf",
      "mimetype": "application/pdf",
      "size_bytes": 204800,
      "created_at": "2024-05-06T12:00:00Z"
    }
  ]
}
400
{
  "success": false,
  "message": "Body requerido: PDF raw (Content-Type: application/pdf), multipart campo \"data\", o JSON/metadata con tipos de documento"
}

List client credit documents

GET /api/rrhh/clientes-creditos/:id/documentos Returns the list of all documents stored for a credit client.
id
string
required
UUID of the credit client.
curl -X GET "https://api.marbes.org/api/rrhh/clientes-creditos/c1d2e3f4-a5b6-7890-cdef-123456789abc/documentos" \
  -H "Authorization: Bearer {token}"
success
boolean
required
true on success.
total
number
Total number of documents found.
data
object[]
Array of document records.
200
{
  "success": true,
  "total": 2,
  "data": [
    {
      "id": "doc-uuid-001",
      "id_cliente_credito": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
      "tipo_documento": "cedula",
      "filename_original": "cedula_identidad.pdf",
      "ruta_archivo": "documentos/c1d2e3f4/cedula_identidad_1714992000000.pdf",
      "mimetype": "application/pdf",
      "size_bytes": 204800,
      "created_at": "2024-05-06T12:00:00Z"
    },
    {
      "id": "doc-uuid-002",
      "id_cliente_credito": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
      "tipo_documento": "comprobante",
      "filename_original": "comprobante_pago.pdf",
      "ruta_archivo": "documentos/c1d2e3f4/comprobante_pago_1714995600000.pdf",
      "mimetype": "application/pdf",
      "size_bytes": 98304,
      "created_at": "2024-05-06T13:00:00Z"
    }
  ]
}
404
{
  "success": false,
  "message": "Cliente crédito no encontrado"
}
500
{
  "success": false,
  "message": "Error al listar documentos"
}

Build docs developers (and LLMs) love