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.
GET /verifactu/healthAPI Status
This endpoint returns the status of the API key.
| Status | Description |
|---|---|
200 | API status |
GET /verifactu/statusRecord status
This endpoint allows you to check the current status of a invoicing record submitted previously.
| Status | Description |
|---|---|
200 | Record status |
404 | Record not found |
500 | Server error |
POST /verifactu/statusInvoice status
This endpoint allows you to check the status of an invoice in the AEAT system.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
fecha_operacion | string | no | Invoice operation date. |
| Status | Description |
|---|---|
200 | Invoice status |
500 | Server error |
POST /verifactu/createCreate new invoice
This endpoint creates a new invoicing record.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. If no series is desired, an empty string can be sent. |
numero | string | yes | Invoice number. The concatenation of the series and number fields cannot exceed 60 characters. |
fecha_expedicion | string | yes | Invoice issue date which <span style="color: red">must be the current date</span>. |
fecha_operacion | string | no | Operation date. Can be a date prior to the current date. |
tipo_factura | string | yes | The different invoice types are: <ol style="list-style: disc;"> <li>F1: Invoice (Art. |
descripcion | string | yes | Operation description. |
lineas | array | yes | Invoice lines. Accepts up to a maximum of 12 lines, a restriction imposed by the Tax Agency API. |
importe_total | string | yes | Total invoice amount. |
nif | string | no | Recipient's NIF (tax ID). |
id_otro | object | no | Identifier for an individual or legal entity other than the NIF. |
nombre | string | no | Full name or company name of the recipient. |
validar_destinatario | boolean | no | If 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_rectificativa | string | no | Required and allowed only for corrective invoices (R1, R2, R3, R4, R5). |
importe_rectificativa | object | no | Required and allowed only if `tipo_rectificativa` equals `S`. |
facturas_rectificadas | array | no | Corrected invoices. Allowed (though not mandatory) for corrective invoices (R1, R2, R3, R4, R5). |
facturas_sustituidas | array | no | Replaced invoices. Allowed (though not mandatory) for `F3` type invoices. |
incidencia | string | no | Incident indicator. The value `S` must be set if an incident has occurred. |
especial | object | no | Additional data for invoices. |
| Status | Description |
|---|---|
200 | Invoicing record created. |
400 | Error in the request data. |
500 | Server error |
POST /verifactu/create_bulkCreate invoices in bulk
This endpoint creates up to 50 new invoicing records.
| Status | Description |
|---|---|
200 | Invoicing records created. |
400 | Error in the request data. |
500 | Server error |
PUT /verifactu/modifyAmend 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).
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. If no series is desired, an empty string can be sent. |
numero | string | yes | Invoice number. The concatenation of the series and number fields cannot exceed 60 characters. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
rechazo_previo | string | no | This field indicates whether the invoice to be amended was previously rejected by the AEAT. |
tipo_factura | string | yes | The different invoice types are: <ol style="list-style: disc;"> <li>F1: Invoice (Art. |
descripcion | string | yes | Operation description. |
lineas | array | yes | Invoice lines. Accepts up to a maximum of 12 lines, a restriction imposed by the Tax Agency API. |
importe_total | string | yes | Total invoice amount. |
fecha_operacion | string | no | Operation date. |
nif | string | no | Recipient's NIF (tax ID). |
id_otro | object | no | Identifier for an individual or legal entity other than the NIF. |
nombre | string | no | Full name or company name of the recipient. |
validar_destinatario | boolean | no | If 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_rectificativa | string | no | Required and allowed only for corrective invoices (R1, R2, R3, R4, R5). |
importe_rectificativa | object | no | Required and allowed only if `tipo_rectificativa` equals `S`. |
facturas_rectificadas | array | no | Corrected invoices. Allowed (though not mandatory) for corrective invoices (R1, R2, R3, R4, R5). |
facturas_sustituidas | array | no | Replaced invoices. Allowed (though not mandatory) for `F3` type invoices. |
incidencia | string | no | Incident indicator. The value `S` must be set if an incident has occurred. |
especial | object | no | Additional data for invoices. |
| Status | Description |
|---|---|
200 | Invoicing record created. |
400 | Error in the request data. |
500 | Server error |
POST /verifactu/cancelCancel invoice
This endpoint allows you to cancel existing invoices.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. If no series is desired, an empty string can be sent. |
numero | string | yes | Invoice number. The concatenation of the series and number fields cannot exceed 60 characters. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
rechazo_previo | string | no | This field indicates whether the invoice to be cancelled was previously rejected by the AEAT. |
sin_registro_previo | string | no | This field indicates whether the invoice to be cancelled exists in the AEAT. |
incidencia | string | no | Incident indicator. The value `S` must be set if an incident has occurred. |
| Status | Description |
|---|---|
200 | Invoice cancelled |
500 | Server error |
POST /verifactu/listList invoices
This endpoint allows you to query all invoices submitted to the AEAT.
| Field | Type | Required | Description |
|---|---|---|---|
ejercicio | string | yes | Fiscal year of the operation date or, failing that, the issue date. |
periodo | string | yes | Period of the operation date or, failing that, the issue date. |
serie | string | no | Invoice series. Required if `numero` is included. |
numero | string | no | Invoice number. Required if `serie` is included. |
rango_fecha_expedicion | object | no | Issue date range of the invoices to be queried. |
fecha_expedicion | string | no | Issue date of the invoices to be queried. |
paginacion | object | no | If 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. |
| Status | Description |
|---|---|
200 | Invoice list |
POST /verifactu/exportExport XMLs
This endpoint allows you to export the XML files in batches, both request and response, of invoices submitted to the AEAT.
| Field | Type | Required | Description |
|---|---|---|---|
ejercicio | string | yes | Fiscal year of the date when the invoicing record was generated. |
periodo | string | yes | Period of the date when the invoicing record was generated. |
token | string | no | Pagination token. |
| Status | Description |
|---|---|
200 | List of XML files. |
POST /verifactu/downloadXMLDownload XML
This endpoint allows you to download the XML files of invoices submitted to the AEAT.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
| Status | Description |
|---|---|
200 | XML files |
500 | Server error |
GET /verifactu/declaracionResponsible declaration
This endpoint allows you to obtain the responsible declaration from Verifacti.
| Status | Description |
|---|---|
200 | Responsible declaration |