Verifacti Integration
About Verifactu
Verifactu is the new anti-fraud regulation enforced by the Spanish Tax Agency (AEAT). It mandates that all billing software must guarantee that invoice records are traceable, unalterable, and secure.
Essentially, it prevents the manipulation of accounting data by requiring strict technical standards for record integrity.
Verifacti API Integration with Ecart Pay
This integration streamlines the billing process for Spanish merchants using Ecart Pay by connecting directly with Verifacti's certified API. It handles the complexities of the Verifactu system such as chaining invoice records, calculating secure fingerprints, and managing QR codes transparently in the background.
Key Capabilites
Automated Submission
Invoices are submitted to the AEAT immediately upon creation.
Compliance Metadata
Automatically appends the required QR code and VeriFactu fingerprint to your invoice documents.
Hybrid Document Generation
Provides both the official XML for fiscal purposes and a visual PDF for customers.
Multiple Format Support
Capable of issuing standard (F1), simplified (F2), and rectifying (R1-R5) invoices through a unified API endpoint.
Multi-language PDF Generation
Generate invoice PDFs in Spanish, Italian, or French based on the billing configuration, including localized currency formatting and legal disclaimers.
Passthrough Support
Flexible payload structure allows you to pass advanced fiscal fields like clave_regimen or calificacion_operacion directly to Verifacti without waiting for backend updates.
Supported Invoice Types
This integration supports all standard AEAT invoice formats dynamically via the Passthrough feature.
- F1 (Complete Invoice): Standard B2B invoice with full customer identification. (Default behavior).
- F2 (Simplified Invoice): "Ticket" style invoice for B2C or simplified scenarios.
- R1 - R5 (Rectifying Invoices): For corrections, refunds, or credit notes.
- Equivalence Surcharge Invoices: These invoices include the Recargo de Equivalencia (RE) special VAT regime for retailers.
Note: To generate specific types (e.g.,
R1), simply include thetipo_facturaand required fields (likefacturas_rectificadas) inside thebilling_informationobject. The backend will automatically pass these fields to Verifacti.
Verifacti Integration Endpoints
Beyond standard creation and cancellation, this integration exposes specific endpoints for AEAT compliance, status tracking and more.
Invoice Creation Endpoint
Billings Management Endpoints
NIFs Management Endpoints
Passthrough Example: Creating a Rectifying Invoice (R1)
To create a rectifying invoice (credit note), send the standard Ecart Pay payload but include the specific Verifacti fields inside billing_information like tipo_factura, facturas_rectificadas, serie, etc..
Endpoint: POST /api/billings?country=ES
{
"currency": "EUR",
"items": [
{
"name": "Servicio Rectificado",
"price": 1000,
"quantity": 2,
"discount": 0,
"tax": 420,
"total": 2420,
"is_service": false
}
],
"billing_information": {
"first_name": "Sergio",
"last_name": "Ramos",
"razons": "Rio Ramos SA",
"nif": "A15022510",
"address": "Dirección del cliente",
"country": "España",
"tipo_factura": "R1",
"tipo_rectificativa": "S",
"fecha_expedicion": "03-12-2025",
"fecha_operacion": "01-12-2025",
"descripcion": "Rectificacion por sustitucion en un paso",
"importe_rectificativa": {
"base_rectificada": "2000",
"cuota_rectificada": "240"
},
"facturas_rectificadas": [
{
"serie": "RECT",
"numero": "1",
"fecha_expedicion": "10-04-2025"
}
]
}
}
IMPORTANTTo follow the steps below, it is essential to have the corresponding Authorization Token. For more information, please refer to the following documentation page: Authorization Token
Verifacti API Status
This endpoint returns the status of the API key. It is mainly used to verify that the API is active and to know which NIF and environment it refers to.
Visit our API Reference to test this endpoint.
Endpoint
https://ecartpay.com/api/billings/health-checkhttps://sandbox.ecartpay.com/api/billings/health-check
Headers
Authorization:token
Examples
Request
curl --location 'https://sandbox.ecartpay.com/api/billings/health-check' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Cookie: __cf_bm=_h31xA6xIlq3DQ9SuCN8WTtHiM.AxyaFToOnwojSI8A-1765472330-1.0.1.1-qfZRCG2WOQURGq3zTm8JrKTAKME9rNoPTU__tL7TuZM1aqGPGPSHGENRAgLeukv5XtHJsYc3kUCQybOfLW810OBY_7ogYXqGRoxQwjZDrlA; lang=en'Response
{
"CODE": 337,
"MESSAGE": "Connection to billing provider is successful."
}Updated 5 months ago