TL;DR
Sorted takes a UK tradesperson from job note to statutory claim, with an agent that chases within a mandate you sign. Type "2.5 hrs, new valve 18 quid, call out 45", and a PayPal invoice goes out. If it's late, Autopilot chases politely within your rules. If money is tight, it offers a PayPal payment plan. If they still won't pay, a Claim pack shows Late Payment Act interest growing daily and drafts your Letter Before Claim. The hosted demo runs on a live PayPal sandbox.
Inspiration
UK businesses are owed an estimated £26bn in late payments at any given time. Late payment closes 38 businesses every day, and owners who are affected spend 86 hours a year chasing it (Department for Business and Trade / Small Business Commissioner, 2025). The law already backs sole traders: 8% above the Bank of England rate in interest plus fixed compensation. Almost nobody claims it, because each step (invoice, chase, plan, letter) is a separate, awkward job. Sorted turns them into one flow.
What it does
- Job note → invoice. Type or dictate a note. Sorted drafts an editable GBP invoice with labour, parts, call-out, VAT and terms, then creates and sends it through PayPal Invoicing v2 with a pay link and QR code.
- Autopilot: a mandate you sign. You set your chase rules once: start after 7 days overdue, send up to a firm reminder on its own, at most one reminder per invoice a week, never at weekends or outside 8am to 6pm, and leave named customers alone. Final notices always need your OK. Then you sign them. The agent acts only inside that mandate, sending through the PayPal Agent Toolkit. Anything outside it comes back as "Needs your OK". Every decision (sent, held or skipped, with its reason) goes into an activity log you can audit, and Ask Sorted can tell you what Autopilot did.
- Payment plans, not stand-offs. When a customer can't pay in full, Sorted updates the sent PayPal invoice to accept partial payments, with a minimum amount due per instalment (£900 becomes three monthly payments of £300), and drafts the offer for you to send. The ledger shows "On plan" with paid so far and what's left, and webhooks keep it in step.
- Claim pack. For overdue business invoices, Sorted works out statutory interest under the Late Payment of Commercial Debts (Interest) Act 1998, live, per day, plus the fixed compensation band. In one click it builds a printable Letter Before Claim for you to review, with a 14-day pay-by date and the PayPal pay link. The Act only covers business debts, so private customers never get it. Each letter is labelled "Template only, not legal advice".
- Ask Sorted. "Who owes me the most?" is answered from an AG Grid ledger and an AG Studio "Money owed" dashboard.
Why not PayPal's own reminders, or generic AI invoicing?
| PayPal auto-reminders | Generic AI invoicing / chasers | Sorted | |
|---|---|---|---|
| Messy job note → invoice | – | Often | Yes, UK trade shorthand |
| Escalating tone (nudge → firm → final) | Before/after-due schedule | Some | Yes |
| Agent acts within limits you sign, with audit log | – | Rare | Signed mandate + activity log |
| Payment plan via PayPal partial payments | Manual setting | – | Agent proposes it, PayPal collects |
| Late Payment Act interest, accruing daily | – | – | Yes (business customers only) |
| Letter Before Claim draft | – | – | Yes |
| Consumer vs business legal guard rail | – | – | Enforced |
Judges: try it in 60 seconds
- Open https://sorted-paypal.vercel.app. No sign-up is needed, and it runs on a live PayPal sandbox.
- Paste a job note such as
Boiler service for Sam, [email protected], 2 hrs at 55, parts 30, vat on top, 14 days, then press Draft invoice and Send invoice via PayPal. Open the PayPal payer page from the row. - Open Autopilot, pick Firm reminder as the strongest tone it may send, untick quiet hours if it's evening or a weekend, then press Sign mandate and turn on. The activity log fills with sent, held and skipped decisions, each with its reason.
- Open an overdue row (e.g. Harbourside), press Offer a payment plan, then Set up plan and draft offer. The row turns "On plan" and PayPal now accepts part payments.
- On the Late payers card, Redland shows Letter Before Claim ready. Open it: interest to date, the daily rate, compensation and a PayPal pay link, ready to print.
- Optional: use Connect PayPal sandbox to test with your own sandbox keys. The keys stay in your browser and are pinned to the sandbox host.
What's live vs mocked
- Live (PayPal sandbox): invoice create/send/remind/cancel, partial-payment invoices, payer page, QR codes, verified webhooks, ledger sync, and Autopilot actions through the Agent Toolkit.
- AI: free-tier models with tool calling, backed by a deterministic rules engine so the app always answers.
- Demo mode: with no server keys, a mock PayPal and seeded invoices run in the browser. Nothing is emailed. In the hosted demo, Autopilot only sends to sandbox test addresses.
- Drafts only: the Claim pack writes a letter for you to review. Sorted never files a claim.
How we built it
- Next.js 16 + TypeScript on Vercel, Tailwind v4, AG Grid Community 36 and AG Studio.
- PayPal Invoicing v2: cached OAuth, create with idempotency keys, send, remind, record payment, cancel, QR codes, and
partial_payment.allow_partial_payment+minimum_amount_duefor plans. Retries on 429/5xx. - PayPal Agent Toolkit: the model calls
list_invoices,get_invoice,generate_invoice_qr_code,send_invoice_reminderandcancel_sent_invoicedirectly; anything that writes needs your OK or your signed mandate. - Signed mandate: your limits (days overdue, tone cap, cooldown, quiet hours, exclusions) are HMAC-signed into a 30-day mandate, and the server re-plans from the signed limits before every send; anything outside it needs a single-use, 10-minute approval token.
- PayPal webhooks: signature-verified paid, cancelled and partial-payment events update the ledger.
- Claim pack: daily statutory interest (8% over the Bank of England reference rate), £40/£70/£100 compensation bands, and a Letter Before Claim template following the Pre-Action Protocol structure.
Challenges
- PayPal list endpoints return summaries, so details are hydrated in small parallel batches; Agent Toolkit errors come back as data, so every result is checked before it's logged as sent.
- Making autonomy and consent coexist: the answer was a mandate signed once, plus a log proving every action stayed inside it.
Accomplishments
One continuous loop on a live sandbox (note → invoice → payer page → webhook → Autopilot → payment plan → claim pack), with zero configuration.
What we learned
Small businesses don't need a more aggressive chaser. They need the law's leverage without the awkwardness, and an agent they can trust because they set its limits.
What's next
Live PayPal onboarding, approval by text message, Welsh-language letters, a Making Tax Digital export and the new late-payment rules as the Small Business Protections Bill progresses.
Built With
- ag-grid
- ag-studio
- gpt-oss
- groq
- groq-qwen
- nextjs
- paypal-agent-toolkit
- paypal-invoicing-api
- paypal-partial-payments
- paypal-rest-api
- paypal-webhooks
- react
- tailwindcss
- typescript
- vercel
- web-speech-api