Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tutosrive/factus_challenge/llms.txt

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

This endpoint retrieves the most recently created electronic invoices registered in the Factus platform. Each item in the returned array is a summary-level bill object containing the invoice number, customer identification, document type, current validation status, and payment form. No query parameters are required — the Factus API returns a default page of the latest invoices.

Endpoint

GET /factura

Request

No request body or query parameters are required. The backend attaches the Bearer token from the server environment automatically — callers do not need to include any Authorization header.

Response

200 — Success

Returns a JSON object with a data array, where each element is a bill summary object.
status
number
HTTP-like status code. Always 200 on success.
message
string
Human-readable result label. Always "OK" on success.
data
array
Array of invoice summary objects. Each element has the following fields:

409 — Conflict

Returned when the Factus API responds but with a status value that does not match the expected "OK" string — for example, if the upstream API returns an unexpected status code or payload shape.
{
  "status": 409,
  "message": "CONFLICT",
  "data": {}
}

500 — Internal Server Error

Returned when an unhandled exception occurs. Two distinct shapes are possible: Shape A — upstream call failure (from request_fact internal catch):
{
  "status": 500,
  "error": "ERROR INTERNO",
  "data": {}
}
Optional extra fields: message (Axios error message), code (Axios error code), error_name (error class name). Shape B — controller-level exception:
{
  "status": 500,
  "messaje": "Hubo un error al intentar realizar la solicitud",
  "error": {}
}
The messaje key (with a j) in Shape B is a known typo in the backend source — handle it as-is when parsing error objects. Shape A uses error as a plain string ("ERROR INTERNO"), not an object.

Example Response (200)

{
  "status": 200,
  "message": "OK",
  "data": [
    {
      "id": 9401,
      "document": {
        "code": "01",
        "name": "Factura electrónica de Venta"
      },
      "number": "SETP990008805",
      "api_client_name": "santiagoriveramarin83 @ gmail.com",
      "reference_code": "F7G5X8Y9Q9R",
      "identification": "123456789",
      "graphic_representation_name": "Tutos Rive",
      "company": "",
      "trade_name": "",
      "names": "Tutos Rive",
      "email": "[email protected]",
      "total": "50000.00",
      "status": 1,
      "errors": [],
      "send_email": 0,
      "has_claim": 0,
      "is_negotiable_instrument": 0,
      "payment_form": {
        "code": "1",
        "name": "Pago de contado"
      },
      "created_at": "23-01-2025 09:16:27 PM",
      "credit_notes": [],
      "debit_notes": []
    },
    {
      "id": 9399,
      "document": {
        "code": "01",
        "name": "Factura electrónica de Venta"
      },
      "number": "SETP990008803",
      "api_client_name": "[email protected]",
      "reference_code": "652342342",
      "identification": "123456789",
      "graphic_representation_name": "alan turing",
      "company": "",
      "trade_name": "",
      "names": "alan turing",
      "email": "[email protected]",
      "total": "6435.00",
      "status": 1,
      "errors": [
        "Regla: FAX14, Notificación: Reporta una tarifa diferente para uno de los tributos enunciados en la tabla 13.3.9",
        "Regla: FAS14, Notificación: No corresponde a un valor valido de la lista"
      ],
      "send_email": 0,
      "has_claim": 0,
      "is_negotiable_instrument": 0,
      "payment_form": {
        "code": "1",
        "name": "Pago de contado"
      },
      "created_at": "23-01-2025 08:45:54 PM",
      "credit_notes": [],
      "debit_notes": []
    }
  ]
}

Code Examples

curl -X GET http://localhost:3000/factura \
  -H "Accept: application/json"

Build docs developers (and LLMs) love