POST
Expenses.List
Return expenses with filters, paging, and a maximum page size of 25. Same as the dashboard customer profile Expenses tab: pass customer_id to list only that customer's expenses.
Permissions
- User must be logged in with a valid bearer token.
- The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Returns Expenses 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
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- To get expenses for one customer (left customer list → Expenses tab), send customer_id = contactus.id.
- Aliases: cust_id, contactus_id. Omit customer_id to list all account expenses (existing behavior).
- Matches dashboard Expences::show_module_expences_js which filters expenses_new.customer_id.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
customer_idpost | int | 123 | Filter by customer (contactus.id). Same as dashboard customer profile Expenses tab. Aliases: cust_id, contactus_id. Omit to return all expenses for the account. |
cust_idpost | int | 123 | Alias for customer_id (dashboard POST key name). |
contactus_idpost | int | 123 | Alias for customer_id. |
searchpost | string | office | Filters by note, invoice number, or check number. |
categorypost | int | 224 | Filters by expense category id. |
project_idpost | int | 700 | Filters expenses by project. |
document_typepost | string | invoice | Filters by document type. |
paid_statuspost | int | 1 | Filters paid/unpaid expenses when stored. |
supplier_idpost | int | 80 | Filters by supplier id. |
monthpost | string | 0726 | Filters by stored month value. |
from_datepost | date | 2026-07-01 | Filters expenses from this date using the first supported date field. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
to_datepost | date | 2026-07-31 | Filters expenses until this date using the first supported date field. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
limitpost | int | 25 | Limits returned expenses. Values above 25 are capped. |
offsetpost | int | 0 | Skips rows for paging. |
orderpost | string | id_desc | Shortcut sort. Allowed values: id_desc (newest first, default), id_asc (oldest first). Equivalent to order_by=id + order_dir=desc|asc. |
order_bypost | string | id | Column to sort by: id, amount, month, payment_date, document_date, created_time. Use with order_dir. |
order_dirpost | string | desc | Sort direction: asc or desc. Default desc when order is omitted. |
startpost | int | 0 | First row offset for paging. |
lengthpost | int | 25 | Maximum number of rows to return. Values above 25 are capped to 25. |
per_pagepost | int | 25 | Alternative page-size field. Values above 25 are capped to 25. |
drawpost | int | 1 | Optional DataTables draw counter. |
search[value]post | string | john | DataTables search text when supported. |
filter_datapost | string | john | Legacy/general filter text when supported. |
date_fieldpost | string | date_created | Date column selector when supported, such as date_created, last_updated, updated, or followup. |
created_frompost | date | 2026-07-01 | Filters rows created from this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
created_topost | date | 2026-07-17 | Filters rows created until this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
updated_frompost | date | 2026-07-01 | Filters rows updated from this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
updated_topost | date | 2026-07-17 | Filters rows updated until this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
order_bypost | string | date_created | Column/key to order by when supported. |
sortpost | string | date_desc | Sort preset when supported. |
order_dirpost | string | desc | Order direction: asc or desc. |
order[0][column]post | int | 0 | DataTables column index to order by when supported. |
order[0][dir]post | string | desc | DataTables order direction: asc or desc. |
folder_idpost | mixed | 1 | Folder filter when the list supports folders. |
folderpost | mixed | 1,2 | One or more folder ids/names when the list supports folders. |
status_idpost | mixed | 1 | Status filter when the list supports statuses. |
tagpost | mixed | 1 | Tag filter when the list supports tags. |
tag_idpost | mixed | 1 | Tag id filter when the list supports tags. |
sourcepost | mixed | website | Source filter when the list supports source values. |
team_member_idpost | mixed | 47 | Team member/assignee filter when supported. |
custom_fieldpost | string | vip_level | Custom field name for list filtering when supported. |
custom_field_valuepost | mixed | gold | Custom field value paired with custom_field when supported. |
Authentication
Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Expenses.List",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"customer_id": "123",
"limit": "25",
"offset": "0"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Expenses.List",
"url_domain": "https:\/\/{domain}\/app\/Expenses.List"
}Endpoint
POST /app/Expenses.List
POST https://{user}.bull36.com/app/Expenses.List
POST https://{domain}/app/Expenses.ListSample Output
{
"success": 1,
"data": [
{
"id": "900",
"expenses_name": "Office rent",
"customer_id": "123",
"amount": "224.00"
}
],
"limit": 25,
"offset": 0
}Count Only
Use the matching count route with the same filters when the UI only needs total rows for paging.
{
"url": "\/app\/Expenses.Count",
"url_user": "https:\/\/{user}.bull36.com\/app\/Expenses.Count",
"url_domain": "https:\/\/{domain}\/app\/Expenses.Count",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"customer_id": "123"
},
"sample_output": {
"success": 1,
"count": 123
},
"notes": {
"route": "Expenses.Count",
"max_limit": 25
}
}Count JavaScript
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('customer_id', '123');
const res = await fetch('https://{domain}/app/Expenses.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({ customer_id: '123', limit: '25' });
const res = await fetch('/app/Expenses.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"
}