Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/VisualGraphxLLC/API-HUB/llms.txt

Use this file to discover all available pages before exploring further.

Categories are imported as part of the catalog sync process and represent the supplier’s own taxonomy. They form a parent-child tree through the parent_id field. The product list endpoint accepts a category_id filter that automatically includes all descendant categories via a recursive CTE.

List categories

Returns all categories as a flat list with parent_id references. Filter by supplier to get only that vendor’s category tree.
# All categories
curl https://your-hub.example.com/api/categories

# Categories for a specific supplier
curl "https://your-hub.example.com/api/categories?supplier_id=3fa85f64-5717-4562-b3fc-2c963f66afa6"
Query parameters
supplier_id
string (UUID)
Scope results to a single supplier’s category tree.
Response — 200 OK Returns an array of category objects ordered by sort_order then name.
[
  {
    "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "supplier_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "external_id": "TSHIRTS",
    "name": "T-Shirts",
    "parent_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "sort_order": 10
  },
  {
    "id": "d4e5f6a7-b8c9-0123-def0-234567890123",
    "supplier_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "external_id": "POLO",
    "name": "Polo Shirts",
    "parent_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "sort_order": 20
  }
]
id
string (UUID)
Category unique identifier. Use this with the product list category_id filter.
supplier_id
string (UUID)
Supplier that owns this category.
external_id
string
Supplier’s own category code or ID (e.g., "TSHIRTS"). Preserved from the adapter’s raw data.
name
string
Human-readable category name.
parent_id
string | null
UUID of the parent category, or null for root-level categories.
sort_order
integer
Supplier-defined display order. Lower values appear first.

Get a single category

Fetch one category by its UUID.
curl https://your-hub.example.com/api/categories/c3d4e5f6-a7b8-9012-cdef-123456789012
category_id
string (UUID)
required
Category unique identifier.
Response — 200 OK — single category object with the same fields as the list response. Error responses
StatusDetail
404 Not Found"Category not found"

Get OPS category input

Returns the category formatted for an OPS setProductCategory mutation. Used by n8n when pushing a new category to an OPS storefront.
curl https://your-hub.example.com/api/categories/c3d4e5f6-a7b8-9012-cdef-123456789012/ops-input
Response — 200 OK
{
  "category_name": "T-Shirts",
  "parent_id": -1,
  "status": 1,
  "category_internal_name": "tshirts"
}
category_name
string
Display name for the OPS category.
parent_id
integer
OPS parent category ID. Defaults to -1 (no parent / root) since OPS parent IDs are managed separately.
status
integer
OPS visibility status. 1 = active.
category_internal_name
string
Slugified internal name derived from the category’s external_id, or a lowercase-hyphenated version of name if external_id is empty.

Building a category tree

The list endpoint returns a flat array. Build the tree client-side by grouping on parent_id:
function buildTree(categories) {
  const map = Object.fromEntries(categories.map(c => [c.id, { ...c, children: [] }]));
  const roots = [];
  for (const cat of Object.values(map)) {
    if (cat.parent_id && map[cat.parent_id]) {
      map[cat.parent_id].children.push(cat);
    } else {
      roots.push(cat);
    }
  }
  return roots;
}
When filtering products by category_id, API-HUB automatically includes all descendant categories — you do not need to enumerate child category IDs manually.

Build docs developers (and LLMs) love