Category List

This page describes the request data identifiers and response structure required to build a category list page.

Data Identifier

{
  "dataID": "GET_CATEGORY_LIST",
  "page": 1,
  "list_per_page": 20,
  "block_per_page": 5,
  "parent_seq": 1,
  "status": "ACTIVE",
  "search_keyword": ""
}
KeyDescription
dataIDData identifier GET_CATEGORY_LIST
pagePage number. Leave empty to get every row without paging.
list_per_pageRows per page (default 20)
block_per_pagePage links per block (default 7)
parent_seqOnly the direct children of this category. Empty = all categories.
statusStatus filter ACTIVE / INACTIVE
search_keywordPartial match on name
treeY also returns category_tree: every category ordered depth-first.
seqCategory being edited. Used to fill exclude_parent_seq

HTML

<div class="card shadow-sm">
  <div class="card-header d-flex justify-content-between align-items-center">
    <strong>Categories</strong>
    <span class="badge bg-secondary">{{ output.total_count }} total</span>
  </div>
  <table class="table table-hover mb-0 align-middle">
    <thead class="table-light">
      <tr><th>#</th><th>Code</th><th>Name</th><th>Depth</th><th>Order</th><th>Status</th></tr>
    </thead>
    <tbody>
      <tr v-for="row in output.category_list">
        <td>{{ row.seq }}</td>
        <td><code>{{ row.code }}</code></td>
        <td>{{ row.name }}</td>
        <td>{{ row.depth }}</td>
        <td>{{ row.sort_order }}</td>
        <td><span class="badge bg-success">{{ row.status }}</span></td>
      </tr>
    </tbody>
  </table>
</div>

Response Result

{
  "search_keyword": "",
  "pagination": {
    "total_result_num": 2,
    "total_page_num": 1,
    "page": "1",
    "start_page": 1,
    "end_page": 1,
    "prev_page": 1,
    "next_page": 1
  },
  "category_list": [
    {
      "seq": 2,
      "parent_seq": 1,
      "code": "TSHIRTS",
      "name": "T-Shirts",
      "depth": 1,
      "sort_order": 1,
      "status": "ACTIVE",
      "extra_data": null,
      "created_by": 3,
      "updated_by": 3,
      "create_date": "2026-10-04 11:57:33",
      "modify_date": null,
      "delete_flg": "N"
    },
    {
      "seq": 3,
      "parent_seq": 1,
      "code": "HOODIES",
      "name": "Hoodies",
      "depth": 1,
      "sort_order": 2,
      "status": "ACTIVE",
      "extra_data": null,
      "created_by": 3,
      "updated_by": 3,
      "create_date": "2026-10-04 11:57:33",
      "modify_date": null,
      "delete_flg": "N"
    }
  ],
  "total_count": 2,
  "total_category_count": 2,
  "exclude_parent_seq": []
}
KeyDescription
search_keywordSearch keyword that was applied
paginationPaging info (when page is sent)
category_listCategories, ordered by sort_order then seq
category_list[n].seqCategory number (number)
category_list[n].parent_seqParent category number. null for a root
category_list[n].codeCategory code
category_list[n].nameCategory name
category_list[n].depthDepth. 0 for a root
category_list[n].sort_orderOrder among siblings
category_list[n].statusACTIVE / INACTIVE
category_list[n].create_dateCreated at
category_list[n].modify_dateModified at. null if never modified
total_countTotal rows matching the filter
total_category_countSame as total_count (kept for older clients)
category_treeOnly when tree=Y. Every category, flattened depth-first
exclude_parent_seqWith seq: that category and its descendants. Otherwise []
  • On an edit screen, send seq to get that category and its descendants in exclude_parent_seq. Remove them from the parent picker to prevent loops.
  • Screen example: for a storefront side menu, call once with status=ACTIVE and no parent_seq, then group rows by parent_seq. Pass parent_seq when you only need one submenu.
  • When a category is clicked, pass its seq as category_seq to GET_PRODUCT_LIST to show its products.
  • Error codes — errors also come back as HTTP 200. Check result:false, then error_code (string) and error_message.
  • This read API needs no sign-in. With no match it returns an empty array and total_count 0.

Example

Categories 2 total
#CodeNameDepthOrderStatus
2TSHIRTST-Shirts11ACTIVE
3HOODIESHoodies12ACTIVE
<script setup>
const requestData = {"dataID": "GET_CATEGORY_LIST", "page": 1, "list_per_page": 20, "parent_seq": 1, "status": "ACTIVE"};
const { output } = await useNuxtApp().$connector(requestData);
</script>

<template>
  <div class="card shadow-sm">
    <div class="card-header d-flex justify-content-between align-items-center">
      <strong>Categories</strong>
      <span class="badge bg-secondary">{{ output.total_count }} total</span>
    </div>
    <table class="table table-hover mb-0 align-middle">
      <thead class="table-light">
        <tr><th>#</th><th>Code</th><th>Name</th><th>Depth</th><th>Order</th><th>Status</th></tr>
      </thead>
      <tbody>
        <tr v-for="row in output.category_list" :key="row.seq">
          <td>{{ row.seq }}</td>
          <td><code>{{ row.code }}</code></td>
          <td>{{ row.name }}</td>
          <td>{{ row.depth }}</td>
          <td>{{ row.sort_order }}</td>
          <td><span class="badge bg-success">{{ row.status }}</span></td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<?php
$requestData = [
    'dataID'        => 'GET_CATEGORY_LIST',
    'page'          => 1,
    'list_per_page' => 20,
    'parent_seq'    => 1,       // children of "Apparel"
    'status'        => 'ACTIVE',
];
$output = $connector->request($requestData);
?>
<table class="table table-hover align-middle">
  <thead><tr><th>#</th><th>Code</th><th>Name</th><th>Order</th><th>Status</th></tr></thead>
  <tbody>
  <?php foreach ($output['category_list'] as $row) { ?>
    <tr>
      <td><?= $row['seq'] ?></td>
      <td><code><?= htmlspecialchars($row['code']) ?></code></td>
      <td><?= htmlspecialchars($row['name']) ?></td>
      <td><?= $row['sort_order'] ?></td>
      <td><span class="badge bg-success"><?= $row['status'] ?></span></td>
    </tr>
  <?php } ?>
  </tbody>
</table>
<p class="text-secondary">Total: <?= $output['total_count'] ?></p>