Sanal AI
  1. Data Structures
Sanal AI
  • Introduction
    • ๐Ÿš€ Sanal AI - Encore Data
    • ๐Ÿ› ๏ธ Getting Started
    • ๐Ÿค The Approach / Model
  • Data Structures
    • ๐Ÿ“ Data Layout
    • ๐Ÿช Merchants
    • ๐Ÿ“‚ Categories
    • ๐Ÿท๏ธ Items
    • ๐Ÿ›’ Products
    • ๐Ÿ“ฆ Inventory
    • ๐Ÿ‘ค Customers
    • ๐Ÿงพ Orders
    • ๐Ÿงพ Variants & Combinations
  • API Requirements
    • ๐Ÿ”Œ API Requirements
    • API: `syncMerchants`
    • API: `syncCategories`
    • API: `syncItems`
    • API: `syncProducts`
    • API: `syncInventory`
    • API: `syncCustomers`
    • API: `syncOrders`
  1. Data Structures

๐Ÿ“‚ Categories

This object represents a single category or sub-category used to classify Items. It uses a parent_id to create a hierarchical tree structure.

Fields#

NameTypeDescription
idstringThe unique identifier for the category.
namestringThe display name of the category.
descriptionstringOptional. A brief description of the category's contents.
parent_idstringThe id of the parent category. null for top-level categories.
is_activebooleanA flag to enable or disable the category.
updated_atstringThe timestamp of the last modification (ISO 8601 UTC).

Sample JSON#

Grocery Hierarchy Example#
// Top Level
{
  "id": "cat_groceries",
  "name": "Groceries",
  "description": "All fresh and packaged food items.",
  "parent_id": null,
  "is_active": true,
  "updated_at": "2025-07-01T10:00:00Z"
}
// Level 2
{
  "id": "cat_dairy_eggs",
  "name": "Dairy & Eggs",
  "description": "Includes milk, cheese, yogurt, and eggs.",
  "parent_id": "cat_groceries",
  "is_active": true,
  "updated_at": "2025-07-01T10:05:00Z"
}
// Level 3
{
  "id": "cat_milk",
  "name": "Milk",
  "description": "Fresh, long-life, and flavored milk.",
  "parent_id": "cat_dairy_eggs",
  "is_active": true,
  "updated_at": "2025-07-01T10:10:00Z"
}
Restaurant Menu Hierarchy Example#
// Top Level (Restaurant Menu)
{
  "id": "cat_rbh_menu",
  "name": "Riyadh Burger House Menu",
  "description": "Our signature burgers, sides, and drinks.",
  "parent_id": null,
  "is_active": true,
  "updated_at": "2025-10-15T09:00:00Z"
}
// Level 2 (Menu Section)
{
  "id": "cat_burgers",
  "name": "Signature Burgers",
  "description": "All our handcrafted burgers.",
  "parent_id": "cat_rbh_menu",
  "is_active": true,
  "updated_at": "2025-10-15T09:05:00Z"
}

Previous
๐Ÿช Merchants
Next
๐Ÿท๏ธ Items
Built with