{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ometria/json-schema/ometria-custom-field-list-response-schema.json",
  "title": "CustomFieldListResponse",
  "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/CustomFieldListResponse",
  "properties": {
    "fields": {
      "items": {
        "$ref": "#/$defs/CustomFieldResponse"
      },
      "type": "array",
      "title": "Fields",
      "description": "The list of paginated objects."
    },
    "offset": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Offset",
      "description": "The offset value applied for pagination."
    },
    "page_size": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Page Size",
      "description": "The actual number of objects in the current page."
    },
    "total_count": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Total Count",
      "description": "The total number of objects for the account."
    },
    "limit": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Limit",
      "description": "The limit number of custom fields allowed"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "fields",
    "offset",
    "page_size",
    "total_count",
    "limit"
  ],
  "$defs": {
    "CustomFieldCategory": {
      "type": "string",
      "enum": [
        "contact",
        "order"
      ],
      "title": "CustomFieldCategory"
    },
    "CustomFieldResponse": {
      "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"
        },
        "status": {
          "$ref": "#/$defs/CustomFieldStatus",
          "description": "The status of the custom field"
        },
        "date_created": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            }
          ],
          "title": "Date Created",
          "description": "The date the custom field was created"
        },
        "created_by": {
          "anyOf": [
            {
              "type": "integer"
            }
          ],
          "title": "Created By",
          "description": "The user who created the custom field"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "category",
        "type",
        "title",
        "status",
        "date_created",
        "created_by"
      ],
      "title": "CustomFieldResponse"
    },
    "CustomFieldStatus": {
      "type": "string",
      "enum": [
        "active",
        "archived"
      ],
      "title": "CustomFieldStatus"
    },
    "CustomFieldType": {
      "type": "string",
      "enum": [
        "string",
        "integer",
        "decimal",
        "date",
        "blob",
        "list of string",
        "list of product ids"
      ],
      "title": "CustomFieldType"
    }
  }
}