Skip to content

Skill: Query GL Detail

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.

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.

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.

“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

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.

POST /api/sage-intacct/v1.0/query-gldetail


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