{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quickbooks/json-schema/quickbooks-categoryrequest-schema.json",
  "title": "categoryrequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quickbooks-item-api-openapi.yml#/components/schemas/categoryrequest",
  "type": "object",
  "properties": {
    "SubItem": {
      "type": "boolean",
      "description": "true--The object is a sub-category.\nfalse--The object is a top-level category (default).\nSub-categories can be nested to a maximum depth of three levels below a top-level category. Required for sub-category.",
      "x-intuit-required": "Conditionally required",
      "x-intuit-default": "<span class=\"literal\">false</span>"
    },
    "Type": {
      "type": "string",
      "description": "Must be set to the literal string, Category.",
      "x-intuit-required": "Required"
    },
    "Name": {
      "type": "string",
      "description": "Name of the category.",
      "x-intuit-required": "Required"
    },
    "ParentRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "The immediate parent of the sub item in the hierarchical Category:Sub-category list. If SubItem is true, then ParenRef is required. Query the Item name list resource to determine the appropriate object for this reference. Use Item.Id and Item.Name from that object for ParentRef.value and ParentRef.name, respectively.",
      "x-intuit-required": "Conditionally required"
    }
  },
  "required": [
    "Name",
    "Type"
  ],
  "$defs": {
    "referencetype": {
      "type": "object",
      "title": "referencetype",
      "properties": {
        "name": {
          "type": "string",
          "description": "An identifying name for the object being referenced by value and is derived from the field that holds the common name of that object. This varies by context and specific type of object referenced. For example, references to a Customer object use Customer.DisplayName to populate this field. Optionally returned in responses, implementation dependent.",
          "x-intuit-required": "Optional"
        },
        "value": {
          "type": "string",
          "description": "The ID for the referenced object as found in the Id field of the object payload. The context is set by the type of reference and is specific to the QuickBooks company file.",
          "x-intuit-required": "Required"
        }
      },
      "required": [
        "value"
      ]
    }
  }
}