Albaranes (delivery notes) sit between quotes and invoices in Eme2App’s fulfilment workflow. They track goods or services delivered to a client before formal invoicing. An albarán moves through the statesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/eme2dev/Eme2App/llms.txt
Use this file to discover all available pages before exploring further.
editable → entregado → facturado. Once facturado, the albarán is locked and the resulting factura links back to it through albaran_linea_origen_id on each detail line — enabling drill-down from invoice to delivery. You can bill a single albarán or group-bill several albaranes from the same client into one consolidated invoice. All endpoints require a Bearer token with a valid empresa_id.
Base path: /api/albaranes
Authorization: Authorization: Bearer <token> with empresa_id embedded.
Endpoint reference
| Method | Path | Description |
|---|---|---|
| GET | /api/albaranes | List delivery notes (paginated, filterable) |
| POST | /api/albaranes | Create delivery note |
| GET | /api/albaranes/proximo-numero | Next available delivery note number |
| GET | /api/albaranes/:id | Get delivery note by ID |
| PUT | /api/albaranes/:id | Update delivery note |
| PUT | /api/albaranes/:id/estado | Update status |
| DELETE | /api/albaranes/:id | Delete delivery note |
| POST | /api/albaranes/:id/facturar | Invoice a single delivery note |
| POST | /api/albaranes/facturar-agrupado | Group-invoice multiple delivery notes |
| POST | /api/albaranes/desde-presupuesto/:presupuestoId | Create from quote |
| POST | /api/albaranes/:id/enviar-email | Send PDF by email |
GET /api/albaranes
Returns a paginated, filterable list of delivery notes for the active company. Query parameters| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
pageSize | integer | Results per page |
cliente_id | UUID | Filter by client |
estado | string | Filter by status: editable, entregado, facturado |
desde | YYYY-MM-DD | Filter from date (inclusive) |
hasta | YYYY-MM-DD | Filter to date (inclusive) |
POST /api/albaranes
Creates a new delivery note ineditable status.
Client receiving the delivery. Must belong to the active company.
Delivery note number. Must be unique within the company. Use
GET /api/albaranes/proximo-numero to get the next value.Delivery date. Defaults to today if omitted.
Optional series assignment.
Free-text delivery notes.
Array of delivery line items. At least one line is required.
GET /api/albaranes/proximo-numero
Returns the next sequential delivery note number for the active company. ResponseGET /api/albaranes/:id
Returns a single delivery note with its header and all line details.PUT /api/albaranes/:id
Full update of a delivery note. Only notes ineditable state can be modified. Line items are replaced entirely.
PUT /api/albaranes/:id/estado
Manually transitions the delivery note to a new status.Target status. Allowed values:
"editable", "entregado", "facturado".DELETE /api/albaranes/:id
Permanently deletes a delivery note. Notes infacturado state cannot be deleted. If the note was created from a presupuesto and no other albaranes remain linked to it, the presupuesto is automatically restored to borrador.
POST /api/albaranes/:id/facturar
Converts a single delivery note into a new factura. The albarán is markedfacturado upon success.
Invoice number to assign. Use
GET /api/facturas/proximo-numero to fetch the next value.Invoice date. Defaults to today.
Invoice series. Required when
usa_series = true.Payment terms for the generated invoice.
Target state of the created invoice.
"borrador" (default) or "confirmada". Passing "confirmada" also triggers vencimiento generation.POST /api/albaranes/facturar-agrupado
Group-bills multiple delivery notes belonging to the same client into a single consolidated invoice. All albaranes are markedfacturado upon success.
List of delivery note IDs to include. All must belong to the same client and must not already be in
facturado state.Invoice number. Must be unique within the company+series scope.
Invoice date. Defaults to today.
Invoice series. Required when
usa_series = true.Payment terms for the invoice.
"borrador" (default) or "confirmada". Confirming immediately generates vencimientos.| Status | mensaje |
|---|---|
| 400 | "Debes indicar al menos un albarán" |
| 400 | "Todos los albaranes deben pertenecer al mismo cliente" |
| 400 | "Algunos albaranes ya están facturados" |
| 400 | "El número de factura ya existe" |
POST /api/albaranes/desde-presupuesto/:presupuestoId
Creates a delivery note by copying all line items from an existing presupuesto. The presupuesto is markedconvertida upon success.
Path parameter
| Parameter | Description |
|---|---|
presupuestoId | UUID of the presupuesto to convert. |
The new albarán is created with
estado: "editable" and the next available albarán number. No request body is required — all content is sourced from the presupuesto.POST /api/albaranes/:id/enviar-email
Sends the delivery note PDF to a recipient email address.Recipient email address.
Base64-encoded PDF generated client-side.
Attachment filename. Defaults to
albaran-{numero}.pdf.Email subject. Defaults to
"Albarán {numero}".Plain-text email body.