POST
Documents.Products
Return product line items sold/ordered for one customer, matching the dashboard customer Product tab (product_invoice_html). Rows are expanded from document items on purchase_orders, order_proposals, gi_ir, organization_receipt, and selected invoices. Pagination is by documents (default 10, max 25), then each document items[] becomes one or more product rows.
Required Choice
Send at least one complete option from the list below.
| Option | Accepted Fields | Explanation |
|---|---|---|
| 1 | customer_id or cust_id or client_id | One of these values is required to create the record. |
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 Documents.Products 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
- This route matches the dashboard customer Product tab loader (product_invoice_html), but returns JSON rows instead of HTML.
- It is different from Products.List, which returns the account product catalog (ec_product).
- Document set: purchase_orders, order_proposals, gi_ir, organization_receipt, plus invoices that pass the same related-purchase-order rules as the dashboard.
- Pagination counts documents, not product rows. One document with 3 items can return 3 rows.
- Send filter fields flat or nested under filter / filter[key] for dashboard-compatible clients.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
customer_idpost | int | 108545 | Customer id. Aliases: cust_id, client_id. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
page_idpost | int | 1 | 1-based document page, same idea as dashboard Product tab. Alias: page. |
startpost | int | 0 | Document offset alternative to page_id. Alias: offset. |
limitpost | int | 10 | Documents per page. Default 10 (dashboard). Values above 25 are capped. Aliases: length, per_page. |
prev_record_countpost | int | 11 | Optional next row_number start for page continuity (dashboard prev_record). |
last_documents_idpost | string | 1234 | Filter by document number. Also accepted as filter[last_documents_id]. |
final_amountpost | string | 100,500 | Exact amount, or from,to range. Alias: price. Also filter[final_amount]. |
coinpost | string | ₪ | Currency/coin filter. Alias: currency. |
order_typepost | string | gi_ir | Document type filter such as purchase_orders, order_proposals, gi_ir, organization_receipt, invoice. Aliases: type, document_type. |
product_namepost | string | testing | Search product name inside documents.items JSON. Alias: search. |
start_qtypost | number | 1 | Minimum item qty. Alias: qty_from. Use with end_qty. |
end_qtypost | number | 10 | Maximum item qty. Alias: qty_to. Use with start_qty. |
from_datepost | date | 2022-01-01 | Filter documents.date_created from this date. Alias: created_from. 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-12-31 | Filter documents.date_created until this date. Alias: created_to. 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 | Sort column: date_created, last_documents_id, final_amount, type, coin, id. Alias: data_name. |
order_dirpost | string | desc | asc or desc. Alias: data_val. |
filterpost | json|array | {"product_name":"testing"} | Optional dashboard-style filter object. Keys: last_documents_id, final_amount, coin, order_type, product_name, start_qty, end_qty, data_name, data_val, between_condition. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Documents.Products",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"customer_id": "108545",
"page_id": "1",
"limit": "10"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Documents.Products",
"url_domain": "https:\/\/{domain}\/app\/Documents.Products"
}Endpoint
POST /app/Documents.Products
POST https://{user}.bull36.com/app/Documents.Products
POST https://{domain}/app/Documents.ProductsSample Output
{
"success": 1,
"count": 2,
"document_count": 15,
"recordsTotal": 15,
"page_id": 1,
"start": 0,
"limit": 10,
"prev_record_count": 3,
"customer_id": 108545,
"data": [
{
"row_number": 1,
"product_id": "77",
"iteeeem_id": "77",
"document_id": "9001",
"last_documents_id": "1234",
"date_created": "2022-01-29 10:00:00",
"date_display": "29\/01\/22",
"coin": "₪",
"item_total": "100",
"price": "₪100",
"item_qty": "1",
"document_type": "gi_ir",
"document_type_label": "gi_ir",
"product_name": "testing1",
"item_name": "testing1",
"item_notes": "",
"document_note": "",
"item_price": "100",
"item_sku": "",
"item_type": "product"
}
]
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({
customer_id: '108545',
page_id: '1',
limit: '10'
});
const res = await fetch('/app/Documents.Products', {
method: 'POST',
headers: { Authorization: 'Bearer ' + token },
body
});
const data = await res.json();
console.log(data.data);Error Example
{
"success": 0,
"message": "Missing required parameter: customer_id"
}