POST
Categories.List
Return product categories for the account. By default returns parent categories (parent=0), matching the product-report Categories tab. Send parent for children, or all=1 for every category. Page size is capped at 25.
Permissions
- User must be logged in with a valid bearer token.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Returns Categories rows as JSON.
- Supports the documented filters and paging fields.
- List responses are capped at 25 rows per call.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
Special Instructions
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- Send parameters as POST body fields exactly as documented.
- For paging, do not request more than 25 rows.
- For total rows, call the matching Count function with the same filters.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
parentpost | int | 0 | Filter by parent id. 0 = top-level categories. Omit with all=1 to return every category. |
parent_idpost | int | 0 | Alias for parent. |
parents_onlypost | int | 1 | When 1, forces parent=0. |
allpost | int | 0 | When 1, returns all categories without defaulting parent=0. |
typepost | string | products | Filters by type: products or insurance. |
searchpost | string | membership | Search title or description. |
startpost | int | 0 | First row offset for paging. |
lengthpost | int | 25 | Maximum rows to return. Values above 25 are capped to 25. |
limitpost | int | 25 | Alternative page-size field. Values above 25 are capped to 25. |
per_pagepost | int | 25 | Alternative page-size field. Values above 25 are capped to 25. |
order_bypost | string | category | Order column: id, category, order_cat, parent, type. |
order_dirpost | string | asc | Order direction: asc or desc. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Categories.List",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"parent": "0",
"length": "25"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Categories.List",
"url_domain": "https:\/\/{domain}\/app\/Categories.List"
}Endpoint
POST /app/Categories.List
POST https://{user}.bull36.com/app/Categories.List
POST https://{domain}/app/Categories.ListSample Output
{
"success": 1,
"count": 1,
"data": [
{
"id": "4",
"category_id": "4",
"category": "Membership",
"name": "Membership",
"parent": "0",
"type": "products"
}
],
"limit": 25,
"start": 0
}Count Only
Use the matching count route with the same filters when the UI only needs total rows for paging.
{
"url": "\/app\/Categories.Count",
"url_user": "https:\/\/{user}.bull36.com\/app\/Categories.Count",
"url_domain": "https:\/\/{domain}\/app\/Categories.Count",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"parent": "0"
},
"sample_output": {
"success": 1,
"count": 123
},
"notes": {
"route": "Categories.Count",
"max_limit": 25
}
}Count JavaScript
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('parent', '0');
const res = await fetch('https://{domain}/app/Categories.Count', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data.count);JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ parent: '0', length: '25' });
const res = await fetch('/app/Categories.List', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": "0",
"error": "bearer_token_required",
"message": "Authorization bearer token is required. Send header: Authorization: Bearer YOUR TOKEN"
}