Set a transaction's ledger account
well_set_transaction_ledger_accountAttach ONE transaction to the ledger account its journal entry should post to — the write that clears a posting gap.
REQUIRED: transaction_id, from well_list_unposted_transactions. ledger_account_id — an account id from that read's ledgerCatalog, or from the row's own ledger_suggestions. Pass null to DETACH the account rather than to leave it unchanged; omitting the field is not how you clear one, because the field is required here.
Attaching the account does not, on its own, clear the gate. The worklist selects on posting attempts, not on whether an account is present, so a row you attach and leave will come back on the next read. Posting is what clears it.
Set no_invoice_expected: true to post the entry in the same call. Send it ONLY for a row whose expects_supplier_invoice is false on well_list_unposted_transactions, which is the read that carries that field: it asserts that no supplier invoice is coming, which is what makes the transaction bookable on its own. A row still waiting for its invoice must be attached WITHOUT it — the invoice is its blocker, and posting early books an entry the invoice would then contradict.
Omit the field and nothing posts: the account is recorded and the row stays on the worklist.
Most categories already imply their account — the chart maps each category key to a canonical code — so reach for this for the rows the category alone cannot settle, and for a deliberate override.
When the token authorizes one workspace, call this directly — no other tool call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | No | Target workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say which. | |
| transaction_id | Yes | The transaction to attach, from well_list_unposted_transactions. | |
| conversation_id | No | The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation. | |
| idempotency_key | No | Optional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation. | |
| ledger_account_id | Yes | The ledger account to attach. `null` DETACHES the account currently on the row. | |
| no_invoice_expected | No | Assert no supplier invoice is coming, and post the entry to the attached account in the same call. Only for a row whose `expects_supplier_invoice` is false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| posted | No | ||
| success | Yes | ||
| transaction_id | No | ||
| conversation_id | No | The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation. | |
| posting_outcome | No | ||
| conversation_id_note | No | Present only when the server opened a fresh lane, stating that no choice recorded earlier was read. | |
| conversation_id_source | No | Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened. |