Attach a receipt to a payment
well_link_receipt_to_transactionAttach a stored receipt to the payment the member picked from well_list_receipt_candidates. Well records the pick as a confirmed match, decided by a person, and puts the receipt on that payment. A later automatic match never replaces it.
Call it only after the member answered the numbered list with the number of a payment, with the document_id of that list and the picked payment's transaction_id. The member's answer is the consent: do not ask again. Never call it on your own guess, and never for the last choice (none of them).
Read outcome:
linked: confirm in one line with the payment's date, payee (transaction.label) and amount (for example « Reçu rattaché au paiement du 03/10 (Le Comptoir, 42,50 €). »).transaction.amountis signed: an outflow is negative. Say it without the minus sign.already_linked: the receipt was already on this payment; say so.ask_document_kind: Well read no receipt or invoice in this document; ask what it is (a receipt, a supplier invoice, or something else).refused: nothing was written.reasonsays why:transaction_not_found(no such payment here),transaction_has_other_document(that payment already holds another document, which Well never replaces),over_allocated(the receipt or the payment is already settled),invalid(Well cannot match this pair),settled_by_other_invoice(another invoice already settles that payment),wrong_direction(that payment moves the wrong way for this receipt),not_offered(that payment is not one the list offers for this receipt now: offer the list again),receipt_linked_elsewhere(the receipt already sits on another payment: say it is already attached to a payment, and do not offer the list again),document_not_read(Well is still reading the document: say you will try again in a moment). Tell the member in one line. Offer the list again for every reason exceptreceipt_linked_elsewhereanddocument_not_read.
It writes only inside Well.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | The stored document of the receipt, as `well_list_receipt_candidates` read it. | |
| 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 payment the member picked by its number. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| reason | No | ||
| outcome | No | ||
| receipt | No | ||
| success | Yes | ||
| document_id | No | ||
| transaction | No | ||
| 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. | |
| 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. |