Skill: Query GL Detail

Query general ledger detail records in Sage Intacct with mandatory date ranges, module and journal filters, and dimensional groupings.

The Query GL Detail skill retrieves aggregated general ledger detail records from Sage Intacct. This is the primary skill for answering questions about journal entries, account balances, and ledger activity across any dimension.

Parameters

ParameterTypeRequiredDescription
group_bystringYesHow to group results. Options: glaccount, department, location, vendor, customer, project, class, item, employee. Multiple values can be comma-separated.
start_datestringYesStart of the date range on BATCH_DATE (YYYY-MM-DD). GL detail queries require a date range.
end_datestringYesEnd of the date range on BATCH_DATE (YYYY-MM-DD).
module_keystringNoFilter by module (e.g., 2.AP for Accounts Payable, 3.AR for Accounts Receivable, 1.GL for General Ledger).
book_idstringNoFilter by book ID. Use ACCRUAL or CASH to select the accounting basis, or a custom book ID.
journal_symbolstringNoFilter by journal symbol (e.g., APJ for AP Journal, ARJ for AR Journal, GJ for General Journal).
glaccountstringNoFilter by GL account number.
department_idstringNoFilter by department ID.
location_idstringNoFilter by location ID.
vendor_idstringNoFilter by vendor ID.
customer_idstringNoFilter by customer ID.
project_idstringNoFilter by project ID.
class_idstringNoFilter by class ID.
employee_idstringNoFilter by employee ID.
offsetintegerNoNumber of records to skip for pagination. Defaults to 0.
limitintegerNoMaximum number of grouped records to return. Defaults to 100.
Caution

Both start_date and end_date are mandatory for GL detail queries. The date filter applies to BATCH_DATE (the date the journal entry was posted). If the user does not specify dates, the agent should default to a reasonable range such as the current fiscal year or month.

Aggregates

The skill automatically computes these aggregates for each group:

AggregateDescription
SUM(AMOUNT)Net amount (debits positive, credits negative) in base currency.
SUM(TRX_AMOUNT)Net amount in transaction currency.
COUNT(RECORDNO)Number of GL detail records in the group.

Example usage

“What’s the GL activity for each department this month?”

The agent would invoke:

  • group_by: department
  • start_date: 2026-03-01
  • end_date: 2026-03-18

“Show me all AP journal entries to account 6000 in Q4 last year.”

The agent would invoke:

  • group_by: glaccount
  • start_date: 2025-10-01
  • end_date: 2025-12-31
  • module_key: 2.AP
  • glaccount: 6000

Response structure

The skill returns an array of grouped records, each containing:

  • Group key(s) — the dimension value(s) used for grouping.
  • SUM_AMOUNT — net base-currency amount for the group.
  • SUM_TRX_AMOUNT — net transaction-currency amount.
  • COUNT_RECORDNO — number of journal entry lines in the group.

Related skills: Query GL Budget Items | Query AP Bill Items | Query AR Invoice Items