Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alvarezlautaro/BancoAlimentos/llms.txt

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

The Facturas API manages tax invoices issued for food donations processed through the Banco Alimentos system. Invoices can be created manually by providing a donation reference, date, and invoice type, or generated automatically from a confirmed donation using the /generar/{idDonacion} endpoint. All IDs in this resource are Long integers. Access to each operation is controlled by dedicated authority strings.

Base URL

/api/facturas

Endpoints

List all invoices

Authorization
string
required
Bearer token with the FACTURA_VER authority.
GET /api/facturas
Returns a JSON array of all invoices in the system. Response — 200 OK
[
  {
    "id": 1,
    "idDonacion": 42,
    "fecha": "2024-11-15",
    "tipo": "B",
    "nombreDonante": "Juan Pérez"
  }
]

Get invoice by ID

Authorization
string
required
Bearer token with the FACTURA_VER authority.
id
Long
required
Internal numeric identifier of the invoice.
GET /api/facturas/{id}
Response — 200 OK — single FacturaResponseDTO object.

Create invoice (manual)

Authorization
string
required
Bearer token with the FACTURA_CREAR authority.
POST /api/facturas
Request body — FacturaRequestDTO
idDonacion
Long
required
Internal numeric ID of the donation this invoice is issued against.
fecha
LocalDate
required
Invoice date in YYYY-MM-DD format.
tipo
TipoFactura
required
Invoice type. Must be one of the TipoFactura enum values: A, B, or C.
Response — 201 Created
{
  "id": 10,
  "idDonacion": 42,
  "fecha": "2024-11-15",
  "tipo": "B",
  "nombreDonante": "Juan Pérez"
}

Update invoice

Authorization
string
required
Bearer token with the FACTURA_ACTUALIZAR authority.
id
Long
required
Internal numeric identifier of the invoice to update.
PUT /api/facturas/{id}
Request body uses the same FacturaRequestDTO fields as Create invoice. Response — 200 OK — returns the updated FacturaResponseDTO.

Delete invoice

Authorization
string
required
Bearer token with the FACTURA_ELIMINAR authority.
id
Long
required
Internal numeric identifier of the invoice to delete.
DELETE /api/facturas/{id}
Response — 200 OK
Factura eliminada correctamente

Auto-generate invoice from donation

Authorization
string
required
Bearer token with the FACTURA_CREAR authority.
idDonacion
Long
required
Internal numeric ID of the confirmed donation from which to generate the invoice.
The donation referenced by idDonacion must not already have an associated invoice. If a factura already exists for that donation, the endpoint returns a business-rule error (422 Unprocessable Entity).
POST /api/facturas/generar/{idDonacion}
No request body is required. The system automatically sets the invoice date to today and the type to A. Response — 201 Created
{
  "id": 11,
  "idDonacion": 42,
  "fecha": "2024-11-15",
  "tipo": "A",
  "nombreDonante": "Juan Pérez"
}

Data models

FacturaRequestDTO

idDonacion
Long
required
ID of the donation this invoice is issued for. Must not be null.
fecha
LocalDate
required
Invoice date in YYYY-MM-DD format. Must not be null.
tipo
TipoFactura
required
Invoice type (A, B, or C). Must not be null.

FacturaResponseDTO

id
Long
Internal numeric identifier of the invoice, assigned by the system.
idDonacion
Long
Internal numeric ID of the associated donation.
fecha
LocalDate
Invoice date in YYYY-MM-DD format.
tipo
TipoFactura
Invoice type: A, B, or C.
nombreDonante
string
Full name of the donor, populated automatically from the donation record.

Enum: TipoFactura

ValueDescription
AInvoice type A — typically for VAT-registered entities
BInvoice type B — typically for end consumers
CInvoice type C — for exempt entities

Build docs developers (and LLMs) love