Examples of sending invoices to the SII with the API

Here are 27 examples of sending issued invoices to the SII, one per invoice type or key (full, simplified, corrective, intra-EU, exports, exempt, IGIC or IPSI, summary entries, rentals, VAT groups, modification and cancellation), with the JSON request to the Verifacti SII API ready to copy.

SII invoice types and keys

Issued-invoice examples for the SII by invoice type or key
CaseInvoice type or keyWhen to use it
Full invoiceF1 · clave 01Ordinary invoice to a customer with a Spanish NIF.
Simplified invoiceF2 · clave 01Receipts and simplified invoices, with no recipient details.
Several VAT ratesF1 · S1 con varios tiposInvoice with lines at 21%, 10% and 4%.
Intra-EU B2B goodsF1 · entrega exenta E5Sale of goods to a business in another Member State.
Intra-EU B2B servicesF1 · prestacion_servicios no sujetaService to a business in another Member State.
Intra-EU B2C below the thresholdF1 · entrega S1Distance sale to a consumer in another Member State while EU-wide distance sales and TBE services stay under €10,000 a year.
Intra-EU B2C with OSSF1 · clave 17Sale to a consumer in another Member State declared through the One-Stop Shop (OSS).
Export of goodsF1 · clave 02 · exenta E2Sale of goods to a customer outside the EU.
Services outside the EUF1 · prestacion_servicios no sujetaService to a customer in a non-EU country.
Exempt invoiceF1 · exenta E1Subject and exempt operation, such as those under art. 20 LIVA.
Operation not subject to VATF1 · no sujetaOperation outside the scope of VAT.
IGIC or IPSIF1 · clave 08Operations located in the Canary Islands, Ceuta or Melilla that are subject to IGIC or IPSI rather than VAT (for example, services deemed supplied there). Shipments of goods from the mainland to those territories are exports: key 02 and exempt E2.
Credit noteF1 con importes negativosA new invoice with a negative amount that does not correct another invoice. Returns and later discounts on an invoice already issued go in an R1 corrective invoice.
Exchange invoiceF3 · facturas_sustituidasWhen the customer asks for a full invoice instead of the receipt.
Corrective invoicesR1–R5Correcting an invoice already issued.
↳ By replacementR1 · tipo_rectificativa SThe corrective invoice fully replaces the original one.
↳ By differencesR1 · tipo_rectificativa IOnly the difference in amounts is corrected.
Equivalence surchargeF1 · S1 con recargoSale to a retailer under the equivalence surcharge scheme.
Issued by third parties or recipientespecial.emitida_por_tercero_o_destinatario SThird-party invoicing or self-billing.
REBUF1 · clave 03Sale of second-hand goods, works of art, antiques or collectors’ items.
Reverse chargeF1 · S2Operations where the customer is the taxable person.
Summary entryF4 · numero_finMany receipts from the same day, numbered consecutively.
Cash accountingF1 · clave 07Whoever applies the special cash accounting scheme.
Business premises rentalF1 · clave 12 · inmueblesRental of business premises.
Group of entitiesF1 · clave 06 · base_imponible_a_costeOperations between entities of a VAT group at advanced level.
ModificationA1Correcting an invoice that is Correcto, Aceptado con errores or Duplicado.
Cancellation—Removing an invoice registered in the SII.

What an SII example looks like

Each case comes with the JSON request to the SII API, with tabs for cURL, Python, JavaScript, Node.js, PHP, Go, Java, C# and VB6. Dates, ejercicio and periodo are already today’s: copy it and try it with the test API key of the SII test NIF, which you request from soporte@verifacti.com with your free account.

New records are sent with POST /sii/create. An invoice the AEAT has already registered is corrected with PUT /sii/modify and cancelled with POST /sii/cancel.

The SII API sends the record book of issued invoices: all the examples are issued invoices.

Questions about the examples

FAQ SII

Which book does the SII API send?

The issued-invoices record book, and only that one. The SII API does not send received invoices or the other SII books. Which books exist and who keeps them is in SII record books.

Can I test the SII without sending real data?

Yes. The free account includes the SII test environment; you request the SII test NIF from soporte@verifacti.com. There are requests ready to copy in the SII examples.

How do I get the AEAT’s response?

Through a webhook or by checking the status. When the AEAT replies, Verifacti updates the record’s status: you receive it in your webhooks or check it with GET /sii/status. The possible statuses (Correcto, Aceptado con errores, Incorrecto…) are in the documentation.

How do I modify or cancel a record?

With PUT /sii/modify to modify a record (for example, one Aceptado con errores) and with POST /sii/cancel to cancel it. If the AEAT rejected it (Incorrecto), it was not registered: fix the data and send it again with /sii/create. Examples in modification and cancellation.

Try the examples in the test environment

Create your free account, ask soporte@verifacti.com for an SII test NIF and send any of these requests with its test API key.

Test environment and test NIF includedRead the documentation