Get billed product revenue
well_get_stripe_product_revenueRead billed Stripe invoice-line revenue by product over a half-open issue-date window. Revenue is the sum of eligible issued invoice lines, not cash received or margin. The read preserves separate currency totals and never converts currencies. Lines with a price but no live product are in unknown_price_totals; lines with no Stripe price and no live product are in no_price_totals. These buckets stay unattributed. total_sales_by_currency is the complete denominator for the returned scope, including both buckets. Each product total has share_of_total_percent calculated from that denominator in percentage points with two decimals (90.16 means 90.16%); the share is null when the denominator is unavailable or zero. Product identity is the public product UUID, so two products with the same name remain separate. Product totals combine monthly and yearly variants for the same product and currency; product_intervals keeps those detail rows. No ordering or ranking is implied by this tool.
Pass from as the first issue date to include and to as the first issue date to exclude, both YYYY-MM-DD and no more than 366 days apart. scope defaults to this workspace. Pass all_my_workspaces for an unqualified WhatsApp question and whenever the person asks across their workspaces. Each workspace stays labeled. Global totals combine only connected workspaces with readable successful data. A workspace with no live Stripe connection stays named in its workspace block, is excluded from global totals, and does not block totals from connected workspaces. Global totals are null when a workspace is omitted, unreadable, incomplete, failed, unknown, or when no connected workspace has readable data; the workspace block reports that state instead of returning a zero. A processing connector with prior successful data is included and labeled refreshing; its sync_notice says a Stripe sync is running, figures may still move, and includes the last successful sync timestamp. A first sync without prior successful data stays unknown. The result includes no provider call.
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 | First issue date to exclude, YYYY-MM-DD. | |
| from | Yes | First issue date to include, YYYY-MM-DD. | |
| scope | No | Read this workspace alone or all_my_workspaces across the authorized real workspaces of the signed-in person. Use all workspaces for an unqualified WhatsApp question and when the person asks across their workspaces. | |
| 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 | ||
| from | No | ||
| error | No | ||
| scope | No | ||
| success | Yes | ||
| workspaces | No | ||
| product_totals | 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. | |
| no_price_totals | 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. | |
| unknown_price_totals | No | ||
| 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. | |
| total_sales_by_currency | No | ||
| all_workspaces_product_totals | No | ||
| all_workspaces_no_price_totals | No | ||
| all_workspaces_unknown_price_totals | No |