Verifactu API tutorials

Tutorials to integrate the Verifactu API with code: sending invoices from PHP, Python, C# and .NET, Java, Delphi and Visual Basic, and three technical guides to the XML structure, the hash and chaining, and the errors. The code works against the test environment of the free account.

Tutorials by language and technical guides

Verifactu API tutorials
Language or topicWhat you learnType
PHPSend invoices with cURL, Guzzle or Laravel, place the QR on the PDF, check the status, cancel, retry without duplicates and receive webhooksBy language
PythonSend invoices with requests, place the QR on the PDF with reportlab, check the status and receive webhooks with FlaskBy language
C# and .NETSend invoices with HttpClient, place the QR on the PDF with PDFsharp, check the status and receive webhooks with ASP.NET CoreBy language
JavaSend invoices with java.net.http.HttpClient, place the QR on the PDF with PDFBox, check the status and receive webhooksBy language
DelphiSend invoices with THTTPClient or WinHttpRequest and place the QR on the PDF with SynPDFBy language
Visual BasicSend invoices from VB.NET and VB6 and place the Base64 QR on the PDFBy language
XML structure (invoicing record)AEAT XSD schemas, registration and cancellation records, and what the API generates from your JSONTechnical
Hash and chainingWhich fields go into the hash, how it is computed with SHA-256 and how records are chainedTechnical
Verifactu errors and how to fix themHTTP errors, validation codes, record states and AEAT errorsTechnical

How these tutorials are made

They all use the same REST API with JSON: POST /verifactu/create to create the invoice, with the API key in the Authorization header. The code is meant to be copied and tried against the test environment. The technical tutorials explain what the API solves for you: the XML, the hash and the errors.

If your language is not here, any HTTP client works: the Verifactu API documentation has examples of every call in cURL, Python, JavaScript, Node.js, PHP, Go, Java, C# and VB6.

Verifactu API resources

The documentation (endpoint reference), the quick start guide (first steps with the free account), the Verifactu examples (one case per invoice type), the OpenAPI specification and the llms.txt for your AI.

Test environment and test NIF included

In which languages can I integrate the Verifactu API?

In any language that can make an HTTP request with JSON. Here you have tutorials for six: PHP, Python, C#, Java, Delphi and Visual Basic.

My language is not here: what do I do?

Use the Verifactu API documentation: it has examples of every call in nine languages, including cURL, JavaScript, Node.js and Go.

Do I need a digital certificate?

Not with the Verifactu API. Verifacti is a colaborador social of the AEAT and sends with its own certificate, once the representation form is signed.

Try the code in the test environment

Create your free account and send your first test invoice.

Test environment and test NIF includedRead the documentationQuick start guide