Saltar a contenido

Inicio rápido

Integra tu aplicación con VeriFactu API en 5 minutos.

1. Obtén tus credenciales

curl -X POST https://api.verifactu.es/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Mi Empresa SL",
    "email": "dev@miempresa.com",
    "password": "SecurePass123!"
  }'

Respuesta:

{
  "message": "Registration successful.",
  "data": {
    "api_key": "1|abc123def456...",
    "name": "Mi Empresa SL",
    "plan": "professional",
    "monthly_quota": 5000
  }
}

Guarda tu API key

La API key solo se muestra una vez tras el registro. Si la pierdes, usa POST /auth/regenerate-key.

2. Registra un contribuyente

curl -X POST https://api.verifactu.es/api/v1/taxpayers \
  -H "Authorization: Bearer TU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "nif": "B12345678",
    "name": "Mi Empresa SL",
    "is_production": false
  }'

3. Registra un sistema informático

curl -X POST https://api.verifactu.es/api/v1/systems \
  -H "Authorization: Bearer TU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vendor_name": "Mi Software",
    "vendor_nif": "B12345678",
    "name": "ERP Principal",
    "version": "1.0.0",
    "installation_number": "001"
  }'

4. Registra tu primera factura

curl -X POST https://api.verifactu.es/api/v1/invoices \
  -H "Authorization: Bearer TU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taxpayer_id": "UUID_DEL_CONTRIBUYENTE",
    "computer_system_id": "UUID_DEL_SISTEMA",
    "invoice_number": "F-2026-001",
    "invoice_date": "2026-03-13",
    "invoice_type": "F1",
    "description": "Servicios de consultoría",
    "breakdown": [{
      "tax_type": "01",
      "regime_type": "01",
      "operation_type": "S1",
      "base_amount": 1000.00,
      "tax_rate": 21.00,
      "tax_amount": 210.00
    }],
    "total_amount": 1210.00,
    "total_tax_amount": 210.00
  }'

Respuesta:

{
  "message": "Invoice registered successfully.",
  "data": {
    "id": "uuid-de-la-factura",
    "invoice_number": "F-2026-001",
    "hash": "abc123...",
    "qr_url": "https://prewww2.aeat.es/wlpl/TIKE-CONT/ValidarQR?...",
    "aeat_status": "queued",
    "record_type": "registration"
  }
}

5. Verifica el estado

curl https://api.verifactu.es/api/v1/invoices/UUID/status \
  -H "Authorization: Bearer TU_API_KEY"
graph LR
    A[pending] --> B[queued]
    B --> C[sent]
    C --> D[accepted]
    C --> E["accepted_with_warnings"]
    C --> F[rejected]
    B --> G[error]

Próximos pasos