Sum a week's missing invoices
well_sum_missing_invoicesThe missing supplier invoices of one ISO week that has ended, as one total: how many suppliers still miss an invoice, and the spend they cover, in the currency of the lines and converted to the workspace base currency. It returns no rows.
week is an ISO week, YYYY-Www (Monday to Sunday), for example 2026-W40. A week has ended when its Sunday has ended in the workspace time zone. Omit it to read the last week that has ended. A refusal carries error_code: week_invalid for a week its year does not have (a week 53 in a 52-week year), week_not_ended for a week that has not ended yet, no_workspace when no workspace is in context, read_failed when the read of the week failed.
supplier_count counts the suppliers that still miss an invoice, with the gaps and the row rule of the missing-invoices card. total is the spend those suppliers cover, converted to currency (the workspace base currency). It is null when a line has no exchange rate for its date: a partial sum would read as the whole figure. It covers the named suppliers' groups only, so it is not the conversion of a net below, which also holds the groups with no named supplier.
totals_by_currency is the money of the week still missing an invoice, ONE set per currency in the lines' own currency (the currency the bank lines are in), in major units: gross, the copies and own_company movements it holds, and net, the figure to quote. Never add two sets, and never convert one. It is null when the figures could not be read. totals_unreadable_count counts the lines with no readable amount, which sit in no figure.
bank_connected is true when the workspace has a bank feed connected: synced, syncing, or in error. It is false when no bank feed is connected, or every one is disabled or not set up. Only a live bank feed counts: a workspace with imported bank statements only reads false too. Then Well sees no bank spend for the week, so its figures cannot say that nothing is missing: the week could not be checked.
pending_count counts the transactions of those suppliers whose candidate invoice already waits for a confirmation. They are in supplier_count and total, as on the card. unattributed_group_count counts the groups of spend with no named supplier. They are not in supplier_count or total, and they are in totals_by_currency. candidates_truncated: true means the scan filled its page, so supplier_count, total and pending_count are floors; totals_by_currency is read apart and still covers every line.
This tool reads the user's data and changes none of it.
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 |
|---|---|---|---|
| week | No | ISO week that has ended, YYYY-Www (Monday to Sunday). Omit it for the last ended week. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Sunday of the week, YYYY-MM-DD, inclusive. | |
| from | No | Monday of the week, YYYY-MM-DD. | |
| week | No | ||
| error | No | ||
| total | No | The named suppliers' groups only, in the base currency. Null when a line has no exchange rate. | |
| success | Yes | ||
| currency | No | The workspace base currency (ISO 4217) `total` is converted to. Write `total` with its symbol or code, never the currency of the person's language. | |
| error_code | No | ||
| workspace_id | No | ||
| pending_count | No | ||
| bank_connected | No | True when a bank feed is connected (synced, syncing or in error). False means the week could not be checked. | |
| supplier_count | 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. | |
| resolved_workspace | No | The workspace that answered, when the caller named none and the token authorizes several. | |
| totals_by_currency | No | The week's money still missing an invoice, one set per currency in the lines' own currency. Null when unreadable. | |
| candidates_truncated | 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. | |
| totals_unreadable_count | No | Lines with no readable amount, in no figure of `totals_by_currency`. Null with it. | |
| unattributed_group_count | No |