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 credit application endpoints support a two-step workflow: a staff member generates a secure, tokenized link for a client; the client uses that link to fill and submit their credit application form (natural person or legal entity) along with supporting documents; staff then review applications and can export a CIS PDF for any submission. Submission accepts either a Bearer JWT (for staff-submitted forms) or a solicitud token (for client-submitted forms via the public link). Both authentication paths are handled by the authOrSolicitudToken middleware.
For client-facing form submissions, authentication is flexible: include either Authorization: Bearer <jwt> for staff or X-Solicitud-Token: <token> as a header, or pass token as a field in the form body. The server accepts whichever is present.

Method: POST
Path: /api/report/solicitud-credito-link
Authentication: Bearer JWT required
Creates a tokenized URL that can be sent to a client. The token embeds the client identity and has an expiry. When the client opens the link, they can submit their credit application without needing a system account.

Body parameters

cliente_id
string
required
UUID of the client record for whom the link is being generated.

Response fields

success
boolean
required
true on success.
message
string
required
"Link generado" on success.
data
object
required
Link metadata.

Examples

curl --request POST \
  --url https://api.example.com/api/report/solicitud-credito-link \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "cliente_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }'

Success response

200
{
  "success": true,
  "message": "Link generado",
  "data": {
    "url": "https://app.example.com/solicitud-credito?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expira_en": "2026-06-06T14:30:00.000Z"
  }
}

Error responses

400
{
  "success": false,
  "message": "cliente_id es requerido"
}

Method: GET
Path: /api/report/solicitud-credito/validar
Authentication: None (public endpoint)
Validates a token from a generated link and returns the associated link metadata along with pre-fill data for the form. The client-facing application should call this endpoint when the page loads to confirm the token is valid and to populate known fields.

Query parameters

token
string
required
The token value from the public link URL.

Response fields

success
boolean
required
true when the token is valid and has not expired.
data
object
required
Link and client pre-fill data.

Examples

curl --request GET \
  --url 'https://api.example.com/api/report/solicitud-credito/validar?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'

Success response

200
{
  "success": true,
  "data": {
    "id": "link-uuid-here",
    "cliente_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "expira_en": "2026-06-06T14:30:00.000Z",
    "usado": false,
    "cliente": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "nombre": "María González",
      "cedula_rif": "V-18588526"
    }
  }
}

Error responses

400
{
  "success": false,
  "message": "Token inválido o expirado"
}
400
{
  "success": false,
  "message": "token es requerido"
}

List credit applications

Method: GET
Path: /api/report/solicitud-credito
Authentication: None (currently unauthenticated; subject to change)
Returns submitted credit applications, optionally filtered by applicant type or by a specific client. At least one filter must be provided.

Query parameters

tipo_solicitante
string
Filter by applicant type. Typical values: PN (natural person), PJ (legal entity / persona jurídica).
id_cliente_credito
string
UUID of the credit client record. Returns all applications submitted for that client.

Response fields

success
boolean
required
true on success.
data
object[]
required
Array of solicitud records. Returns an empty array when no records match the filter.

Examples

curl --request GET \
  --url 'https://api.example.com/api/report/solicitud-credito?tipo_solicitante=PN'

Error responses

400
{
  "success": false,
  "message": "Se requiere al menos uno de: tipo_solicitante o id_cliente_credito"
}

Submit a credit application

Method: POST
Path: /api/report/solicitud-credito
Authentication: Bearer JWT (staff) or solicitud token (client via public link)
Content-Type: multipart/form-data
Accepts a completed credit application form for a natural person (PN) or legal entity (PJ). Supports optional document file uploads; multiple PDFs are merged into a single document automatically. The form can be submitted by a logged-in staff member using a JWT or by the client using the public link token. The public link workflow is as follows:
1

Staff generates a link

Call POST /api/report/solicitud-credito-link with the client’s cliente_id to get a tokenized URL.
2

Client opens the link

The client opens the URL in their browser. The frontend calls GET /solicitud-credito/validar?token=... to confirm validity and pre-fill known fields.
3

Client submits the form

The client fills the form and submits it via POST /api/report/solicitud-credito with the token in X-Solicitud-Token header or as a token body field.
4

Staff reviews the application

Staff list applications via GET /api/report/solicitud-credito and generate a CIS PDF via GET /api/report/solicitud-credito/:id/pdf.

Body parameters (multipart/form-data)

token
string
Solicitud link token. Required when the request does not include a Bearer JWT. Can alternatively be supplied via X-Solicitud-Token header.
tipo_solicitante
string
required
Applicant type: PN (natural person) or PJ (legal entity).
nombre
string
required
Applicant’s first name (PN) or legal name (PJ).
apellido
string
Applicant’s last name. Applicable for PN.
cedula_rif
string
required
National identity number (PN) or tax ID / RIF (PJ).
email
string
Contact email address.
telefono
string
Contact phone number.
documentos
file
One or more PDF files to attach to the application. Multiple files are merged into a single PDF. The field name may be repeated for multiple files.

Response fields

success
boolean
required
true on success.
message
string
required
"Solicitud de crédito registrada correctamente" on success.
data
object
required
The created solicitud record including its generated UUID.

Examples

curl --request POST \
  --url https://api.example.com/api/report/solicitud-credito \
  --header 'Authorization: Bearer <jwt>' \
  --form 'tipo_solicitante=PN' \
  --form 'nombre=Carlos' \
  --form 'apellido=Ramírez' \
  --form 'cedula_rif=V-18765432' \
  --form '[email protected]' \
  --form '[email protected]' \
  --form '[email protected]'

Success response

201
{
  "success": true,
  "message": "Solicitud de crédito registrada correctamente",
  "data": {
    "id": "c3d4e5f6-a7b8-9012-cdef-123456789abc",
    "tipo_solicitante": "PN",
    "nombre": "María",
    "apellido": "González",
    "cedula_rif": "V-18588526",
    "created_at": "2026-05-06T14:30:00.000Z"
  }
}

Error responses

400
{
  "success": false,
  "message": "Token inválido o expirado"
}
400
{
  "success": false,
  "message": "El tipo_solicitante es requerido"
}

Generate CIS PDF for a credit application

Method: GET
Path: /api/report/solicitud-credito/:id/pdf
Authentication: Bearer JWT required
Generates and streams a CIS (Client Information Sheet) PDF for the specified credit application. The PDF language can be controlled via the X-Contract-Language request header.

Path parameters

id
string
required
UUID of the credit application (solicitud de crédito) record.

Request headers

X-Contract-Language
string
Language for the PDF template. Accepted values: es (Spanish, default) or en (English).

Response

On success the server responds with a PDF file:
Content-Type: application/pdf
Content-Disposition: inline; filename="solicitud-cis-<id>.pdf"
The PDF is streamed inline so it renders directly in browsers that support PDF display.

Examples

curl --request GET \
  --url https://api.example.com/api/report/solicitud-credito/c3d4e5f6-a7b8-9012-cdef-123456789abc/pdf \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Contract-Language: es' \
  --output solicitud-cis.pdf

Error responses

404
{
  "success": false,
  "message": "Solicitud no encontrada"
}
500
{
  "success": false,
  "message": "Error al generar el PDF"
}

Build docs developers (and LLMs) love