---
title: "Update a series"
method: PATCH
path: "/companies/{company}/series/{series}"
tags: ["Series"]
---

# Update a series

`PATCH /companies/{company}/series/{series}`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/series/{series}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Partially updates a series; only the fields you send change.
- Fiscal guards return 422 `business_rule_violation` with a `subcode`, e.g. `series_locked_by_verifactu`.
- `code` and `number_format` lock once the series has documents; `initial_number` too after AEAT acceptance.
- `document_type` cannot change; unknown series returns 404 `series_not_found`.

## Path parameters

- `company` string, uuid, required
- `series` string, uuid, required

## Headers

- `Idempotency-Key` string
- `Factuarea-Version` string, date

## Request body

- UpdateSeriesRequest
  - `name` string: Series name (1-100 characters).
  - `code` string: Series prefix (1-10 characters: letters, digits, `-` and `_`). Editable only while the series has no documents (`series_code_immutable_with_documents`); it cannot repeat the code of another series of the same document type.
  - `counter_reset` 'never' | 'annual' | 'monthly': Counter reset policy: `never`, `annual` or `monthly` (`monthly` requires the `{MM}` token in the mask). Prospective change: numbers already issued are not renumbered.
  - `year_reset` boolean: DEPRECATED: boolean alias of `counter_reset` (`true` = `annual`, `false` = `never`). `counter_reset` wins when both are sent.
  - `number_format` string: Numbering mask (e.g. `{code}-{YYYY}-{000}`). Editable only until the first document is issued (`series_format_immutable_with_documents`).
  - `initial_number` integer: Initial counter number (>= 1). With documents in the current year it cannot leave a gap (`series_initial_number_creates_gap`).
  - `invoice_kind` 'complete' | 'simplified' | 'corrective' | 'simplified_corrective': Purpose of an invoice series: `complete`, `simplified`, `corrective` or `simplified_corrective`. Fixed once the series has invoices (`series_invoice_kind_locked`).
  - `document_type` string: Not accepted: the document type of a series cannot be changed.

## Response `200`

- object
  - `data` Series, required: A document numbering series. It can be edited with `PATCH /v1/companies/{company}/series/{series}` under the fiscal guards of the numbering (code, mask and purpose are fixed once documents exist) and it is never deleted: archive it instead.
    - `id` string, required
    - `object` 'series', required
    - `code` string, required
    - `name` string, required
    - `document_type` string, required: Document type the series numbers: `invoice`, `quote`, `delivery_note`, `proforma` or `transport_document` (transport control documents, default code `DC`, created on the first issuance).
    - `invoice_kind` 'complete' | 'simplified' | 'corrective' | 'simplified_corrective' | 'null', nullable, required: Fixed purpose of an invoice series (RD 1619/2012 arts. 6.1.a, 7.1.a and 15): `complete` (complete invoices `F1` and the `F3` that replaces simplified invoices — the usual series), `simplified` (simplified invoices `F2`), `corrective` (corrective invoices `R1`–`R4`) or `simplified_corrective` (corrective invoices of simplified invoices `R5`). An invoice can only be issued in a series of its own purpose, otherwise issuing fails with `series_invoice_kind_mismatch`. Set on creation (default `complete`), editable with `PATCH /v1/companies/{company}/series/{series}` until the series has any invoice (`series_invoice_kind_locked`) and never on the default series of its purpose (`series_default_kind_change`). `null` for series of other document types.
    - `prefix` string, required: Legacy alias for code. Use code field. Will be removed in v2.
    - `number_format` string, required: Canonical numbering mask describing how the document number is rendered: padding (the block of zeros), year token (`{YYYY}` 4 digits / `{YY}` 2 digits / omitted for no year), optional month token (`{MM}` 2 digits) and separator. Example: `{code}-{YYYY}-{000}` (default) or `{code}-{YYYY}-{00000}` for 5-digit padding. When `counter_reset` is `monthly`, the mask must include the `{MM}` token (e.g. `F-{YYYY}-{MM}-{000}`) so the rendered number stays unique across months; otherwise two months would both start at `1`. Set on creation and editable with `PATCH /v1/companies/{company}/series/{series}` until the first document is issued; fixed afterwards (`series_format_immutable_with_documents`). Mirrors Holded's `format`.
    - `next_number` integer, required: Next correlative that will be assigned on the next real emission.
    - `current_number` integer, required: Last correlative actually emitted in the current fiscal year (0 for a brand-new series).
    - `initial_number` integer, required: Number the counter starts from. Set on creation to continue an existing numbering when migrating (e.g. 235). Defaults to 1. It can be changed with `PATCH /v1/companies/{company}/series/{series}` as long as it does not open a gap after documents of the current year (`series_initial_number_creates_gap`) and no record of the series has been accepted by AEAT.
    - `counter_reset` 'never' | 'annual' | 'monthly', required: Counter reset policy (source of truth): `never` (the counter never resets), `annual` (resets on January 1st) or `monthly` (resets on the 1st of each month). `monthly` requires the `number_format` mask to include the `{MM}` token to keep rendered numbers unique across months.
    - `year_reset` boolean, required: Deprecated alias of `counter_reset`. `true` is equivalent to `counter_reset: "annual"`, `false` to `counter_reset: "never"`. Use `counter_reset` instead; this field will be removed in v2.
    - `is_default` boolean, required
    - `is_active` boolean, required
    - `created_at` string, date-time, nullable, required
    - `updated_at` string, date-time, nullable, required

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company.
- `422`: Validation failed. The `error.param` field identifies which input is invalid.
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/factuarea/apis/factuarea-public-api.md) · [All operations](https://skmtc.dev/factuarea/apis/factuarea-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/factuarea/apis/factuarea-public-api/revisions/718e77934422?raw)
