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
| Language or topic | What you learn | Type |
|---|---|---|
| PHP | Send invoices with cURL, Guzzle or Laravel, place the QR on the PDF, check the status, cancel, retry without duplicates and receive webhooks | By language |
| Python | Send invoices with requests, place the QR on the PDF with reportlab, check the status and receive webhooks with Flask | By language |
| C# and .NET | Send invoices with HttpClient, place the QR on the PDF with PDFsharp, check the status and receive webhooks with ASP.NET Core | By language |
| Java | Send invoices with java.net.http.HttpClient, place the QR on the PDF with PDFBox, check the status and receive webhooks | By language |
| Delphi | Send invoices with THTTPClient or WinHttpRequest and place the QR on the PDF with SynPDF | By language |
| Visual Basic | Send invoices from VB.NET and VB6 and place the Base64 QR on the PDF | By language |
| XML structure (invoicing record) | AEAT XSD schemas, registration and cancellation records, and what the API generates from your JSON | Technical |
| Hash and chaining | Which fields go into the hash, how it is computed with SHA-256 and how records are chained | Technical |
| Verifactu errors and how to fix them | HTTP errors, validation codes, record states and AEAT errors | Technical |
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.
In which languages can I integrate the Verifactu API?
My language is not here: what do I do?
Do I need a digital certificate?
Try the code in the test environment
Create your free account and send your first test invoice.