Skip to content

Category ​

Type: schema

TypeScript Definition ​

typescript
Category: {{
            id?: $Read<string>;
            name?: string;
            description?: string | null;
            /** @default true */
            active: boolean;
            parent_category_id?: string | null;
            product_count?: $Read<number>;
            /** Format: date-time */
            created_at?: $Read<string>;
            /** Format: date-time */
            modified_at?: $Read<string>;
            /** @default false */
            auto_assign_products: boolean;
            /** @description Direct child categories. */
            child_categories?: components["schemas"]["ChildCategory"][];
            slug?: string;
            assign_products_condition?: components["schemas"]["CategoryAssignmentCondition"] | null;
        };
        /** CategoryAssignmentCondition */
}

Component References ​

ReferenceResolves To
components["schemas"]["ChildCategory"]ChildCategory
components["schemas"]["CategoryAssignmentCondition"]CategoryAssignmentCondition

OpenAPI Schema ​

json
{
  "title": "Category",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "maxLength": 128
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "active": {
      "type": "boolean",
      "default": true
    },
    "parent_category_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "product_count": {
      "type": "integer",
      "readOnly": true
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "modified_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "auto_assign_products": {
      "type": "boolean",
      "default": false
    },
    "child_categories": {
      "description": "Direct child categories.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ChildCategory"
      }
    },
    "slug": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^(?!-)([0-9a-zA-Z\\s-]+)(?<!-)$"
    },
    "assign_products_condition": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/CategoryAssignmentCondition"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: