Skip to main content

nodda-client (Python)

Cliente oficial de la API de Nodda para emitir y consultar facturas VERI*FACTU de la Agencia Tributaria (AEAT) desde tu propio programa (ERP, tienda online, TPV…).

Nodda se encarga de la firma con tu certificado, del XML, de la cadena de huellas y del envío a la AEAT: tú solo mandas los datos de la factura en JSON.

Instalación

pip install nodda-client

Requisitos: Python 3.8 o superior. Sin dependencias (solo la librería estándar).

Antes de empezar

  1. Crea tu cuenta en el portal de Nodda y da de alta tu empresa (NIF y certificado digital).
  2. Genera tu clave API en el portal → API keys.
  3. Usa la dirección del entorno con su clave:
Entorno Dirección Uso
Pruebas https://sandbox.nodda.es Envía al entorno de pruebas de la AEAT, sin validez fiscal
Producción https://api.nodda.es Facturas reales

La clave de pruebas no sirve en producción, ni al revés.

Uso

import os
from nodda_client import NoddaClient

nodda = NoddaClient("https://sandbox.nodda.es", os.environ["NODDA_API_KEY"])

r = nodda.crear_factura({
    "series": "2026", "issueDate": "2026-11-03", "invoiceType": "F1",
    "description": "Servicios de consultoría", "taxRegimeKey": "01", "operationQualification": "S1",
    "taxBase": "100.00", "taxRate": "21", "taxAmount": "21.00", "totalAmount": "121.00",
    "recipients": [{"nif": "B12345674", "name": "Cliente Demo SL"}],
})
# r["status"] == "queued": la API responde al momento; la AEAT, unos segundos después.

estado = nodda.consultar_estado(r["id"])  # queued, sent, accepted_with_errors o permanently_failed

Si tu clave da acceso a varias empresas (NIF), indica cuál en el parámetro nif de cada método. Puedes asociar la factura a un centro de coste enviando costCenterId en los datos.

Métodos

Método Endpoint
crear_factura(datos, nif=None) POST /v1/invoices
consultar_estado(id, nif=None) GET /v1/invoices/{id}
listar_facturas(filtros=None, nif=None) GET /v1/invoices
cancelar_factura(id, datos=None, nif=None) POST /v1/invoices/{id}/cancel
reintentar_factura(id, tipo=None, nif=None) POST /v1/invoices/{id}/retry
obtener_url_qr(id) / obtener_imagen_qr(id) GET /v1/invoices/{id}/qr
estado_sistema(nif=None) GET /v1/status
obtener_perfil() GET /v1/client
configurar_webhook(url, nif=None) / quitar_webhook(nif=None) PUT / DELETE /v1/webhooks
NoddaClient.verificar_firma_webhook(cuerpo, firma, secreto) Comprueba la firma de un aviso

Avisos (webhooks)

En lugar de consultar el estado de cada factura, Nodda puede avisar a tu servidor cuando la AEAT responde. Configura la URL con configurar_webhook(url) (la respuesta trae el secreto una sola vez: guárdalo) y, en tu endpoint, comprueba la firma antes de confiar en el aviso:

# cuerpo: bytes tal cual llegan; firma: cabecera X-Nodda-Signature
if not NoddaClient.verificar_firma_webhook(cuerpo, firma, os.environ["NODDA_WEBHOOK_SECRET"]):
    return 401

El cuerpo trae id (número de factura), status (sent, accepted_with_errors o permanently_failed), razon, eventId y los datos del acuse de la AEAT. Responde con un código 2xx; si no, Nodda lo reintenta.

Errores

Si la API responde con un error, se lanza NoddaApiException con el código HTTP y un código estable (por ejemplo invalid_request, business_rule_violation, certificate_not_configured). Si no hubo respuesta (fallo de red), se lanza NoddaException: puedes reintentar la misma petición.

Documentación

Guía completa, campos de cada petición y códigos de error: https://app.nodda.es/developers/introduccion Referencia OpenAPI: https://api.nodda.es/openapi.json

Soporte: soporte@nodda.es

Licencia

MIT

Metadata

Release files for nodda-client 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nodda-client 1.2.0
File Size Uploaded Provenance Actions
nodda_client-1.2.0.tar.gz 12.3 kB Without provenance Details for nodda_client-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nodda-client 1.2.0
File Interpreter ABI Platform Actions
nodda_client-1.2.0-py3-none-any.whl Python 3 none any Details for nodda_client-1.2.0-py3-none-any.whl

Total release size: 22.0 kB

Release files / nodda_client-1.2.0.tar.gz

Download URL nodda_client-1.2.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
95d1eaf2e5b7f7844fe811c444217c0884d296d458218c96a81159f60a28d646
BLAKE2b-256 checksum
How to use checksums
cd7037bf181907fe9e3a0d4ff5c526ff225f67d38b67a392558688698ac7890e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / nodda_client-1.2.0-py3-none-any.whl

Download URL nodda_client-1.2.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31f4cc09683bde8d449d6f189ac7f811cca74e9321703a5cb315842e41221368
BLAKE2b-256 checksum
How to use checksums
d58b6ed3edac139f64e613171069b0158a80fe39c08ef81a61a8eb35491fc36a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Security for nodda-client 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page