Skill: Query AP Bill Items

Query accounts payable bill items in Sage Intacct with grouping, dimensional filters, date ranges, and aggregate summaries.

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

ParameterTypeRequiredDescription
group_bystringYesHow to group results. Options: vendor, glaccount, project, department, location, class, item, employee, customer. Multiple values can be comma-separated.
start_datestringNoFilter bill items with a date on or after this value (YYYY-MM-DD).
end_datestringNoFilter bill items with a date on or before this value (YYYY-MM-DD).
vendor_idstringNoFilter by vendor ID.
department_idstringNoFilter by department ID.
location_idstringNoFilter by location ID.
project_idstringNoFilter by project ID.
class_idstringNoFilter by class ID.
glaccountstringNoFilter by GL account number.
item_idstringNoFilter by item ID.
employee_idstringNoFilter by employee ID.
customer_idstringNoFilter by customer ID.
offsetintegerNoNumber of records to skip for pagination. Defaults to 0.
limitintegerNoMaximum number of grouped records to return. Defaults to 100.
Caution

The group_by parameter is required. Without it, the skill cannot determine how to aggregate the data. If a user asks a broad question like “What are our AP totals?”, the agent should default to grouping by vendor.

Aggregates

The skill automatically computes these aggregates for each group:

AggregateDescription
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

“How much did we spend with each vendor last quarter?”

The agent would invoke:

  • group_by: vendor
  • start_date: 2025-10-01
  • end_date: 2025-12-31

“Break down AP by GL account for the IT department this year.”

The agent would invoke:

  • group_by: glaccount
  • department_id: IT
  • start_date: 2026-01-01
  • end_date: 2026-03-18

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.


Related skills: Query GL Detail | Query AR Invoice Items | Query Projects