Issue a simplified invoice (ticket)
Ce contenu n’est pas encore disponible dans votre langue.
A simplified invoice (ticket) is a lightweight sales document typically delivered as a PDF. There is no universal XML standard for tickets, so for integrations the recommended approach is to work with JSON and let B2Brouter generate the PDF.
Use "type": "IssuedSimplifiedInvoice" to create a simplified invoice.
When a simplified invoice can be issued in Spain
Section titled “When a simplified invoice can be issued in Spain”In Spain, the Invoicing Regulation (Royal Decree 1619/2012) allows a simplified invoice instead of a full invoice in these cases:
- When the amount of the transaction does not exceed €400 (VAT included).
- When the amount does not exceed €3,000 (VAT included) in certain activities, such as retail, hospitality and restaurants, or passenger transport.
- For corrective invoices.
A simplified invoice must include at least: number and series, issue date, the issuer’s tax ID (NIF) and name, a description of the goods or services, the tax rate (or the mention “VAT included”) and the total amount. If the recipient is a business that wants to deduct the VAT, the invoice must also show their tax ID and address, and the VAT amount separately.
For other countries, see the relevant guide; for example, Italy has the Fattura Semplificata.
Create the simplified invoice
Section titled “Create the simplified invoice”Example request
curl --request POST \ --url https://api-staging.b2brouter.net/accounts/{ACCOUNT_ID}/invoices \ --header 'X-B2B-API-Key: {YOUR_API_KEY}' \ --header 'X-B2B-API-Version: {YOUR_API_VERSION}' \ --header 'Content-Type: application/json' \ --data '{ "send_after_import": false, "invoice": { "type": "IssuedSimplifiedInvoice", "number": "T-2026-0001", "date": "2026-01-21", "currency": "EUR", "file_reference": "POS-ORDER-12345", "contact": { "name": "Final consumer", "country": "es" }, "invoice_lines_attributes": [ { "quantity": 1, "price": 10, "description": "Coffee", "taxes_attributes": [ { "name": "VAT", "percent": 21, "category": "S" } ] } ] } }'Sample response (excerpt)
{ "invoice": { "id": 123456, "type": "IssuedSimplifiedInvoice", "number": "T-2026-0001", "state": "new", "file_reference": "POS-ORDER-12345", "document_type_code": "pdf.invoice" }}Send the simplified invoice (generate the PDF)
Section titled “Send the simplified invoice (generate the PDF)”curl --request POST \ --url https://api-staging.b2brouter.net/invoices/send_invoice/{INVOICE_ID} \ --header 'X-B2B-API-Key: {YOUR_API_KEY}' \ --header 'X-B2B-API-Version: {YOUR_API_VERSION}'Download the PDF
Section titled “Download the PDF”curl --request GET \ --url 'https://api-staging.b2brouter.net/invoices/{INVOICE_ID}/as/pdf.invoice?download=true' \ --header 'X-B2B-API-Key: {YOUR_API_KEY}' \ --header 'X-B2B-API-Version: {YOUR_API_VERSION}'- Use
file_referenceto store your own internal reference (order ID, ticket ID, POS transaction ID, etc.) and make reconciliation easier. - If you want B2Brouter to send the PDF by email, set
contact_email_overrideon the invoice before creating the invoice or callingPOST /invoices/send_invoice/{INVOICE_ID}. - To list simplified invoices:
GET /accounts/{ACCOUNT_ID}/invoices?type=IssuedSimplifiedInvoice