Saltar al contenido principal
GET

Listar facturas de venta; mis facturas, facturas emitidas, facturas pendientes de cobro, facturas por cobrar, facturas sin cobrar, facturas sin pagar; ordenar por importe (mayores, menores, más altas, más bajas, top N) o por fecha (más recientes, más antiguas)

Scope:sales:invoices.read
https://api.holded.com/api/v2/invoices

Devuelve una lista paginada de facturas de tu cuenta. Los resultados están paginados por cursor.

Parámetros

Parámetros de consulta

limitintegeropcional= 50

Número máximo de facturas a devolver por página. Por defecto 25, máximo 100

cursorstringopcional

Cursor opaco para paginación. Usa el valor devuelto en la respuesta anterior

contact_idstringopcional

Filtrar facturas por identificador de contacto

statusstringopcional

Filtrar facturas por estado de pago

"pending""completed""partial""cancelled""failed""overdue""outstanding"
start_datestring<date-time>opcional

Devolver solo facturas emitidas en esta fecha o después (RFC 3339)

end_datestring<date-time>opcional

Devolver solo facturas emitidas en esta fecha o antes (RFC 3339)

due_date_startstring<date-time>opcional

Filtrar facturas cuyo vencimiento sea en esta fecha o después. Acepta ISO 8601 o solo fecha (YYYY-MM-DD)

due_date_endstring<date-time>opcional

Filtrar facturas cuyo vencimiento sea en esta fecha o antes. Combina con status=pending para listar facturas vencidas (pon aquí la fecha de corte). Acepta ISO 8601 o solo fecha (YYYY-MM-DD)

sortstringopcional

Orden de los resultados. Antepón - para orden descendente.

"date""-date""dueDate""-dueDate""total""-total"
approval_statusstringopcional

Filtrar por estado de aprobación. Usa "draft" para borradores y "approved" para documentos aprobados

"draft""approved"
accounting_account_numintegeropcional

Filtrar facturas con al menos una línea imputada a esta cuenta contable, identificada por su código PGC numérico (p. ej. 70000000). Solo se acepta el código numérico; un valor no numérico devuelve 400. Al usarse a través del asistente de IA, el nombre de la cuenta se resuelve automáticamente a su código antes de llegar al endpoint

Petición

python
import requests

url = "https://api.holded.com/api/v2/invoices?limit=50&cursor=value&contact_id=value"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respuestas

Respuesta

json
{
  "items": [
    {
      "id": "507f1f77bcf86cd799439011",
      "document_number": "INV-0001",
      "contact_id": "507f1f77bcf86cd799439011",
      "contact_name": "Acme Corp",
      "description": "string",
      "date": "2024-01-15",
      "due_date": "2024-02-15",
      "subtotal": "100.00",
      "discount": "0",
      "total": "121.00",
      "tax": "21.00",
      "currency": "EUR",
      "status": "pending",
      "tags": [
        "string"
      ],
      "lines": [
        {
          "line_id": "...",
          "name": "...",
          "description": "...",
          "price": "...",
          "units": "...",
          "discount": "...",
          "tax": "...",
          "taxes": "...",
          "tags": "...",
          "product_id": "...",
          "variant_id": "...",
          "service_id": "...",
          "sku": "...",
          "weight": "...",
          "cost_price": "...",
          "account": "...",
          "project_id": "...",
          "retention": "...",
          "unit_type": "...",
          "supplied": "..."
        }
      ],
      "payment_method_id": "string",
      "payments_total": "0",
      "payments_pending": "121.00"
    }
  ],
  "has_more": false,
  "cursor": "string"
}

Respuestas exitosas

200Listado de facturasapplication/json
object
items[]object[]
idstring

Unique identifier of the document

document_numberstring | null

Sequential number assigned to the document

contact_idstring | null

Identifier of the contact associated with this document

contact_namestring | null

Name of the contact associated with this document

descriptionstring | null

Free-text description of the document

datestring<date> | null

Issue date of the document in ISO 8601 format

due_datestring<date> | null

Payment due date in ISO 8601 format

subtotalstring

Sum of all line amounts before tax and discounts, as a decimal string

discountstring

Total discount applied to the document, as a decimal string

totalstring

Final amount including taxes and discounts, as a decimal string

taxstring

Total tax amount, as a decimal string

currencystring

ISO 4217 currency code

statusstring

Current status of the document

Enum:failedcompletedpendingpartialcancelled
tags[]string[]

List of tags attached to the document

lines[]object[]

Line items included in the document

payment_method_idstring | null

Identifier of the default payment method for this invoice

payments_totalstring

Total amount already paid, as a decimal string

payments_pendingstring

Remaining amount to be paid, as a decimal string

has_moreboolean
cursorstring | null

Opaque cursor to pass as ?cursor= to fetch the next page. Null on the last page.

Respuestas de error

400El parámetro accounting_account_num debe ser un entero positivo (código PGC)application/json
401API key inválida o no proporcionadaapplication/json
403Permisos insuficientesapplication/json
404No existe ninguna cuenta contable con el número indicado en el tenantapplication/json
429Límite de solicitudes excedidoapplication/json