POST
Expenses.CategoriesList
Alias of ExpensesCategories.List. Return expense categories for the Expenses New modal SELECT CATEGORY / SUB CATEGORY dropdowns.
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
- Runs the Expenses.CategoriesList function and returns JSON.
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
- SELECT CATEGORY: POST /app/ExpensesCategories.List (default parent_id=0). Use data[].id as Expenses.Add category_id.
- SELECT SUB CATEGORY: send parent_id with the selected category id from the first call.
- Other (id=0) is a synthetic dashboard option. Prefer a real category id for Expenses.Add.
- Aliases: Expenses.CategoriesList. Not the same as Categories.List (ec_categories / products).
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
parent_idpost | int | 0 | Filter by parent. Default 0 = top-level categories (SELECT CATEGORY). Send a category id to list its sub-categories (SELECT SUB CATEGORY). Aliases: parent, parent_category_id. |
parents_onlypost | int | 1 | When 1, forces parent_id=0. Alias: top_level. |
allpost | int | 0 | When 1, returns every category (parents and sub-categories) without parent filter. |
include_otherpost | int | 1 | When listing top-level categories, default 1 prepends Other (id=0) like the dashboard. Send 0 to skip. Alias: include_others. |
searchpost | string | root | Search name_en / name_he. Aliases: name, name_en, name_he, category_name, filter_data, search[value]. |
startpost | int | 0 | First row offset for paging. Alias: offset. |
limitpost | int | 25 | Maximum rows to return. Values above 25 are capped. Aliases: length, per_page. |
order_bypost | string | id | Order column: id, name_en, name_he, parent_id. Default id. |
order_dirpost | string | asc | Order direction: asc or desc. Default asc. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Expenses.CategoriesList",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"limit": "25"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Expenses.CategoriesList",
"url_domain": "https:\/\/{domain}\/app\/Expenses.CategoriesList"
}Endpoint
POST /app/Expenses.CategoriesList
POST https://{user}.bull36.com/app/Expenses.CategoriesList
POST https://{domain}/app/Expenses.CategoriesListSample Output
{
"success": 1,
"count": 3,
"recordsTotal": 3,
"recordsFiltered": 3,
"total_record": 3,
"start": 0,
"limit": 25,
"include_other": 1,
"parent_id": 0,
"data": [
{
"id": 0,
"category_id": 0,
"name": "Other",
"name_en": "Other",
"name_he": "אחרים",
"parent_id": 0,
"is_parent": true,
"is_other": true
},
{
"id": 12,
"category_id": 12,
"name": "new expense",
"name_en": "new expense",
"name_he": "new expense",
"parent_id": 0,
"is_parent": true,
"is_other": false
},
{
"id": 15,
"category_id": 15,
"name": "root expense",
"name_en": "root expense",
"name_he": "root expense",
"parent_id": 0,
"is_parent": true,
"is_other": false
}
]
}Count Only
Use the matching count route with the same filters when the UI only needs total rows for paging.
{
"url": "\/app\/Expenses.CategoriesList",
"url_user": "https:\/\/{user}.bull36.com\/app\/Expenses.CategoriesList",
"url_domain": "https:\/\/{domain}\/app\/Expenses.CategoriesList",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": [],
"sample_output": {
"success": 1,
"count": 123
},
"notes": {
"route": "ExpensesCategories.Count",
"max_limit": 25
}
}Count JavaScript
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
const res = await fetch('https://{domain}/app/Expenses.CategoriesList', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data.count);JavaScript Example
const token = 'YOUR TOKEN';
// SELECT CATEGORY
const body = new URLSearchParams({ limit: '25' });
const res = await fetch('/app/Expenses.CategoriesList', {
method: 'POST',
headers: { Authorization: 'Bearer ' + token },
body
});
const data = await res.json();
console.log(data.data);
// SELECT SUB CATEGORY for chosen category:
const sub = new URLSearchParams({ parent_id: String(data.data[1].id), include_other: '0', limit: '25' });
const subRes = await fetch('/app/Expenses.CategoriesList', {
method: 'POST',
headers: { Authorization: 'Bearer ' + token },
body: sub
});
console.log(await subRes.json());Error Example
{
"success": "0",
"error": "bearer_token_required",
"message": "Authorization bearer token is required. Send header: Authorization: Bearer YOUR TOKEN"
}