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 Venezuelan bolívar (VES) exchange rate shifts daily and comes from two sources: the Banco Central de Venezuela (BCV) official rate (oficial) and the parallel market rate (paralelo). Every financial operation in the Marbes platform that involves VES↔USD or VES↔EUR conversion uses a rate from this historical register. The /api/bancos/tasas routes provide read access to the historical series, a shortcut to the most recent rate, and write operations for both manual entry and automated synchronization from an external rate provider.
Call POST /api/bancos/tasas/sincronizar on a scheduled basis (for example, once per day via cron or a workflow automation) to keep exchange rates up to date without manual intervention. The endpoint does not require authentication, making it safe to invoke from external schedulers.

GET /api/bancos/tasas/historico

Returns a paginated and optionally filtered list of historical exchange rate records. Authentication: Required

Query parameters

fuente
string
Filter by rate source. Allowed values: oficial (official BCV rate), paralelo (parallel market rate). Omit to return records from all sources.
fecha_desde
string
ISO 8601 date string (e.g., 2024-01-01). Returns only records registered on or after this date.
fecha_hasta
string
ISO 8601 date string (e.g., 2024-12-31). Returns only records registered on or before this date.
limit
number
Maximum number of records to return. Omit for the server default.

Response

success
boolean
required
true when the request succeeds.
data
object[]
required
Array of historical rate records, ordered by fecha_registro descending.
curl --request GET \
  --url 'https://api.marbes.org/api/bancos/tasas/historico?fuente=oficial&fecha_desde=2024-01-01&limit=30' \
  --header 'Authorization: Bearer <token>'
200 Success
{
  "success": true,
  "data": [
    {
      "id": "f7a8b9c0-d1e2-3456-fabc-456789012345",
      "fuente": "oficial",
      "nombre": "BCV Oficial",
      "usd": 36.45,
      "eur": 39.80,
      "fecha_registro": "2024-06-01T00:00:00.000Z",
      "responsable": null,
      "created_at": "2024-06-01T08:15:00.000Z",
      "updated_at": "2024-06-01T08:15:00.000Z"
    },
    {
      "id": "a8b9c0d1-e2f3-4567-abcd-567890123456",
      "fuente": "paralelo",
      "nombre": "Paralelo",
      "usd": 38.10,
      "eur": null,
      "fecha_registro": "2024-06-01T00:00:00.000Z",
      "responsable": null,
      "created_at": "2024-06-01T08:15:00.000Z",
      "updated_at": "2024-06-01T08:15:00.000Z"
    }
  ]
}
500 Internal Server Error
{
  "success": false,
  "message": "Error interno del servidor"
}

GET /api/bancos/tasas/ultima

Returns the single most recently recorded exchange rate. Use this endpoint when you need the current operative rate for a transaction or display. Authentication: Required

Query parameters

fuente
string
Filter by source to get the latest rate for that specific source. Allowed values: oficial, paralelo. Omit to return the most recent record regardless of source.

Response

success
boolean
required
true when the request succeeds.
data
object
required
The most recent rate record.
# Latest official BCV rate
curl --request GET \
  --url 'https://api.marbes.org/api/bancos/tasas/ultima?fuente=oficial' \
  --header 'Authorization: Bearer <token>'
200 Success
{
  "success": true,
  "data": {
    "id": "f7a8b9c0-d1e2-3456-fabc-456789012345",
    "fuente": "oficial",
    "nombre": "BCV Oficial",
    "usd": 36.45,
    "eur": 39.80,
    "fecha_registro": "2024-06-01T00:00:00.000Z",
    "responsable": null
  }
}

POST /api/bancos/tasas/sincronizar

Fetches current exchange rates from an external rate provider and persists them to the historical register. This endpoint is designed for automated use from schedulers or CI pipelines. Authentication: Not required

Response

success
boolean
required
true when synchronization completes.
message
string
required
Human-readable summary of the synchronization result.
data
object[]
required
Array of result objects describing each rate that was synchronized.
curl --request POST \
  --url https://api.marbes.org/api/bancos/tasas/sincronizar
200 Success
{
  "success": true,
  "message": "Tasas sincronizadas exitosamente",
  "data": [
    {
      "fuente": "oficial",
      "usd": 36.45,
      "eur": 39.80,
      "status": "created"
    },
    {
      "fuente": "paralelo",
      "usd": 38.10,
      "eur": null,
      "status": "created"
    }
  ]
}
500 Internal Server Error
{
  "success": false,
  "message": "Error interno del servidor"
}

POST /api/bancos/tasas/historico

Manually inserts a historical exchange rate record. Use this endpoint when the automated synchronization cannot reach the external source, or when correcting a past rate entry. Authentication: Required

Request body

fuente
string
required
Rate source. Allowed values: oficial, paralelo.
nombre
string
required
Human-readable label for the rate entry (e.g., "BCV Oficial", "Paralelo").
usd
number
required
VES per 1 USD rate. Must be a positive number greater than 0.
eur
number
VES per 1 EUR rate. Optional.
fechaActualizacion
string
required
The date this rate was published or became effective. ISO 8601 date format: YYYY-MM-DD.

Response

success
boolean
required
true when the record is created.
data
object
required
The newly created historical rate record.
curl --request POST \
  --url https://api.marbes.org/api/bancos/tasas/historico \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "fuente": "oficial",
    "nombre": "BCV Oficial",
    "usd": 36.45,
    "eur": 39.80,
    "fechaActualizacion": "2024-06-01"
  }'
201 Created
{
  "success": true,
  "data": {
    "id": "b9c0d1e2-f3a4-5678-bcde-678901234567",
    "fuente": "oficial",
    "nombre": "BCV Oficial",
    "usd": 36.45,
    "eur": 39.80,
    "fecha_registro": "2024-06-01T00:00:00.000Z",
    "responsable": "user-uuid",
    "created_at": "2024-06-01T14:30:00.000Z",
    "updated_at": "2024-06-01T14:30:00.000Z"
  }
}
400 Bad Request — missing required fields
{
  "success": false,
  "message": "Los campos fuente, nombre y promedio son requeridos"
}
400 Bad Request — invalid fuente
{
  "success": false,
  "message": "Fuente inválida. Valores permitidos: oficial, paralelo"
}
400 Bad Request — invalid usd value
{
  "success": false,
  "message": "El promedio debe ser un número mayor a 0"
}

Build docs developers (and LLMs) love