Assign missing-invoice owners
well_assign_missing_invoice_ownersSet the owner SET of the missing-invoice TRANSACTIONS you name — the only write for missing-invoice ownership.
REQUIRED: transaction_ids — the settled lines still missing a supplier invoice, from well_list_missing_invoice_owners. owner_person_ids — the people who together owe those invoices; pass an EMPTY array to clear the owners.
Ownership is per TRANSACTION and is a SET, not one owner and not a card rule. The write REPLACES the owner set on every named transaction: the people you send become its owners and anyone not sent is removed. Assigning several people to a (counterparty × month) gap creates ONE proof task per distinct person, and ONE supplier invoice resolves every owner's task for that gap — the fan-out is for accountability, not for N separate collections. Tell the user this plainly.
Each person_id must already be a member of the workspace (get them with well_query_records on people). A person outside the workspace is refused (refusal_reason NOT_FOUND), not silently dropped.
Closed periods are frozen: a transaction whose fiscal month already closed refuses the whole batch (refusal_reason CLOSE_OWNER_PERIOD_FROZEN) rather than rewriting a committed close. A transaction id the workspace does not own refuses the batch too (refusal_reason NOT_FOUND).
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. | |
| 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. | |
| transaction_ids | Yes | The missing-invoice transactions to assign, from well_list_missing_invoice_owners. | |
| owner_person_ids | Yes | The workspace people who together own these transactions' missing invoices; an empty array clears the owners. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| success | Yes | ||
| owner_count | No | How many people own each of those transactions after the write. | |
| refusal_reason | No | The WellError code when the write is refused — CLOSE_OWNER_PERIOD_FROZEN for a closed month, NOT_FOUND for a person outside the workspace or a transaction the workspace does not own. | |
| 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. | |
| refusal_details | No | Structured facts a refusal code alone does not carry — for CLOSE_OWNER_PERIOD_FROZEN, the frozen `{ fiscalYear, fiscalPeriod }`. A NOT_FOUND names the offending id in `error` instead. | |
| transaction_ids | No | The distinct transactions whose owner set the write replaced. | |
| owner_person_ids | No | The explicit owner set written to every named transaction; empty when the owners were cleared. | |
| transaction_count | No | How many distinct transactions the write touched. | |
| 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. |