> ## Documentation Index
> Fetch the complete documentation index at: https://www.finseed.es/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a number series

> Deletes a number series that no invoice or integration references. A series that has issued invoices, or that an integration is configured to use, cannot be deleted and the request fails with `number_series_in_use`.



## OpenAPI

````yaml /api-reference/openapi.json delete /v1/number_series/{id}
openapi: 3.1.0
info:
  title: Finseed API
  version: 1.0.0
  description: >-
    REST API for programmatic Verifactu invoicing. Every request is sent over
    HTTPS and authenticated with an API key passed as a bearer token. Each key
    is scoped to a single environment (test or live). Payloads are JSON with
    snake_case fields: amounts are integer minor units (cents) and timestamps
    are RFC 3339 in UTC. List endpoints are cursor-paginated. Errors return a
    small application/json envelope with a stable, machine-readable `code`.
servers:
  - url: https://api.finseed.es
security:
  - bearerAuth: []
paths:
  /v1/number_series/{id}:
    delete:
      tags:
        - Number Series
      summary: Delete a number series
      description: >-
        Deletes a number series that no invoice or integration references. A
        series that has issued invoices, or that an integration is configured to
        use, cannot be deleted and the request fails with
        `number_series_in_use`.
      operationId: deleteNumberSeries
      parameters:
        - name: id
          in: path
          required: true
          description: Opaque number series identifier — the `id` from a list row.
          schema:
            type: string
      responses:
        '200':
          description: Confirmation that the number series was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NumberSeriesDeleted'
        '401':
          description: >-
            Authentication failed: the API key is missing, malformed, or
            revoked. Send a valid key as a bearer token in the `Authorization`
            header. Each key is bound to a single environment (test or live).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                code: unauthorized
                detail: >-
                  Authentication failed. Send your API key as a bearer token in
                  the `Authorization` header. Keys are scoped to one
                  environment, so a test key cannot read live data and vice
                  versa.
                errors: []
                doc_url: https://www.finseed.es/docs/api-reference/errors#unauthorized
        '404':
          description: >-
            No number series matches the supplied identifier in the environment
            the API key belongs to. A number series created with a live key is
            not visible to a test key, and vice versa.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                code: number_series_not_found
                detail: >-
                  No number series matches that identifier in this environment.
                  Note that test and live keys see different number series.
                errors: []
                doc_url: >-
                  https://www.finseed.es/docs/api-reference/errors#number_series_not_found
        '409':
          description: >-
            The number series cannot be deleted because invoices have been
            issued on it or an integration is configured to use it. A series is
            immutable once created (there is no update endpoint), so the way to
            change numbering is to create a new series and issue future invoices
            on it. A series referenced by an integration can be deleted after
            the integration is pointed elsewhere.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                code: number_series_in_use
                detail: >-
                  This number series cannot be deleted because invoices or
                  integrations reference it. A series is immutable once created:
                  to change how invoices are numbered, create a new series and
                  issue on that one instead.
                errors: []
                doc_url: >-
                  https://www.finseed.es/docs/api-reference/errors#number_series_in_use
        '500':
          description: >-
            An unexpected error occurred on our side. No partial work is
            persisted, so the request can be retried safely.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                code: internal_error
                detail: >-
                  Something went wrong on our side. The request did not complete
                  and can be retried safely.
                errors: []
                doc_url: >-
                  https://www.finseed.es/docs/api-reference/errors#internal_error
components:
  schemas:
    NumberSeriesDeleted:
      type: object
      properties:
        id:
          type: string
          description: The identifier of the deleted number series.
          example: ns_clx123abc456
        deleted:
          type: boolean
          const: true
          description: 'Always true: confirms the series no longer exists.'
          example: true
      required:
        - id
        - deleted
      additionalProperties: false
      description: Confirmation that a number series was deleted.
      example:
        id: ns_clx123abc456
        deleted: true
    ErrorEnvelope:
      type: object
      properties:
        code:
          type: string
          description: >-
            Stable, machine-readable error code. The branch key. This is an
            extensible enum: new values may be added in the future, so clients
            must tolerate values not listed here. Known values: invalid_request,
            unauthorized, invoice_not_found, download_link_expired,
            number_series_not_found, number_series_prefix_taken,
            number_series_in_use, customer_not_found, customer_ambiguous,
            idempotency_conflict, rate_limited, invalid_number_series,
            invalid_tax_rate, invalid_tax_data, invalid_tax_id,
            tax_id_type_country_mismatch, insufficient_recipient_data,
            simplified_amount_exceeded, simplified_incompatible_tax_type,
            invalid_recargo_equivalencia, aeat_mandate_not_approved,
            no_active_subscription, tax_id_validation_unavailable,
            invalid_rectifies_reference, rectified_invoice_not_found,
            invoice_already_voided, invoice_already_replaced,
            invoice_not_family_tip, invoice_pending_at_aeat,
            invoice_not_rectifiable_at_aeat, family_balance_below_zero,
            replacement_total_negative, reason_incompatible_with_recipient,
            recipient_overrides_not_allowed_for_differences,
            rectifying_series_invalid, external_reference_invalid,
            external_reference_matches_existing_invoice,
            rectified_amounts_required_for_substitution,
            line_item_without_tax_items, internal_error.
          example: invalid_request
        detail:
          type: string
          description: Human-readable, context-specific explanation.
          example: The query parameters are not valid.
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                description: Location of the offending value (JSON path).
                example: limit
              code:
                type: string
                description: Machine-readable validation issue code.
                example: too_big
              message:
                type: string
                description: Human-readable explanation of the field-level issue.
                example: Number must be less than or equal to 100
            required:
              - field
              - code
              - message
            additionalProperties: false
          description: >-
            Field-level issues. Always present; empty unless this is a
            validation failure.
        doc_url:
          type: string
          description: Link to the reference documentation for this error code.
          example: https://www.finseed.es/docs/api-reference/errors#invalid_request
      required:
        - code
        - detail
        - errors
        - doc_url
      additionalProperties: false
      description: >-
        Uniform error body returned for every non-2xx response
        (application/json).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key sent as a bearer token in the `Authorization` header.

````