Skip to content

Mercury: List journal entries

Mercury books.listBooksJournalEntries: arguments, response, policy and SDK examples.

← Books operations · Get started

Operation mercury.listbooksjournalentries

Provider route: GET /books/journal-entries. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/mercury with npm, or alter-sdk-mercury with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { MercuryIntegration } from "@alter-ai/mercury";
async function execute(input: Parameters<MercuryIntegration["books"]["listBooksJournalEntries"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new MercuryIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.books.listBooksJournalEntries(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_mercury import MercuryIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = MercuryIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.books.list_books_journal_entries(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectOptionalAdditional keys: not allowed
query.booksIdstringOptionalThe Books instance to act on. Must be the token organization’s own instance, which it defaults to.
Format: uuid
query.startDatestringOptionalOnly return Journal Entries after the start date (inclusive).
Format: date
query.endDatestringOptionalOnly return Journal Entries before the end date (inclusive).
Format: date
query.ledgerIdstringOptionalOnly return Journal Entries where at least one Line Entry belongs to the specified Ledger.
Format: base58 (max length 22)
query.creationSourcestringOptionalOnly return Journal Entries with the specified creation source.
One of: manual, transaction, accrual, paymentApplication, legacy, scheduledAccrual
query.creationSourcesarrayOptionalComma-separated list of creation sources. Only return Journal Entries whose creation source matches one of the specified values.
query.creationSources[]stringEach itemOne of: manual, transaction, accrual, paymentApplication, legacy, scheduledAccrual
query.journalEntrySortstringOptionalThe sort order for the results.
One of: descriptionAsc, descriptionDesc, dateTimeAsc, dateTimeDesc, amountAsc, amountDesc, creationDateAsc, creationDateDesc, transactionSourceAccountAsc, transactionSourceAccountDesc, transactionContraLedgerAsc, transactionContraLedgerDesc, tagNameAsc, tagNameDesc, debitLedgerAsc, debitLedgerDesc, creditLedgerAsc, creditLedgerDesc, reconciliationContraLedgerAsc, reconciliationContraLedgerDesc
query.expandstringOptionalComma-separated list of expandable paths.
One of: lineEntries, lineEntriesTransactions, lineEntriesLedger, lineEntriesOpposingLedgerIds, lineEntriesPaymentApplications, lineEntriesLinePaymentApplications, accrualSource, transfer, autocatResult
query.pageTokenstringOptionaltoken for pagination
query.keywordsstringOptionalOnly return Journal Entries where the description matches the specified keyword(s).
query.amountnumberOptionalOnly return journal entries with the specified monetary amount. If specified, `minAmount` and `maxAmount` parameters are ignored. If no decimal place provided, rounded values will be matched. E.g. an input of `100` will match 100.13 and 100.45, but an input of `100.13` will only match that value.
Format: double
query.minAmountnumberOptionalOnly return journal entries with a monetary amount of at least the specified amount. Ignored if `amount` is set.
Format: double
query.maxAmountnumberOptionalOnly return journal entries with a monetary amount less than specified amount. Ignored if `amount` is set.
Format: double
query.ledgerIdGroupsarrayOptionalA comma-separated list of ledger IDs forming one group. Repeat the parameter to send more groups (ledgerIdGroups=a,b&ledgerIdGroups=c): each occurrence is one group. Only return Journal Entries where at least one Line Entry belongs to one of the ledgers in each group, so multiple groups return the intersection of the matches.
query.ledgerIdGroups[]stringEach itemunique id for a ledger; emitted as base-58, but a base-16 UUID is also accepted
Format: base58 (max length 22)
query.limitintegerOptionalThe maximum number of journal entries to return per page, from 1 to 1000. Defaults to 50.
Default: 50
Maximum: 1000
Minimum: 1
query.tagIdsarrayOptionalComma-separated list of tag IDs. Only return Journal Entries with at least one of the specified tags.
query.tagIds[]stringEach itemunique id for a tag; emitted as base-58, but a base-16 UUID is also accepted
Format: base58 (max length 22)
query.categorizationStatusarrayOptionalComma-separated list of categorization statuses (‘pending’, ‘delayed’, ‘completed’, ‘notAttempted’). Only return Journal Entries whose categorization status matches one of the specified values.
query.categorizationStatus[]stringEach itemOne of: pending, delayed, completed, notAttempted
query.reviewStatusarrayOptionalComma-separated list of review statuses (‘unreviewed’, ‘reviewed’). Only return Journal Entries whose review status matches one of the specified values.
query.reviewStatus[]stringEach itemOne of: unreviewed, reviewed
query.categorizationMethodarrayOptionalComma-separated list of categorization methods (‘ai’, ‘rule’, ‘user’, ‘matched’, ‘uncategorized’). Only return Journal Entries that were categorized by one of the specified methods. ‘ai’ matches every automatic method except ‘rule’; ‘user’ matches Journal Entries with no live automatic categorization; ‘matched’ matches payment-application Journal Entries; ‘uncategorized’ matches Journal Entries with a Line Entry on an Uncategorized ledger. The other values never match the last two.
query.categorizationMethod[]stringEach itemOne of: ai, rule, user, matched, uncategorized

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand List journal entries — response body

Referenced models: List journal entries — response body

25 more schemas are linked from the tables above, on the schema pages.

List journal entries — response body
FieldTypePresenceDescription and constraints
$objectRootResponse containing a paginated list of journal entries.
journalEntriesarrayRequired within parentThe journal entries matching the query
journalEntries[]ModelEach itemExpand List journal entries — response body — journal Entries item
nextPageTokenJSONOptional
nextPageToken (anyOf 1)stringAlternativeToken to fetch the next page of results
nextPageToken (anyOf 2)nullAlternative
prevPageTokenJSONOptional
prevPageToken (anyOf 1)stringAlternativeToken to fetch the previous page of results
prevPageToken (anyOf 2)nullAlternative

Referenced models: List journal entries — response body — journal Entries item

List journal entries — response body — journal Entries item
FieldTypePresenceDescription and constraints
$objectRoot
accrualSourceJSONOptional
accrualSource (anyOf 1)JSONAlternative
accrualSource (anyOf 1) (allOf 1)ModelAll variants applyExpand List journal entries — response body — journalEntries / item / accrualSource / type: invoice, bill, payroll type: invoice, bill, payroll
accrualSource (anyOf 1) (allOf 2)JSONAll variants applyThe accrual source for the journal entry, if applicable. Included in expanded responses.
accrualSource (anyOf 2)nullAlternative
autocatResultJSONOptional
autocatResult (anyOf 1)JSONAlternative
autocatResult (anyOf 1) (allOf 1)ModelAll variants applyExpand List journal entries — response body — journal Entries item autocat Result confidence, created At, id, ledger Id, method, rule Id confidence, created At, id, ledger Id, method, rule Id
autocatResult (anyOf 1) (allOf 2)JSONAll variants applyHow the transaction underlying this journal entry was auto-categorized
(method, confidence, and rule), if any. Null for manual journal entries,
entries not categorized by the autocat pipeline, and entries a user has
since manually recategorized. Included in expanded responses.
autocatResult (anyOf 2)nullAlternative
categorizationStatusJSONRequired within parent
categorizationStatus (allOf 1)stringAll variants applyKnown values: pending, delayed, completed, notAttempted
categorizationStatus (allOf 2)JSONAll variants applyThe categorization lifecycle status of the journal entry.

- `pending`: Uncategorized JE posted at sync, auto-categorization not yet resolved.
- `delayed`: Auto-categorization fell back to uncategorized; can still transition to `completed`.
- `completed`: Categorization settled (a real category applied, an explicit uncategorized result, or a manually-created JE).
- `notAttempted`: Auto-categorization is disabled for the instance, so the JE was booked uncategorized and settled at once; no result will ever arrive.
creationDateJSONRequired within parent
creationDate (allOf 1)stringAll variants applyFormat: yyyy-mm-ddThh:MM:ssZ
creationDate (allOf 2)JSONAll variants applyThe date and time the journal entry was created
creationSourceJSONRequired within parent
creationSource (allOf 1)stringAll variants applyKnown values: manual, transaction, accrual, paymentApplication, legacy, scheduledAccrual
creationSource (allOf 2)JSONAll variants applyThe source that created a journal entry.

- `manual`: Created manually by the user via the UI.
- `transaction`: Created automatically from a transaction categorization (e.g., Plaid sync).
- `accrual`: Created automatically as part of an accrual workflow.
- `paymentApplication`: Created automatically as part of a payment application workflow.
- `legacy`: Created automatically from the old AR/AP system (receivables/payables).
datetimeJSONRequired within parent
datetime (allOf 1)stringAll variants applyFormat: yyyy-mm-ddThh:MM:ssZ
datetime (allOf 2)JSONAll variants applyThe datetime the Journal Entry was created in UTC time
descriptionstringRequired within parentAn arbitrary string on the object, useful for displaying to the user.
Format: size < 513
idstringRequired within parentThe unique ID of the object.
Format: base58 (max length 22)
isOpeningBalancebooleanRequired within parentWhether the Journal Entry represents an opening balance.
lineEntriesJSONOptional
lineEntries (anyOf 1)arrayAlternativeList of Line Entries. Included in expanded responses.
lineEntries (anyOf 1)[]ModelEach itemExpand List journal entries — response body — journal Entries item line Entries array item
lineEntries (anyOf 2)nullAlternative
lineEntryIdsJSONOptional
lineEntryIds (anyOf 1)arrayAlternativeThe ids of the Line Entries detailing the Journal Entry's movement of value.
lineEntryIds (anyOf 1)[]stringEach itemunique id for a line entry; emitted as base-58, but a base-16 UUID is also accepted
Format: base58 (max length 22)
lineEntryIds (anyOf 2)nullAlternative
reviewStatusJSONRequired within parent
reviewStatus (allOf 1)stringAll variants applyKnown values: unreviewed, reviewed
reviewStatus (allOf 2)JSONAll variants applyWhether the user has reviewed the journal entry. New journal entries default to `unreviewed`.
reviewStatusSetAtJSONOptional
reviewStatusSetAt (anyOf 1)JSONAlternative
reviewStatusSetAt (anyOf 1) (allOf 1)stringAll variants applyFormat: yyyy-mm-ddThh:MM:ssZ
reviewStatusSetAt (anyOf 1) (allOf 2)JSONAll variants applyWhen the review status was last set. Null if the journal entry has never been reviewed.
reviewStatusSetAt (anyOf 2)nullAlternative
transferJSONOptional
transfer (anyOf 1)JSONAlternative
transfer (anyOf 1) (allOf 1)ModelAll variants applyExpand List journal entries — response body — journal Entries item transfer from Entry, to Entry from Entry, to Entry
transfer (anyOf 1) (allOf 2)JSONAll variants applyThe transfer linking this journal entry to the journal entry on the other
side of a transfer between accounts (e.g. Stripe Payouts), if any. Included in expanded responses.
transfer (anyOf 2)nullAlternative

Referenced models: List journal entries — response body — journalEntries / item / accrualSource / type: invoice, bill, payroll type: invoice, bill, payroll, List journal entries — response body — journal Entries item autocat Result confidence, created At, id, ledger Id, method, rule Id confidence, created At, id, ledger Id, method, rule Id, List journal entries — response body — journal Entries item line Entries array item, List journal entries — response body — journal Entries item transfer from Entry, to Entry from Entry, to Entry

List journal entries — response body — journal Entries item autocat Result confidence, created At, id, ledger Id, method, rule Id confidence, created At, id, ledger Id, method, rule Id
FieldTypePresenceDescription and constraints
$objectRootThe auto-categorization decision recorded for the transaction underlying a
journal entry: how its category ledger was assigned. Mirrors AutocatResult
from teal-api:teal_api/transaction/schemas.py.
confidenceJSONRequired within parent
confidence (anyOf 1)numberAlternativeThe autocat model's confidence in the assignment, 0.0 to 1.0.
Format: double
confidence (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
createdAtJSONRequired within parent
createdAt (allOf 1)stringAll variants applyFormat: yyyy-mm-ddThh:MM:ssZ
createdAt (allOf 2)JSONAll variants applyWhen the autocat result was recorded, in UTC.
idstringRequired within parentThe unique identifier of the autocat result.
ledgerIdstringRequired within parentThe category ledger autocat assigned to the transaction.
Format: base58 (max length 22)
methodJSONRequired within parent
method (allOf 1)stringAll variants applyKnown values: rule, transactionKindDefaults, similarity, embedding, llmClassifier, transfersBetweenAccounts
method (allOf 2)JSONAll variants applyHow the category was assigned (rule/transactionKindDefaults/similarity/embedding/llmClassifier/transfersBetweenAccounts).
ruleIdJSONOptional
ruleId (anyOf 1)stringAlternativeIf method is `rule`, the id of the rule that matched; otherwise null. An
opaque identifier supplied by the external categorizer.
ruleId (anyOf 2)nullAlternative
List journal entries — response body — journalEntries / item / accrualSource / type: invoice, bill, payroll type: invoice, bill, payroll files array item
FieldTypePresenceDescription and constraints
$objectRootA file associated with an accrual source
fileNamestringRequired within parentThe name of the file
Maximum length: 299
Minimum length: 1
idstringRequired within parentThe ID of the accrual source file
Format: base58 (max length 22)
Create a product — response body — unit Price value
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)numberAlternativeA dollar amount
Format: double
$ (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

SDK function policy ID: mercury.listbooksjournalentries. Catalog operation: mercury:listBooksJournalEntries. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.