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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.booksId | string | Optional | The Books instance to act on. Must be the token organization’s own instance, which it defaults to. Format: uuid |
query.startDate | string | Optional | Only return Journal Entries after the start date (inclusive). Format: date |
query.endDate | string | Optional | Only return Journal Entries before the end date (inclusive). Format: date |
query.ledgerId | string | Optional | Only return Journal Entries where at least one Line Entry belongs to the specified Ledger. Format: base58 (max length 22) |
query.creationSource | string | Optional | Only return Journal Entries with the specified creation source. One of: manual, transaction, accrual, paymentApplication, legacy, scheduledAccrual |
query.creationSources | array | Optional | Comma-separated list of creation sources. Only return Journal Entries whose creation source matches one of the specified values. |
query.creationSources[] | string | Each item | One of: manual, transaction, accrual, paymentApplication, legacy, scheduledAccrual |
query.journalEntrySort | string | Optional | The 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.expand | string | Optional | Comma-separated list of expandable paths. One of: lineEntries, lineEntriesTransactions, lineEntriesLedger, lineEntriesOpposingLedgerIds, lineEntriesPaymentApplications, lineEntriesLinePaymentApplications, accrualSource, transfer, autocatResult |
query.pageToken | string | Optional | token for pagination |
query.keywords | string | Optional | Only return Journal Entries where the description matches the specified keyword(s). |
query.amount | number | Optional | Only 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.minAmount | number | Optional | Only return journal entries with a monetary amount of at least the specified amount. Ignored if `amount` is set. Format: double |
query.maxAmount | number | Optional | Only return journal entries with a monetary amount less than specified amount. Ignored if `amount` is set. Format: double |
query.ledgerIdGroups | array | Optional | A 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[] | string | Each item | unique id for a ledger; emitted as base-58, but a base-16 UUID is also accepted Format: base58 (max length 22) |
query.limit | integer | Optional | The maximum number of journal entries to return per page, from 1 to 1000. Defaults to 50. Default: 50 Maximum: 1000 Minimum: 1 |
query.tagIds | array | Optional | Comma-separated list of tag IDs. Only return Journal Entries with at least one of the specified tags. |
query.tagIds[] | string | Each item | unique id for a tag; emitted as base-58, but a base-16 UUID is also accepted Format: base58 (max length 22) |
query.categorizationStatus | array | Optional | Comma-separated list of categorization statuses (‘pending’, ‘delayed’, ‘completed’, ‘notAttempted’). Only return Journal Entries whose categorization status matches one of the specified values. |
query.categorizationStatus[] | string | Each item | One of: pending, delayed, completed, notAttempted |
query.reviewStatus | array | Optional | Comma-separated list of review statuses (‘unreviewed’, ‘reviewed’). Only return Journal Entries whose review status matches one of the specified values. |
query.reviewStatus[] | string | Each item | One of: unreviewed, reviewed |
query.categorizationMethod | array | Optional | Comma-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[] | string | Each item | One of: ai, rule, user, matched, uncategorized |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List journal entries — response body |
Referenced models: List journal entries — response body
Schemas
Section titled “Schemas”25 more schemas are linked from the tables above, on the schema pages.
List journal entries — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Response containing a paginated list of journal entries. |
journalEntries | array | Required within parent | The journal entries matching the query |
journalEntries[] | Model | Each item | Expand List journal entries — response body — journal Entries item |
nextPageToken | JSON | Optional | |
nextPageToken (anyOf 1) | string | Alternative | Token to fetch the next page of results |
nextPageToken (anyOf 2) | null | Alternative | |
prevPageToken | JSON | Optional | |
prevPageToken (anyOf 1) | string | Alternative | Token to fetch the previous page of results |
prevPageToken (anyOf 2) | null | Alternative |
Referenced models: List journal entries — response body — journal Entries item
List journal entries — response body — journal Entries item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accrualSource | JSON | Optional | |
accrualSource (anyOf 1) | JSON | Alternative | |
accrualSource (anyOf 1) (allOf 1) | Model | All variants apply | Expand List journal entries — response body — journalEntries / item / accrualSource / type: invoice, bill, payroll type: invoice, bill, payroll |
accrualSource (anyOf 1) (allOf 2) | JSON | All variants apply | The accrual source for the journal entry, if applicable. Included in expanded responses. |
accrualSource (anyOf 2) | null | Alternative | |
autocatResult | JSON | Optional | |
autocatResult (anyOf 1) | JSON | Alternative | |
autocatResult (anyOf 1) (allOf 1) | Model | All variants apply | Expand 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) | JSON | All variants apply | How 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) | null | Alternative | |
categorizationStatus | JSON | Required within parent | |
categorizationStatus (allOf 1) | string | All variants apply | Known values: pending, delayed, completed, notAttempted |
categorizationStatus (allOf 2) | JSON | All variants apply | The 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. |
creationDate | JSON | Required within parent | |
creationDate (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
creationDate (allOf 2) | JSON | All variants apply | The date and time the journal entry was created |
creationSource | JSON | Required within parent | |
creationSource (allOf 1) | string | All variants apply | Known values: manual, transaction, accrual, paymentApplication, legacy, scheduledAccrual |
creationSource (allOf 2) | JSON | All variants apply | The 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). |
datetime | JSON | Required within parent | |
datetime (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
datetime (allOf 2) | JSON | All variants apply | The datetime the Journal Entry was created in UTC time |
description | string | Required within parent | An arbitrary string on the object, useful for displaying to the user. Format: size < 513 |
id | string | Required within parent | The unique ID of the object. Format: base58 (max length 22) |
isOpeningBalance | boolean | Required within parent | Whether the Journal Entry represents an opening balance. |
lineEntries | JSON | Optional | |
lineEntries (anyOf 1) | array | Alternative | List of Line Entries. Included in expanded responses. |
lineEntries (anyOf 1)[] | Model | Each item | Expand List journal entries — response body — journal Entries item line Entries array item |
lineEntries (anyOf 2) | null | Alternative | |
lineEntryIds | JSON | Optional | |
lineEntryIds (anyOf 1) | array | Alternative | The ids of the Line Entries detailing the Journal Entry's movement of value. |
lineEntryIds (anyOf 1)[] | string | Each item | unique 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) | null | Alternative | |
reviewStatus | JSON | Required within parent | |
reviewStatus (allOf 1) | string | All variants apply | Known values: unreviewed, reviewed |
reviewStatus (allOf 2) | JSON | All variants apply | Whether the user has reviewed the journal entry. New journal entries default to `unreviewed`. |
reviewStatusSetAt | JSON | Optional | |
reviewStatusSetAt (anyOf 1) | JSON | Alternative | |
reviewStatusSetAt (anyOf 1) (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
reviewStatusSetAt (anyOf 1) (allOf 2) | JSON | All variants apply | When the review status was last set. Null if the journal entry has never been reviewed. |
reviewStatusSetAt (anyOf 2) | null | Alternative | |
transfer | JSON | Optional | |
transfer (anyOf 1) | JSON | Alternative | |
transfer (anyOf 1) (allOf 1) | Model | All variants apply | Expand List journal entries — response body — journal Entries item transfer from Entry, to Entry from Entry, to Entry |
transfer (anyOf 1) (allOf 2) | JSON | All variants apply | The 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The 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. |
confidence | JSON | Required within parent | |
confidence (anyOf 1) | number | Alternative | The autocat model's confidence in the assignment, 0.0 to 1.0. Format: double |
confidence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
createdAt | JSON | Required within parent | |
createdAt (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
createdAt (allOf 2) | JSON | All variants apply | When the autocat result was recorded, in UTC. |
id | string | Required within parent | The unique identifier of the autocat result. |
ledgerId | string | Required within parent | The category ledger autocat assigned to the transaction. Format: base58 (max length 22) |
method | JSON | Required within parent | |
method (allOf 1) | string | All variants apply | Known values: rule, transactionKindDefaults, similarity, embedding, llmClassifier, transfersBetweenAccounts |
method (allOf 2) | JSON | All variants apply | How the category was assigned (rule/transactionKindDefaults/similarity/embedding/llmClassifier/transfersBetweenAccounts). |
ruleId | JSON | Optional | |
ruleId (anyOf 1) | string | Alternative | If method is `rule`, the id of the rule that matched; otherwise null. An opaque identifier supplied by the external categorizer. |
ruleId (anyOf 2) | null | Alternative |
List journal entries — response body — journalEntries / item / accrualSource / type: invoice, bill, payroll type: invoice, bill, payroll files array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A file associated with an accrual source |
fileName | string | Required within parent | The name of the file Maximum length: 299 Minimum length: 1 |
id | string | Required within parent | The ID of the accrual source file Format: base58 (max length 22) |
Create a product — response body — unit Price value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | number | Alternative | A dollar amount Format: double |
$ (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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.