Sum payslips
well_sum_payslipsThe payroll total of a window of whole months, summed on the server from the payslips: gross pay, net pay, employee deductions, employer charges and the payslip cost, one group per currency, and per month when axes holds "month". It draws nothing.
Use it for any payroll or payslip total: "what did payroll cost last month", "total employer charges this quarter", "masse salariale", "coût employeur total". State the figures it returns and never add payslip amounts yourself, and never sum payslips with well_query_records or a records statistic: this read applies one rule on every surface, so the same question gives the same figure. For the payslips behind a figure, read the rows with well_show_records.
The window is from (inclusive) to to (exclusive), each the first day of a month as YYYY-MM-01, at most 12 months, cut on the pay period end. One month is from: "2026-09-01", to: "2026-10-01".
The rule is fixed, and rule echoes it. Statuses summed: approved and paid, and a payslip with no status, unless statuses names others. employee_deductions adds each deduction line by its magnitude; employer_charges adds the charge lines as printed, so a negative one is a reversal. Memo lines count nowhere. payslip_cost is gross_pay + employer_charges.
Every figure is per currency and never converted. Do not add two groups of different currencies.
What the figures leave out is returned so you can say it: gross_unread_count and net_unread_count (payslips that printed no amount there, in no total: say unread, never zero), unclassified_line_count and unclassified_line_amount (lines with no side, in no side total), held_back (payslips of other statuses, by status: drafts, pending, cancelled), unplaced_count (no pay period end, in no window) and no_currency_count.
People floor. On a WhatsApp turn each amount needs at least 3 people (distinct employment contracts) behind it: payslips that printed it for gross_pay and net_pay, deduction or charge lines for employee_deductions and employer_charges, both of those for payslip_cost. A person counts toward an amount only when their share of it is not zero: a payslip or line of 0.00, or none, adds no one. An amount under 3 people, or a total over several months where one month is under 3 people for it, is null and listed in suppressed as { amount, reason: "below_people_floor" }. unclassified_line_amount is always null there (reason: "not_on_whatsapp"). State the amounts that remain and say the others show in the Well web app. On WhatsApp payslip_count and contract_count are null and meets_people_floor says whether at least 3 people of the group have a non-zero gross or net pay: never state or guess a headcount there. On WhatsApp omit statuses; the read refuses it there. Never rebuild a held-back amount from other reads, other amounts or other windows. There is no per-person total.
partial: true means part of the payroll is not in the figures, and partial_reasons says why: read_cut_short (a read was cut short and a figure may be a floor) or currency_cap (the window holds more than 4 currencies; currencies_not_summed names those in no group, so say they are left out) or deadline (the read ran out of time: months_not_summed names the months in no group, so say those months are missing and never read them as zero; a month with no group that is not listed there had no payslip to sum). When success is false the read failed: the empty groups is not a measured zero.
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 |
|---|---|---|---|
| to | Yes | EXCLUSIVE end of the window: the first day of the month after the last one, YYYY-MM-01. | |
| axes | No | ["month"] for one group per month and currency. Omit for one group per currency over the window. | |
| from | Yes | Inclusive start of the window: the first day of a month, YYYY-MM-01. | |
| statuses | No | The payslip statuses to sum. Omit for the rule's default (approved, paid and no status). | |
| 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 |
|---|---|---|---|
| axes | Yes | ||
| rule | Yes | ||
| error | No | ||
| groups | Yes | ||
| window | Yes | ||
| partial | Yes | ||
| success | Yes | ||
| statuses | Yes | ||
| held_back | Yes | ||
| unplaced_count | Yes | ||
| 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. | |
| partial_reasons | Yes | ||
| months_not_summed | Yes | ||
| no_currency_count | Yes | ||
| no_status_counted | Yes | ||
| 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. | |
| people_floor_applied | Yes | ||
| currencies_not_summed | Yes | ||
| 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. |