Verifactu API Documentation

  Here you will find the technical documentation for our API to submit invoices to the Agencia Estatal de Administración Tributaria (AEAT) in accordance with the Verifactu system.

Other

GET /verifactu/health

API Status

This endpoint returns the status of the API key.

Responses

StatusDescription
200API status

GET /verifactu/status

Record status

This endpoint allows you to check the current status of a invoicing record submitted previously.

Responses

StatusDescription
200Record status
404Record not found
500Server error

POST /verifactu/status

Invoice status

This endpoint allows you to check the status of an invoice in the AEAT system.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series.
numerostringyesInvoice number.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.
fecha_operacionstringnoInvoice operation date.

Responses

StatusDescription
200Invoice status
500Server error

POST /verifactu/create

Create new invoice

This endpoint creates a new invoicing record.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series. If no series is desired, an empty string can be sent.
numerostringyesInvoice number. The concatenation of the series and number fields cannot exceed 60 characters.
fecha_expedicionstringyesInvoice issue date which <span style="color: red">must be the current date</span>.
fecha_operacionstringnoOperation date. Can be a date prior to the current date.
tipo_facturastringyesThe different invoice types are: <ol style="list-style: disc;"> <li>F1: Invoice (Art.
descripcionstringyesOperation description.
lineasarrayyesInvoice lines. Accepts up to a maximum of 12 lines, a restriction imposed by the Tax Agency API.
importe_totalstringyesTotal invoice amount.
nifstringnoRecipient's NIF (tax ID).
id_otroobjectnoIdentifier for an individual or legal entity other than the NIF.
nombrestringnoFull name or company name of the recipient.
validar_destinatariobooleannoIf the `nif` field is included, we validate by default that it is registered with the AEAT, since if it is not, the AEAT will reject the submission.
tipo_rectificativastringnoRequired and allowed only for corrective invoices (R1, R2, R3, R4, R5).
importe_rectificativaobjectnoRequired and allowed only if `tipo_rectificativa` equals `S`.
facturas_rectificadasarraynoCorrected invoices. Allowed (though not mandatory) for corrective invoices (R1, R2, R3, R4, R5).
facturas_sustituidasarraynoReplaced invoices. Allowed (though not mandatory) for `F3` type invoices.
incidenciastringnoIncident indicator. The value `S` must be set if an incident has occurred.
especialobjectnoAdditional data for invoices.

Responses

StatusDescription
200Invoicing record created.
400Error in the request data.
500Server error

POST /verifactu/create_bulk

Create invoices in bulk

This endpoint creates up to 50 new invoicing records.

Responses

StatusDescription
200Invoicing records created.
400Error in the request data.
500Server error

PUT /verifactu/modify

Amend invoice

This endpoint allows you to submit a invoicing record to modify or amend an existing invoice when the issuance of a corrective invoice is not required (or another mechanism provided for in the Invoicing Regulation).

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series. If no series is desired, an empty string can be sent.
numerostringyesInvoice number. The concatenation of the series and number fields cannot exceed 60 characters.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.
rechazo_previostringnoThis field indicates whether the invoice to be amended was previously rejected by the AEAT.
tipo_facturastringyesThe different invoice types are: <ol style="list-style: disc;"> <li>F1: Invoice (Art.
descripcionstringyesOperation description.
lineasarrayyesInvoice lines. Accepts up to a maximum of 12 lines, a restriction imposed by the Tax Agency API.
importe_totalstringyesTotal invoice amount.
fecha_operacionstringnoOperation date.
nifstringnoRecipient's NIF (tax ID).
id_otroobjectnoIdentifier for an individual or legal entity other than the NIF.
nombrestringnoFull name or company name of the recipient.
validar_destinatariobooleannoIf the `nif` field is included, we validate by default that it is registered with the AEAT, since if it is not, the AEAT will reject the submission.
tipo_rectificativastringnoRequired and allowed only for corrective invoices (R1, R2, R3, R4, R5).
importe_rectificativaobjectnoRequired and allowed only if `tipo_rectificativa` equals `S`.
facturas_rectificadasarraynoCorrected invoices. Allowed (though not mandatory) for corrective invoices (R1, R2, R3, R4, R5).
facturas_sustituidasarraynoReplaced invoices. Allowed (though not mandatory) for `F3` type invoices.
incidenciastringnoIncident indicator. The value `S` must be set if an incident has occurred.
especialobjectnoAdditional data for invoices.

Responses

StatusDescription
200Invoicing record created.
400Error in the request data.
500Server error

POST /verifactu/cancel

Cancel invoice

This endpoint allows you to cancel existing invoices.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series. If no series is desired, an empty string can be sent.
numerostringyesInvoice number. The concatenation of the series and number fields cannot exceed 60 characters.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.
rechazo_previostringnoThis field indicates whether the invoice to be cancelled was previously rejected by the AEAT.
sin_registro_previostringnoThis field indicates whether the invoice to be cancelled exists in the AEAT.
incidenciastringnoIncident indicator. The value `S` must be set if an incident has occurred.

Responses

StatusDescription
200Invoice cancelled
500Server error

POST /verifactu/list

List invoices

This endpoint allows you to query all invoices submitted to the AEAT.

Request body

FieldTypeRequiredDescription
ejerciciostringyesFiscal year of the operation date or, failing that, the issue date.
periodostringyesPeriod of the operation date or, failing that, the issue date.
seriestringnoInvoice series. Required if `numero` is included.
numerostringnoInvoice number. Required if `serie` is included.
rango_fecha_expedicionobjectnoIssue date range of the invoices to be queried.
fecha_expedicionstringnoIssue date of the invoices to be queried.
paginacionobjectnoIf the number of invoices to query exceeds 10,000 records, the data from the last queried invoice must be included to obtain the next page.

Responses

StatusDescription
200Invoice list

POST /verifactu/export

Export XMLs

This endpoint allows you to export the XML files in batches, both request and response, of invoices submitted to the AEAT.

Request body

FieldTypeRequiredDescription
ejerciciostringyesFiscal year of the date when the invoicing record was generated.
periodostringyesPeriod of the date when the invoicing record was generated.
tokenstringnoPagination token.

Responses

StatusDescription
200List of XML files.

POST /verifactu/downloadXML

Download XML

This endpoint allows you to download the XML files of invoices submitted to the AEAT.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series.
numerostringyesInvoice number.

Responses

StatusDescription
200XML files
500Server error

GET /verifactu/declaracion

Responsible declaration

This endpoint allows you to obtain the responsible declaration from Verifacti.

Responses

StatusDescription
200Responsible declaration