SII API documentation

  Here you will find the technical documentation for our API to submit the issued-invoices book to the Agencia Estatal de Administración Tributaria (AEAT) in accordance with the Suministro Inmediato de Información (SII, immediate supply of information).

Other

GET /sii/health

API status

Returns the API key status: use it to check that the API is up and which NIF, environment and tax authority it belongs to.

Responses

StatusDescription
200API status
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.

GET /sii/status

Record status

Returns the status of a record (registration, modification or cancellation) from the <code>uuid</code> returned when it was created.

Responses

StatusDescription
200Record status
400The uuid is missing.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.
404There is no record with that uuid for this NIF.

POST /sii/create

Create new invoice

Creates the registration record (A0) of an issued invoice in the issued-invoices book.

Request body

FieldTypeRequiredDescription
ejerciciostringyesYear of the tax period in which the invoice is reported (4 digits).
periodostringyesTax period: a month (01 to 12) or, for quarterly filers, a quarter (1T to 4T).
seriestringyesInvoice series. May be empty.
numerostringyesInvoice number.
numero_finstringnoOnly in summary entries (F4), and required there: number of the last invoice of the range, in the same series.
fecha_expedicionstringyesIssue date. It cannot be later than today or earlier than 20 years ago.
tipo_facturastringyesInvoice type:<ul style="list-style: disc;"><li>F1: full invoice</li><li>F2: simplified invoice</li><li>F3: invoice replacing simplified invoices</li><li>F4: summary entry of invoices</li><li>R1: corrective (error founded in law and art.
tipo_rectificativastringnoRequired in corrective invoices (R1 to R5), and only there: S by substitution, I by differences.
facturas_rectificadasarraynoInvoices being corrected.
facturas_sustituidasarraynoSimplified invoices that this invoice replaces.
importe_rectificativaobjectnoAmounts of the corrected invoice.
fecha_operacionstringnoTransaction date, if different from the issue date.
clave_regimenarrayyesSpecial regime or relevance keys of the invoice, 1 to 3: the first one is the main key.
importe_totalstringnoInvoice total amount.
base_imponible_a_costestringnoTaxable base at cost.
descripcionstringyesDescription of the transaction (up to 500 characters).
importe_transmision_inmuebles_sujeto_ivastringnoAmount of the transfer of real estate subject to VAT.
inmueblesarraynoRented properties, 1 to 15.
nombrestringnoName or company name of the counterparty.
nifstringnoSpanish NIF of the counterparty.
id_otroobjectnoIdentification of a counterparty without a Spanish NIF.
nif_representantestringnoNIF of the counterparty's representative, if any.
validar_destinatariobooleannoIf you send <code>nif</code>, by default we check that the counterparty is in the AEAT census, and with <code>id_otro</code> of type 02 that the VAT number is in the VIES census, because otherwise the AEAT rejects the invoice.
especialobjectnoSpecial-case flags.
desgloseobjectyesInvoice breakdown, with the SII's structure.

Responses

StatusDescription
200Valid invoice, queued
400Error in the request data.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.
500Server error. The record is not created; retry later.

POST /sii/create_bulk

Create invoices in bulk

This endpoint creates up to 500 registration records (A0) in a single call.

Responses

StatusDescription
200Valid invoices, queued
400Error in the request data: the body is not an array, it has more than 500 invoices or an invoice has an error.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.
500Server error. The record is not created; retry later.

PUT /sii/modify

Modify invoice

Creates a modification record (A1), which replaces the whole record the AEAT holds for the invoice.

Request body

FieldTypeRequiredDescription
ejerciciostringyesYear of the tax period in which the invoice is reported (4 digits).
periodostringyesTax period: a month (01 to 12) or, for quarterly filers, a quarter (1T to 4T).
seriestringyesInvoice series. May be empty.
numerostringyesInvoice number.
numero_finstringnoOnly in summary entries (F4), and required there: number of the last invoice of the range, in the same series.
fecha_expedicionstringyesIssue date. It cannot be later than today or earlier than 20 years ago.
tipo_facturastringyesInvoice type:<ul style="list-style: disc;"><li>F1: full invoice</li><li>F2: simplified invoice</li><li>F3: invoice replacing simplified invoices</li><li>F4: summary entry of invoices</li><li>R1: corrective (error founded in law and art.
tipo_rectificativastringnoRequired in corrective invoices (R1 to R5), and only there: S by substitution, I by differences.
facturas_rectificadasarraynoInvoices being corrected.
facturas_sustituidasarraynoSimplified invoices that this invoice replaces.
importe_rectificativaobjectnoAmounts of the corrected invoice.
fecha_operacionstringnoTransaction date, if different from the issue date.
clave_regimenarrayyesSpecial regime or relevance keys of the invoice, 1 to 3: the first one is the main key.
importe_totalstringnoInvoice total amount.
base_imponible_a_costestringnoTaxable base at cost.
descripcionstringyesDescription of the transaction (up to 500 characters).
importe_transmision_inmuebles_sujeto_ivastringnoAmount of the transfer of real estate subject to VAT.
inmueblesarraynoRented properties, 1 to 15.
nombrestringnoName or company name of the counterparty.
nifstringnoSpanish NIF of the counterparty.
id_otroobjectnoIdentification of a counterparty without a Spanish NIF.
nif_representantestringnoNIF of the counterparty's representative, if any.
validar_destinatariobooleannoIf you send <code>nif</code>, by default we check that the counterparty is in the AEAT census, and with <code>id_otro</code> of type 02 that the VAT number is in the VIES census, because otherwise the AEAT rejects the invoice.
especialobjectnoSpecial-case flags.
desgloseobjectyesInvoice breakdown, with the SII's structure.

Responses

StatusDescription
200Valid modification, queued
400Error in the request data.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.
500Server error. The record is not created; retry later.

POST /sii/cancel

Cancel invoice

Cancels an invoice the AEAT has registered, through an SII cancellation (baja) record.

Request body

FieldTypeRequiredDescription
ejerciciostringyesYear of the tax period of the original record (or of its last modification).
periodostringyesTax period of the original record (or of its last modification).
seriestringyesInvoice series. May be empty.
numerostringyesInvoice number. In a summary entry (F4), the first one of the range.
fecha_expedicionstringyesIssue date of the invoice.

Responses

StatusDescription
200Valid cancellation, queued
400Error in the request data.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.
500Server error. The record is not created; retry later.

POST /sii/list

List invoices

Queries the AEAT for the book's invoices of a tax period and returns those sent from this Verifacti NIF.

Request body

FieldTypeRequiredDescription
ejerciciostringyesYear of the tax period in which the invoice is reported (4 digits).
periodostringyesTax period: 01 to 12 or 1T to 4T.
tokenstringnoToken of the previous page, to ask for the next one.

Responses

StatusDescription
200Invoices of the period
400Error in the request data.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.
502The AEAT query could not be completed.

POST /sii/export

Export XMLs

Returns signed URLs to download the XMLs sent to the AEAT in a month of submission (each submission with its response, <code>_req.xml</code> and <code>_res.xml</code>).

Request body

FieldTypeRequiredDescription
ejerciciostringyesYear of submission.
periodostringyesMonth of submission, 1 to 12.
tokenstringnoToken of the previous page.

Responses

StatusDescription
200Download URLs
400ejercicio or periodo is missing, or periodo is not a month.
401Missing or invalid API key.
403The NIF linked to the API key is deactivated.