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

NameTypeSampleWhat it gives
parent
post
int0Filter by parent id. 0 = top-level categories. Omit with all=1 to return every category.
parent_id
post
int0Alias for parent.
parents_only
post
int1When 1, forces parent=0.
all
post
int0When 1, returns all categories without defaulting parent=0.
type
post
stringproductsFilters by type: products or insurance.
search
post
stringmembershipSearch title or description.
start
post
int0First row offset for paging.
length
post
int25Maximum rows to return. Values above 25 are capped to 25.
limit
post
int25Alternative page-size field. Values above 25 are capped to 25.
per_page
post
int25Alternative page-size field. Values above 25 are capped to 25.
order_by
post
stringcategoryOrder column: id, category, order_cat, parent, type.
order_dir
post
stringascOrder 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.List

Sample 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"
}