POST
Ticket.ProductsByCustomer
Return products for a customer from their invoice and purchase_orders document line items (same source as dashboard tickets/product_choose_by_customer). App value rule: when document line iteeeem_id is 0 (free-text), value/product_id is the item_name; when iteeeem_id is not 0, value/product_id is that catalog id. Use returned value with Ticket.Add / Ticket.Edit product_id[]. Optional product_id marks selected rows.
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 Ticket.ProductsByCustomer 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 is App-only JSON. Dashboard still returns HTML options and is unchanged.
- If iteeeem_id = 0 → return / store the product name.
- If iteeeem_id != 0 → return / store the product id.
- Send the value field (or product_id) on Ticket.Add / Ticket.Edit as product_id[].
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
cust_idpost | int | 123 | Customer id. Aliases: customer_id, id (dashboard posts id). |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
product_idpost | array|string | 12,Custom item | Optional selected values to mark selected=true. Mix of catalog ids and free-text names. Alias: product_id[]. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Ticket.ProductsByCustomer",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"cust_id": "123",
"product_id": "12"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.ProductsByCustomer",
"url_domain": "https:\/\/{domain}\/app\/Ticket.ProductsByCustomer"
}Endpoint
POST /app/Ticket.ProductsByCustomer
POST https://{user}.bull36.com/app/Ticket.ProductsByCustomer
POST https://{domain}/app/Ticket.ProductsByCustomerSample Output
{
"success": 1,
"cust_id": 123,
"count": 2,
"data": [
{
"id": 12,
"name": "Widget",
"value": "12",
"product_id": "12",
"selected": true
},
{
"id": 0,
"name": "Custom service",
"value": "Custom service",
"product_id": "Custom service",
"selected": false
}
],
"product_id": [
"12"
]
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ cust_id: '123', product_id: '12' });
const res = await fetch('/app/Ticket.ProductsByCustomer', {
method: 'POST',
headers: { Authorization: 'Bearer ' + token },
body
});
const data = await res.json();
// Use data.data[i].value on Ticket.Add product_id[]
console.log(data.data);Error Example
{
"success": 0,
"message": "Missing required parameter: cust_id"
}