Series error codes
Every public API error code emitted by Series, with its HTTP status, its type and a page per code.
Error codes emitted by Series. Each code links to its own page with the cause and the action to take.
| Code | Type | HTTP | Description |
|---|---|---|---|
cannot_archive_last_default_series | invalid_request_error | 422 | The series is the only active one for its document type. Archiving it would leave the company with no numbering available and freeze that kind of document. |
document_type_required_for_ambiguous_code | invalid_request_error | 422 | That series code exists for more than one document type, so on its own it does not identify a single series. |
invalid_series_code | invalid_request_error | 422 | The series code is empty, too long, or carries characters that do not belong in a fiscal prefix. |
invalid_series_name | invalid_request_error | 422 | The series name is empty or exceeds the allowed length. |
invalid_series_number | invalid_request_error | 422 | The starting number is not valid: it is not a positive integer, or it falls at or below the last number already issued, which would re-issue numbers already in use. |
invalid_series_template_assignment | invalid_request_error | 422 | The PDF template assignment sent for the series is inconsistent: the selection or its version is not valid. |
invalid_series_uuid | invalid_request_error | 400 | The series identifier in the path or in the payload is not a valid UUID. |
invalid_series_year | invalid_request_error | 422 | The fiscal year is not a valid four-digit year for a numbering series. |
monthly_requires_month_segmented_format | invalid_request_error | 422 | The counter resets monthly but the numbering mask does not segment by month, so two months would start on the same correlative and produce duplicate numbers within the year. |
series_already_archived | invalid_request_error | 422 | The series was already archived, and archiving is not repeated: a second call means the client is out of sync with the real state. |
series_code_immutable_with_documents | invalid_request_error | 422 | Changing the prefix of a series that already issued documents would retroactively rewrite their fiscal identifier, while customers and AEAT hold the original number. |
series_default_kind_change | invalid_request_error | 422 | The series is the default one of its purpose (invoice_kind): the default series is per company, document type and purpose, so changing its purpose would leave that purpose without a default series. |
series_format_immutable_with_documents | invalid_request_error | 422 | The numbering mask of a series can be changed until the first document is issued: after that, the PDF and the AEAT record of the issued documents carry the number in the original format. |
series_has_documents | invalid_request_error | 422 | The series already numbered documents, so it cannot be removed: the correlative sequence has to stay auditable. |
series_immutable | invalid_request_error | 405 | A series is never deleted through the API: it keeps the documents it numbered and its code is not released. PUT and DELETE are not operations on a series. |
series_initial_number_creates_gap | invalid_request_error | 422 | The starting number jumps beyond the next natural correlative while documents already exist for the current year, and that gap in the sequence is not acceptable to AEAT. |
series_invoice_kind_invalid | invalid_request_error | 422 | The series purpose is outside the catalogue complete, simplified, corrective, simplified_corrective, or it was sent for a series that is not an invoice series. |
series_invoice_kind_locked | invalid_request_error | 422 | The purpose of a series (invoice_kind) is fixed on creation and stops being editable as soon as the series has any invoice: changing it would mix invoice types in one correlative numbering. |
series_invoice_kind_mismatch | invalid_request_error | 422 | Invoice series have a fixed purpose (invoice_kind): complete for complete invoices, simplified for simplified invoices, corrective for corrective invoices and simplified_corrective for corrective invoices of simplified invoices. An invoice is only numbered in a series of its own purpose (RD 1619/2012 arts. 6.1.a, 7.1.a and 15), and the series you chose has another one. |
series_locked_by_verifactu | invalid_request_error | 422 | At least one invoice of the series holds a billing record accepted by AEAT, which freezes the prefix, the year and the numbering base of the series. |
series_not_found | not_found_error | 404 | The identifier does not resolve to any numbering series of the authenticated company. |
series_template_access_denied | authorization_error | 403 | The credential or user does not have permission to change the PDF template of this series. |
series_template_incompatible | invalid_request_error | 422 | The template does not support the document type, the purpose (invoice_kind) or the number format of the series. |
series_template_precondition_failed | conflict_error | 412 | The ETag sent in If-Match no longer matches the series template resource, which changed after you read it. |
series_template_precondition_required | invalid_request_error | 428 | The change to the series template did not state the version or resource precondition it is based on. |
series_template_unavailable | invalid_request_error | 422 | The template is archived or otherwise not selectable for this company, so it cannot be assigned to the series. |
series_template_version_conflict | conflict_error | 409 | The PDF template assignment of the series changed after you read it. |
series_type_invalid | invalid_request_error | 422 | The document type of the series is outside the catalogue invoice, quote, delivery_note, proforma, purchase_invoice, recurring_invoice. |
series_year_locked | invalid_request_error | 422 | The series already issued documents in its current year. Moving the year would leave those documents pointing at an empty year while their taxable base sits in another. |
Related
Error codes by category
Find an error by the category that emits it.
Full reference table
All codes, HTTP statuses, types and descriptions in one reference.
Error model
Interpret the error envelope and handle errors by code.