Solutions

Finance & ops

The payout, tied to the invoices in it.

#financepublic channel2 tool calls

Eleven paid invoices, the fees against them and the sum, worked in the sandbox rather than recalled — with the reason the figure looked wrong named: one invoice paid two days early landed in the previous payout.

finance

Priya10:18 AM

@attest_tag what's in Friday's payout? it's £41,204.18 and I can't make it tie

attest_tagApp10:20 AM

  • http_request · GET api.stripe.com/v1/invoices?status=paid&limit=100 · 34 invoices
  • run_js · window filter, gross, fees, net · 11 in payout

It ties. £42,980.00 gross across 11 invoices, less £1,775.82 in fees, is £41,204.18.

  • Why it looked wrong — INV-0398 (£4,100, September) was paid on 2 Oct and went out in the previous payout. Two October invoices settled early and are in this one.
  • The eleven — largest is Northwind £12,000; smallest is Harrow Freight £340. Full list on request, or as a spreadsheet.

google/gemini-flash16k in520 out$0.0082Configure

Names, figures, repositories and customers are changed; token counts and cost are illustrative. The ask, and the shape of the answer, are as they were.

How the turn went

The arithmetic runs as code, and the window is the thing that was actually wrong.

  1. 01

    Worked, not recalled

    Summing eleven figures and subtracting fees happens in the sandbox, where it either runs or fails where you can see it. A model adding currency in prose is the single most confident way to be wrong by a hundred pounds, and a reconciliation that is nearly right is worse than none.

  2. 02

    The window is usually the bug

    A payout is not the invoices dated in a month; it is the ones that settled in a window. The reply names the invoice that crossed the boundary, because that is the answer — the total was never really the question.

  3. 03

    A read-only key, so anyone can ask

    The billing preset takes a restricted key with read permissions only. Nothing about an invoice, a customer or a payout can be changed through it, which is what makes it safe to attach to a channel with the people asking about money in it.

What it needs

The setup, in the console.

Connection
The Stripe preset attached to the #finance channel. Any billing system with an HTTP API does the same job through the custom preset.
Credential
A restricted key with read permissions only. Sealed with AES-256-GCM in the database; the proxy signs each request and the key is never in a prompt.
Writes policy
Irrelevant — the key carries no write at all, so there is nothing for a policy to hold.

What it will not do

Enforced outside the model.

  • Nothing about billing can be changed through this connection, whatever the ask or a field on an invoice says.

  • It will not quote a figure it did not fetch. Every number in the reply has a status line above it saying where it came from.

Try it

Say it in a channel it is in.

The sentence as it was typed. It works in any channel the bot has been invited to that carries the connection above — no command syntax, no form, and follow-ups in the thread need no mention.

@attest_tag what's in Friday's payout? it's £41,204.18 and I can't make it tie

  • Stripe
  • http_request
  • run_js

Bring the channel this would live in.

Sign up, connect the service above in one channel, and type this sentence yourself — or run the same binary on your own infrastructure.

All solutions