Skill: Query AP Bill Items
The Query AP Bill Items skill retrieves aggregated accounts payable bill item data from Sage Intacct. It is designed for answering questions about vendor spending, expense analysis, and AP aging by grouping line-item data along one or more dimensions.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
group_by | string | Yes | How to group results. Options: vendor, glaccount, project, department, location, class, item, employee, customer. Multiple values can be comma-separated. |
start_date | string | No | Filter bill items with a date on or after this value (YYYY-MM-DD). |
end_date | string | No | Filter bill items with a date on or before this value (YYYY-MM-DD). |
vendor_id | string | No | Filter by vendor ID. |
department_id | string | No | Filter by department ID. |
location_id | string | No | Filter by location ID. |
project_id | string | No | Filter by project ID. |
class_id | string | No | Filter by class ID. |
glaccount | string | No | Filter by GL account number. |
item_id | string | No | Filter by item ID. |
employee_id | string | No | Filter by employee ID. |
customer_id | string | No | Filter by customer ID. |
offset | integer | No | Number of records to skip for pagination. Defaults to 0. |
limit | integer | No | Maximum number of grouped records to return. Defaults to 100. |
Aggregates
Section titled “Aggregates”The skill automatically computes these aggregates for each group:
| Aggregate | Description |
|---|---|
SUM(AMOUNT) | Total amount in the company’s base currency. |
SUM(TRX_AMOUNT) | Total amount in the transaction currency (useful for multi-currency environments). |
COUNT(RECORDNO) | Number of bill items in the group. |
Example usage
Section titled “Example usage”“How much did we spend with each vendor last quarter?”
The agent would invoke:
group_by:vendorstart_date:2025-10-01end_date:2025-12-31
“Break down AP by GL account for the IT department this year.”
The agent would invoke:
group_by:glaccountdepartment_id:ITstart_date:2026-01-01end_date:2026-03-18
Response structure
Section titled “Response structure”The skill returns an array of grouped records, each containing:
- Group key(s) — the dimension value(s) used for grouping (e.g., vendor name, GL account number).
- SUM_AMOUNT — total base-currency amount.
- SUM_TRX_AMOUNT — total transaction-currency amount.
- COUNT_RECORDNO — count of bill items.
Results are sorted by SUM_AMOUNT in descending order by default.
API endpoint
Section titled “API endpoint”POST /api/sage-intacct/v1.0/query-apbillitem
Related skills: Query GL Detail | Query AR Invoice Items | Query Projects