Compare supplier quotes
well_compare_quotesCompare the supplier quotes of one comparison group, read from the quote documents the workspace received. It writes nothing.
A comparison group is set by a person, never guessed: well_group_quotes puts quotes in one. Call this with quote_request_id to compare that group, or with no argument to list the groups (requests, each with its quote_count, the 20 newest) and the quotes no group holds yet (ungrouped_quotes).
With a group, each quote carries its supplier, its source document_id, valid_until, currency, items_total, tax_total, grand_total (decimal strings in major units of that currency) and its lines in printed order (label, quantity, unit price, line total), every amount as the quote prints it. expired is true when valid_until is before today.
Ranking is per currency only (currency_groups): rank_in_currency 1 is the lowest total among the quotes of that currency still on offer. Equal totals share a rank, and lowest_supplier_quote_id is null when several quotes share the lowest total: name each of them. An expired quote, a quote with no total and a quote with no currency are not ranked (rank_exclusion). When mixed_currencies is true, never add, convert or rank totals across currencies: say the quotes are in different currencies and show each in its own. Quote every figure as returned, with its supplier; never compute a total or a unit price the quote does not state.
The comparison is computed on each call from the stored quotes, as of as_of. url is the link to share it: a signed-in page that only the workspace's members (never a guest) can open, and that recomputes the comparison each time it opens. The link carries no data and no session of its own, so it is not a snapshot: give it as the way to see the comparison stay current, and never call it public.
refusal_reason: "request_not_found" (no such group in this workspace), "no_workspace", "read_failed".
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 |
|---|---|---|---|
| workspace_id | No | Target workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose 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. | |
| 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. | |
| quote_request_id | No | The comparison group to compare. Omit it to list the groups and the quotes no group holds yet. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | The link to the signed-in page that shows this comparison live to the workspace's members. Null when this deployment has no web app address. | |
| as_of | No | ||
| error | No | ||
| quotes | No | ||
| request | No | ||
| success | Yes | ||
| requests | No | ||
| refusal_reason | 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. | |
| currency_groups | No | ||
| 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. | |
| mixed_currencies | No | ||
| ungrouped_quotes | No | ||
| resolved_workspace | No | The workspace that answered, when the caller named none and the token authorizes several. | |
| 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. |