{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-upsert-custom-field-request-schema.json",
  "title": "UpsertCustomFieldRequest",
  "description": "The state of the custom field. `label` and `show_on_pdf` are always replaced. `suggest_values` and `is_archived`, when omitted, keep their current value (a new field is created with `suggest_values: true` and active), so repeating a request never undoes a change someone made to them.",
  "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/UpsertCustomFieldRequest",
  "type": "object",
  "required": [
    "label",
    "show_on_pdf"
  ],
  "properties": {
    "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "Name people see next to the value. Leading and trailing spaces are removed; a label that is empty after that answers `422`."
    },
    "show_on_pdf": {
      "type": "boolean",
      "description": "Whether the PDF of invoices saved from now on prints this field."
    },
    "suggest_values": {
      "type": "boolean",
      "description": "`true` offers the values already used as options and adds new ones as invoices are saved; `false` stores each value as sent and creates no options. Omit it to keep the current setting; a new field starts with `true`. Turning it off deletes no option."
    },
    "is_archived": {
      "type": "boolean",
      "description": "`true` archives the field, `false` reactivates it. Omit it to keep the current state."
    }
  }
}