Facturación y ContabilidadFacturación
Facturación y Contabilidad

Facturación

Presupuestos, facturas, perfiles de facturación, series de numeración y conceptos

curl https://app.getplea.com/api/quotes \
  -H "Authorization: Bearer TOKEN" \
  -H "x-organization-id: ORG_ID"
[
  {
    "id": "quote-uuid-1",
    "number": "P-2026/001",
    "clientId": "client-uuid-1",
    "clientName": "Elena Martínez Ruiz",
    "status": "sent",
    "total": 2500.00,
    "tax": 525.00,
    "grandTotal": 3025.00,
    "validUntil": "2026-04-07T23:59:59Z",
    "createdAt": "2026-03-07T10:00:00Z"
  }
]
curl -X POST https://app.getplea.com/api/quotes \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-organization-id: ORG_ID" \
  -d '{
    "clientId": "client-uuid-1",
    "caseId": "case-uuid-1",
    "validUntil": "2026-04-07",
    "notes": "Presupuesto para procedimiento ordinario civil"
  }'
{
  "id": "quote-uuid-new",
  "number": "P-2026/002",
  "clientId": "client-uuid-1",
  "status": "draft",
  "total": 0,
  "createdAt": "2026-03-07T12:00:00Z"
}
curl -X POST https://app.getplea.com/api/quote-items \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-organization-id: ORG_ID" \
  -d '{
    "quoteId": "quote-uuid-1",
    "description": "Honorarios abogado - procedimiento ordinario",
    "quantity": 1,
    "unitPrice": 2500.00,
    "taxRate": 21
  }'
{
  "id": "item-uuid-1",
  "quoteId": "quote-uuid-1",
  "description": "Honorarios abogado - procedimiento ordinario",
  "quantity": 1,
  "unitPrice": 2500.00,
  "taxRate": 21,
  "subtotal": 2500.00,
  "taxAmount": 525.00,
  "total": 3025.00
}
curl "https://app.getplea.com/api/invoices?status=paid&dateFrom=2026-01-01" \
  -H "Authorization: Bearer TOKEN" \
  -H "x-organization-id: ORG_ID"
[
  {
    "id": "inv-uuid-1",
    "number": "F-2026/0001",
    "clientId": "client-uuid-1",
    "clientName": "Elena Martínez Ruiz",
    "status": "paid",
    "subtotal": 2500.00,
    "taxAmount": 525.00,
    "total": 3025.00,
    "issueDate": "2026-02-01",
    "dueDate": "2026-03-01",
    "paidAt": "2026-02-25T10:00:00Z"
  }
]
curl -X POST https://app.getplea.com/api/invoices \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-organization-id: ORG_ID" \
  -d '{
    "clientId": "client-uuid-1",
    "caseId": "case-uuid-1",
    "dueDate": "2026-04-07",
    "items": [
      {
        "description": "Consulta inicial y estudio del caso",
        "quantity": 1,
        "unitPrice": 300.00,
        "taxRate": 21
      },
      {
        "description": "Redacción de demanda",
        "quantity": 1,
        "unitPrice": 1200.00,
        "taxRate": 21
      }
    ]
  }'
{
  "id": "inv-uuid-new",
  "number": "F-2026/0002",
  "clientId": "client-uuid-1",
  "status": "draft",
  "subtotal": 1500.00,
  "taxAmount": 315.00,
  "total": 1815.00,
  "issueDate": "2026-03-07",
  "dueDate": "2026-04-07",
  "createdAt": "2026-03-07T12:00:00Z"
}
curl https://app.getplea.com/api/billing-profiles \
  -H "Authorization: Bearer TOKEN" \
  -H "x-organization-id: ORG_ID"
[
  {
    "id": "bp-uuid-1",
    "name": "Bufete López & Asociados",
    "taxId": "B12345678",
    "address": "Calle Gran Vía 42, 28013 Madrid",
    "isDefault": true
  }
]
curl https://app.getplea.com/api/number-series \
  -H "Authorization: Bearer TOKEN" \
  -H "x-organization-id: ORG_ID"
[
  {
    "id": "ns-uuid-1",
    "prefix": "F-2026/",
    "currentNumber": 42,
    "type": "invoice",
    "isDefault": true
  },
  {
    "id": "ns-uuid-2",
    "prefix": "P-2026/",
    "currentNumber": 15,
    "type": "quote",
    "isDefault": true
  }
]
curl https://app.getplea.com/api/billing-concepts \
  -H "Authorization: Bearer TOKEN" \
  -H "x-organization-id: ORG_ID"
[
  {
    "id": "bc-uuid-1",
    "name": "Consulta jurídica",
    "defaultPrice": 150.00,
    "taxRate": 21
  },
  {
    "id": "bc-uuid-2",
    "name": "Redacción de contrato",
    "defaultPrice": 500.00,
    "taxRate": 21
  },
  {
    "id": "bc-uuid-3",
    "name": "Representación en juicio (por sesión)",
    "defaultPrice": 800.00,
    "taxRate": 21
  }
]
curl https://app.getplea.com/api/tax-configurations \
  -H "Authorization: Bearer TOKEN" \
  -H "x-organization-id: ORG_ID"
[
  {
    "id": "tax-uuid-1",
    "name": "IVA General",
    "rate": 21,
    "isDefault": true
  },
  {
    "id": "tax-uuid-2",
    "name": "IVA Reducido",
    "rate": 10,
    "isDefault": false
  },
  {
    "id": "tax-uuid-3",
    "name": "Exento",
    "rate": 0,
    "isDefault": false
  }
]

Endpoints completos para gestionar presupuestos (quotes), facturas (invoices), perfiles de facturación, series de numeración, conceptos y configuraciones fiscales.

Presupuestos

GET /api/quotes

Lista los presupuestos de la organización.

query
limitnumber

Máximo de resultados. Default: 50.

query
offsetnumber

Desplazamiento para paginación.


POST /api/quotes

Crea un nuevo presupuesto.

body
caseIdstring

UUID del expediente asociado.

body
validUntilstring

Fecha de validez (ISO 8601).

body
notesstring

Notas o condiciones del presupuesto.


POST /api/quote-items

Añade líneas al presupuesto.

body
quoteIdstring
Required

UUID del presupuesto.

body
descriptionstring
Required

Descripción del concepto.

body
unitPricenumber
Required

Precio unitario (sin IVA).

body
taxRatenumber

Porcentaje de IVA. Default: 21.


Facturas

GET /api/invoices

Lista las facturas.

query
statusstring

Filtrar: draft, sent, paid, overdue, cancelled.

query
clientIdstring

Filtrar por UUID del cliente.

query
dateFromstring

Desde fecha (ISO 8601).

query
dateTostring

Hasta fecha (ISO 8601).


POST /api/invoices

Crea una nueva factura.

body
caseIdstring

UUID del expediente.

body
issueDatestring

Fecha de emisión (ISO 8601). Default: hoy.

body
dueDatestring

Fecha de vencimiento (ISO 8601).

body
itemsarray

Array de conceptos con description, quantity, unitPrice, taxRate.


Configuración fiscal

GET /api/billing-profiles

Lista los perfiles de facturación (datos fiscales del despacho).


GET /api/number-series

Lista las series de numeración de facturas.


GET /api/billing-concepts

Lista los conceptos predefinidos de facturación.


GET /api/tax-configurations

Lista las configuraciones de impuestos disponibles.