Mercury: Update multiple journal entries
Mercury books.bulkUpdateBooksJournalEntries: arguments, response, policy and SDK examples.
← Books operations · Get started
Operation mercury.bulkupdatebooksjournalentries
Provider route: PUT /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"]["bulkUpdateBooksJournalEntries"]>[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.bulkUpdateBooksJournalEntries(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.bulk_update_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 |
body | Model | Optional | Expand Update multiple journal entries — request body — body |
Referenced models: Update multiple journal entries — request body — body
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 |
|---|---|---|---|
$ | JSON | Root |
Schemas
Section titled “Schemas”Update multiple journal entries — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Request to update multiple journal entries in a single call. Additional keys: not allowed |
updates | array | Required within parent | The individual journal entry updates |
updates[] | Model | Each item | Expand Update multiple journal entries — request body — body updates item |
Referenced models: Update multiple journal entries — request body — body updates item
Update multiple journal entries — request body — body updates item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Request to update a single journal entry. Additional keys: not allowed |
datetime | JSON | Optional | |
datetime (anyOf 1) | JSON | Alternative | |
datetime (anyOf 1) (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
datetime (anyOf 1) (allOf 2) | JSON | All variants apply | Updated date and time |
datetime (anyOf 2) | null | Alternative | |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | Updated description Format: size < 513 |
description (anyOf 2) | null | Alternative | |
journalEntryId | string | Required within parent | The ID of the journal entry to update Format: base58 (max length 22) |
lineEntryChanges | JSON | Optional | |
lineEntryChanges (anyOf 1) | JSON | Alternative | |
lineEntryChanges (anyOf 1) (allOf 1) | Model | All variants apply | Expand Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update |
lineEntryChanges (anyOf 1) (allOf 2) | JSON | All variants apply | Changes to apply to line entries |
lineEntryChanges (anyOf 2) | null | Alternative | |
reviewStatus | JSON | Optional | |
reviewStatus (anyOf 1) | JSON | Alternative | |
reviewStatus (anyOf 1) (allOf 1) | string | All variants apply | One of: unreviewed, reviewed |
reviewStatus (anyOf 1) (allOf 2) | JSON | All variants apply | New review status for the journal entry. Omit to leave the existing review status unchanged. |
reviewStatus (anyOf 2) | null | Alternative |
Referenced models: Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update
Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Line entry changes to apply to a journal entry: create, update, or delete. Additional keys: not allowed |
create | JSON | Optional | |
create (anyOf 1) | array | Alternative | New line entries to add |
create (anyOf 1)[] | Model | Each item | Expand Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update create New line entries to add item |
create (anyOf 2) | null | Alternative | |
delete | JSON | Optional | |
delete (anyOf 1) | array | Alternative | IDs of line entries to remove |
delete (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) |
delete (anyOf 2) | null | Alternative | |
update | JSON | Optional | |
update (anyOf 1) | array | Alternative | Existing line entries to modify |
update (anyOf 1)[] | Model | Each item | Expand Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update update Existing line entries to modify item |
update (anyOf 2) | null | Alternative |
Referenced models: Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update create New line entries to add item, Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update update Existing line entries to modify item
Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update create New line entries to add item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A new line entry to create within an existing journal entry. Additional keys: not allowed |
amount | JSON | Required within parent | |
amount (allOf 1) | number | All variants apply | A dollar amount Format: double |
amount (allOf 2) | JSON | All variants apply | The amount for this line entry |
debitCredit | JSON | Required within parent | |
debitCredit (allOf 1) | string | All variants apply | One of: debit, credit |
debitCredit (allOf 2) | JSON | All variants apply | Whether this line entry is a debit or credit |
description | string | Required within parent | Description of the line entry Format: size < 4001 |
ledgerId | string | Required within parent | The ledger this line entry is posted to Format: base58 (max length 22) |
sortOrder | JSON | Optional | |
sortOrder (anyOf 1) | integer | Alternative | Optional position within the journal entry. Omit to append at MAX(sort_order) + 1. Maximum: 9223372036854776000 Minimum: -9223372036854776000 |
sortOrder (anyOf 2) | null | Alternative | |
tagIds | JSON | Optional | |
tagIds (anyOf 1) | array | Alternative | Optional tags to associate with this line entry |
tagIds (anyOf 1)[] | 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) |
tagIds (anyOf 2) | null | Alternative |
Update multiple journal entries — request body — body updates item line Entry Changes Changes to apply to line entries create, delete, update update Existing line entries to modify item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Updates to apply to an existing line entry. Additional keys: not allowed |
amount | JSON | Optional | |
amount (anyOf 1) | JSON | Alternative | |
amount (anyOf 1) (allOf 1) | number | All variants apply | A dollar amount Format: double |
amount (anyOf 1) (allOf 2) | JSON | All variants apply | Updated amount |
amount (anyOf 2) | null | Alternative | |
debitCredit | JSON | Optional | |
debitCredit (anyOf 1) | JSON | Alternative | |
debitCredit (anyOf 1) (allOf 1) | string | All variants apply | One of: debit, credit |
debitCredit (anyOf 1) (allOf 2) | JSON | All variants apply | Updated debit/credit designation |
debitCredit (anyOf 2) | null | Alternative | |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | Updated description Format: size < 4001 |
description (anyOf 2) | null | Alternative | |
id | string | Required within parent | The ID of the line entry to update Format: base58 (max length 22) |
ledgerId | JSON | Optional | |
ledgerId (anyOf 1) | string | Alternative | Updated ledger Format: base58 (max length 22) |
ledgerId (anyOf 2) | null | Alternative | |
sortOrder | JSON | Optional | |
sortOrder (anyOf 1) | integer | Alternative | Updated position within the journal entry. Omit to leave unchanged. Maximum: 9223372036854776000 Minimum: -9223372036854776000 |
sortOrder (anyOf 2) | null | Alternative | |
tagIds | JSON | Optional | |
tagIds (anyOf 1) | array | Alternative | Updated tags |
tagIds (anyOf 1)[] | 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) |
tagIds (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: mercury.bulkupdatebooksjournalentries. Catalog operation: mercury:bulkUpdateBooksJournalEntries. 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.