{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ometria/json-schema/ometria-custom-field-create-schema.json",
  "title": "CustomFieldCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ometria-custom-fields-api-openapi.yml#/components/schemas/CustomFieldCreate",
  "properties": {
    "id": {
      "type": "string",
      "maxLength": 64,
      "pattern": "^\\S+$",
      "title": "Id",
      "description": "The identifier of the custom field"
    },
    "category": {
      "$ref": "#/$defs/CustomFieldCategory",
      "description": "The category of the custom field"
    },
    "type": {
      "$ref": "#/$defs/CustomFieldType",
      "description": "The type of the custom field. The 'date' type can only be used with the 'contact' category."
    },
    "title": {
      "type": "string",
      "maxLength": 64,
      "title": "Title",
      "description": "The title of the custom field"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "id",
    "category",
    "type",
    "title"
  ],
  "$defs": {
    "CustomFieldCategory": {
      "type": "string",
      "enum": [
        "contact",
        "order"
      ],
      "title": "CustomFieldCategory"
    },
    "CustomFieldType": {
      "type": "string",
      "enum": [
        "string",
        "integer",
        "decimal",
        "date",
        "blob",
        "list of string",
        "list of product ids"
      ],
      "title": "CustomFieldType"
    }
  }
}