# INVOICE_NUMBER_TOO_LONG

The number ‹value› has ‹value› characters and the AEAT accepts at most ‹value›. The invoice was not issued and the number was not used: issue it with another series or, if this one has no issued invoices yet, shorten its code or format

<Callout type="info">
**Category:** [Invoices](/errors/category/invoicing)
</Callout>

| | |
|---|---|
| HTTP status | `422` Unprocessable Content |
| Retry | After fixing the cause |

## When it happens

At issue time, the generated invoice number has more than the 60 characters characters the AEAT accepts. The invoice is not issued and the number is not used.

## How to fix it

Issue it with another series, or shorten the series `code` or `format` while the series has no issued invoices, and retry.

## Retry

Not as is: the same request fails the same way. Fix the cause described above, then send the request again, under a new `Idempotency-Key` if the body changed.

## Returned by

The operations where this code is most likely. The list is not exhaustive.

- [`POST /v1/companies/{company_id}/invoices`](/invoices/createCompanyInvoice)
- [`POST /v1/companies/{company_id}/invoices/{invoice_id}/issue`](/invoices/issueCompanyInvoice)
- [`POST /v1/companies/{company_id}/invoices/{invoice_id}/corrective`](/invoices/createCompanyCorrectiveInvoice)
- [`POST /v1/companies/{company_id}/invoices/{invoice_id}/convert-to-invoice`](/proforma/convertCompanyProformaToInvoice)

## Rules that cite this code

- [NUM-008 · An invoice number fits AEAT's length and character set](/rules/numbering#num-008)

## Example response

When this error occurs, the API answers `422` Unprocessable Content with a JSON body of this shape:

```json
{
  "type": "https://docs.beel.es/errors/INVOICE_NUMBER_TOO_LONG",
  "title": "INVOICE_NUMBER_TOO_LONG",
  "detail": "The number ‹value› has ‹value› characters and the AEAT accepts at most ‹value›. The invoice was not issued and the number was not used: issue it with another series or, if this one has no issued invoices yet, shorten its code or format",
  "instance": "/v1/<resource>",
  "errors": [],
  "success": false,
  "error": {
    "code": "INVOICE_NUMBER_TOO_LONG",
    "message": "The number ‹value› has ‹value› characters and the AEAT accepts at most ‹value›. The invoice was not issued and the number was not used: issue it with another series or, if this one has no issued invoices yet, shorten its code or format",
    "details": {}
  },
  "meta": {
    "timestamp": "2026-05-21T10:00:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

The `type` URI is stable and always resolves to this page.

## Message

<Tabs items={["English", "Spanish", "Catalan"]}>
  <Tab value="English">{"The number ‹value› has ‹value› characters and the AEAT accepts at most ‹value›. The invoice was not issued and the number was not used: issue it with another series or, if this one has no issued invoices yet, shorten its code or format"}</Tab>
  <Tab value="Spanish">{"El número ‹value› tiene ‹value› caracteres y la AEAT solo admite ‹value›. La factura no se ha emitido y el número no se ha consumido: emítela con otra serie o, si esta aún no tiene facturas emitidas, acorta su código o su formato"}</Tab>
  <Tab value="Catalan">{"El número ‹value› té ‹value› caràcters i l'AEAT només n'admet ‹value›. La factura no s'ha emès i el número no s'ha consumit: emet-la amb una altra sèrie o, si aquesta encara no té factures emeses, escurça'n el codi o el format"}</Tab>
</Tabs>

Send the request with `Accept-Language: <es|en|ca>` to receive the message in your preferred language.

> Placeholders like `‹value›` are filled in at runtime with the actual values of your request.

## Other errors in this category

<div className="grid grid-cols-2 gap-3 not-prose">
  <Card title="ATTACH_SOURCE_INVOICE_UNAVAILABLE" description="A source invoice is not available (it does not exist or you no longer have access); uncheck the source invoices attachment to send without the folder" href="/errors/ATTACH_SOURCE_INVOICE_UNAVAILABLE" />
  <Card title="ATTACH_SOURCE_INVOICES_NO_SOURCES" description="The invoice has no consolidation disbursements: there are no source invoices to attach" href="/errors/ATTACH_SOURCE_INVOICES_NO_SOURCES" />
  <Card title="ATTACH_SOURCE_INVOICES_REQUIRES_PDF" description="Attaching the source invoices also requires attaching the invoice PDF" href="/errors/ATTACH_SOURCE_INVOICES_REQUIRES_PDF" />
  <Card title="ATTACH_SOURCE_PDF_MISSING" description="These source invoices have no generated PDF: ‹value›" href="/errors/ATTACH_SOURCE_PDF_MISSING" />
  <Card title="ATTACH_SOURCE_ZIP_TOO_LARGE" description="The source invoices ZIP (‹value› MB) exceeds the maximum sendable size (‹value› MB)" href="/errors/ATTACH_SOURCE_ZIP_TOO_LARGE" />
</div>

## Keep exploring

<div className="grid grid-cols-2 gap-3 not-prose">
  <Card title="All Invoices errors" description="Every code in this category in one table." href="/errors/category/invoicing" />
  <Card title="Error reference home" description="Browse every category or jump to the handling guide." href="/errors" />
</div>

---

Full OpenAPI spec: https://docs.beel.es/api/openapi