{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-custom-field-option-response-schema.json",
  "title": "CustomFieldOptionResponse",
  "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/CustomFieldOptionResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessResponse"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/$defs/CustomFieldOption"
        }
      }
    }
  ],
  "$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."
        }
      }
    },
    "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"
        }
      }
    }
  }
}