{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-custom-field-option-list-response-schema.json",
  "title": "CustomFieldOptionListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beel-es-companycustomfields-api-openapi.yml#/components/schemas/CustomFieldOptionListResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessResponse"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "options",
            "pagination"
          ],
          "properties": {
            "options": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/CustomFieldOption"
              }
            },
            "pagination": {
              "$ref": "#/$defs/Pagination"
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "CustomFieldOption": {
      "type": "object",
      "description": "A value of a custom field, offered when filling it in. An option belongs to one customer or, without `customer_id`, is common to every customer of the company.",
      "required": [
        "id",
        "value",
        "customer_id",
        "is_archived"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier of the option."
        },
        "value": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Text of the option, exactly as it is shown and copied onto an invoice."
        },
        "customer_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Customer the option belongs to, or `null` for an option common to every customer. It is set when the option is created and never changes."
        },
        "is_archived": {
          "type": "boolean",
          "description": "An archived option is no longer offered and is left out of listings unless `include_archived=true`. Invoices that already carry its text keep it."
        }
      }
    },
    "Pagination": {
      "type": "object",
      "required": [
        "current_page",
        "total_pages",
        "total_items",
        "items_per_page"
      ],
      "properties": {
        "current_page": {
          "type": "integer"
        },
        "total_pages": {
          "type": "integer",
          "description": "How many pages the query has. An empty collection has **one** page — the\nfirst one, empty — so the smallest value a canonical route returns is `1`.\n\nThe deprecated flat aliases (`/v1/invoices`, `/v1/customers`, …) answer `0`\nfor that same empty collection, and `has_next`/`has_previous` follow suit.\nThey were left as they were on purpose: a client that reads `total_pages == 0`\nas \"no results\" would break if it changed under it. Do not compare the two\nfamilies of routes field by field; read `total_items` if what you want to know\nis whether anything came back.\n"
        },
        "total_items": {
          "type": "integer"
        },
        "items_per_page": {
          "type": "integer"
        },
        "has_next": {
          "type": "boolean"
        },
        "has_previous": {
          "type": "boolean"
        }
      }
    },
    "ResponseMeta": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "request_id": {
          "type": "string"
        }
      }
    },
    "SuccessResponse": {
      "type": "object",
      "description": "The envelope every successful JSON response of the BeeL. API is wrapped in. There are no\nbare resources in v1 and none are planned: the payload always hangs off `data`.\n\n- A **single resource** is an object in `data`.\n- A **collection** hangs off a named key inside `data`, together with its `pagination`,\n  also inside `data` — `data: {invoices: [...], pagination: {...}}`.\n- A collection carries `pagination` unless its operation declares itself a **closed\n  catalogue**: a fixed, bounded list with nothing to page through. The declaration is\n  explicit in the operation; a missing `pagination` is never something to infer.\n- `GET /v1/accounts` pages by cursor (`data: {accounts: [...], next_cursor}`). It is a\n  documented variant of pagination, not another envelope.\n\nPutting the array straight into `data` with `pagination` as its sibling is the shape a v2\nwould adopt; v1 is not being flipped to it.\n",
      "required": [
        "success",
        "data"
      ],
      "properties": {
        "success": {
          "type": "boolean"
        },
        "data": {
          "description": "The payload. An object for a single resource; an object holding the named collection\n(and its `pagination`) for a listing. Never a bare array at this level in v1.\n"
        },
        "meta": {
          "$ref": "#/$defs/ResponseMeta"
        }
      }
    }
  }
}