Series

Update a series

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.
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

Path parameters

companystring uuid required

Public identifier (UUID v7) of the company. Get it from GET /v1/me (data.scope[].id).

seriesstring uuid required

Public identifier (UUID v7) of the document series.

Headers

Idempotency-Keystring
Example:01928f10-7c0e-7c4a-9b7d-2f8a6e3c1d4b

Client-generated opaque key (up to 255 characters; UUID v7 recommended) that makes retries safe: the first response is cached and replayed for repeats without re-executing the mutation. Reusing a key with a different body returns 422 idempotency_key_reused; the values of secret fields (password, secret…) count as part of the body, so retrying with a corrected secret under the same key is a different request, never the replay of the earlier answer. See the Idempotency guide.

Factuarea-Versionstring date
Example:2026-06-01

Pin the API version (YYYY-MM-DD, Stripe-style date versioning) for this request; omit to use the key's pinned version, or the latest if none. Unsupported version → 400 unsupported_api_version; malformed → 400 parameter_invalid_format. The effective version is echoed in the Factuarea-Version response header. See the Versioning guide.

Request body

namestring

Series name (1-100 characters).

codestring

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_resetboolean

DEPRECATED: boolean alias of counter_reset (true = annual, false = never). counter_reset wins when both are sent.

number_formatstring

Numbering mask (e.g. {code}-{YYYY}-{000}). Editable only until the first document is issued (series_format_immutable_with_documents).

initial_numberinteger

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_typestring

Not accepted: the document type of a series cannot be changed.

Response

Example response

{
  "data": {
    "id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a0e",
    "code": "F-2026",
    "name": "Facturas 2026",
    "document_type": "invoice",
    "invoice_kind": "complete",
    "prefix": "F-2026-",
    "number_format": "{code}-{YYYY}-{000}",
    "next_number": 46,
    "current_number": 45,
    "initial_number": 1,
    "counter_reset": "annual",
    "year_reset": true,
    "is_default": true,
    "is_active": true,
    "created_at": "2026-01-01T00:00:00Z",
    "updated_at": "2026-01-20T11:30:00Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.