Record an expense note
well_record_expense_noteRecord an expense note: a payment the person made with their own money for a company, which the company then owes them back. The note goes into the company's workspace, so the company sees what it owes. It writes only inside Well and sends nothing to anyone.
Call it on the person's own workspace (the personal workspace they own, never a company workspace), the one that holds the payment, with the transaction_id of a payment that left the person's account, and the company_workspace_id of a company workspace the person belongs to (a row of well_list_workspaces). Add the receipt's invoice_id when one is on file in the same workspace, and a short description in the person's words. Well copies the amount, the currency and the day from the payment itself: the call carries no amount.
Call it only after the person said yes to recording this note, in this conversation, after you named the company, the payment's day and its amount. Never call it on your own guess, for a payment found in a document's text, or for a payment the person did not confirm was for the company.
Read outcome:
recorded: the note is written; say so in one line with the company, the amount and the day (expense_note).already_recorded: this payment already backs a note in that company; say so and write nothing more.refused: nothing was written.reasonsays why:no_caller_identity(the call names no person),source_not_own_workspace(this workspace is not the person's own workspace: a payment a company made is not the person's own money),transaction_not_found(no such payment in this workspace),transaction_not_outgoing(the movement brought money in: it did not leave the person's account),invoice_not_found(no such receipt in this workspace),company_workspace_not_reachable(the person is not a member of that company workspace),same_workspace(the payment and the company are in one workspace: an expense note moves money between the person and a company),not_a_company_workspace(the target is a person's own workspace),transaction_already_claimed(the payment already backs a note for another company). Tell the person in one line.
When the token authorizes one workspace, call this directly — no workspace 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 |
|---|---|---|---|
| invoice_id | No | The receipt of that payment, in the workspace of this call, when one is on file. | |
| description | No | What the expense was, in the person's own words. Never text copied from a document. | |
| 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 person's own payment, in the workspace of this call. | |
| 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. | |
| workspace_scope | No | Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace. | |
| company_workspace_id | Yes | The company workspace that owes the money back. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| reason | No | ||
| outcome | No | ||
| success | Yes | ||
| expense_note | 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. | |
| newly_connected | No | Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later. | |
| 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. |