Inspiration
Roadside farm stands, office snack shelves and school bake sales all run on the same idea: take what you want, leave the money. It works because most people are honest. It breaks for a newer reason: fewer people carry cash.
Owners tape a PayPal or Venmo handle to the table. Then the customer has to add up six items in their head and type an amount, and the owner receives "$14" with no idea what was sold. Nobody knows what left the table unpaid.
We wanted to keep the trust and remove the arithmetic.
What it does
For the customer (no app, no account):
- Scan the QR code on the stall.
- Take one photo of what you are taking.
- AI recognises the items against the stall's own price list and builds an itemised cart. Lines the AI was unsure about are marked "Check this one", and every line can be corrected.
- Pay with PayPal. No wallet on you? Tap "Invoice me" and PayPal emails an invoice.
A customer can also build the cart by tapping the price list, or by typing "2 dozen eggs and a honey".
For the owner:
- Setup from one photo. Photograph the price board; AI drafts the price list; the owner confirms every price and prints an A5 QR sign.
- Live ledger. Every sale item by item, marked Paid, Invoiced or Refunded, with sort, filter, search, CSV export and a revenue-by-product chart. A sale is marked Paid only when PayPal confirms it.
- Honesty score. Photograph the shelf in the morning and the evening. AI counts the stock, the owner confirms the counts, and Trustall compares what left the shelf with what was paid for:
$$\text{honesty rate} = \frac{\sum \min(\text{paid}, \text{gone})}{\sum \text{gone}}, \qquad \text{gone} = \text{morning} - \text{evening}$$
- An assistant that asks first. The owner types "refund the last honey sale" or "send Riverside Cafe an invoice for 5 dozen eggs". The assistant shows a card with the exact action, and calls PayPal through the PayPal Agent Toolkit only after the owner presses Confirm.
How we built it
- App: Next.js (App Router) and TypeScript, deployed on Render, with Postgres through Drizzle ORM.
- AI: Anthropic Claude (
claude-sonnet-5-5). Vision with structured outputs turns a basket photo, a price board or a shelf into JSON, and every answer is validated with a zod schema before it is used. Tool calling drives the owner's assistant. - PayPal (sandbox):
- Orders v2 with the JS SDK buttons for checkout
- Invoicing v2 for "Invoice me" and for invoices the assistant sends
- Refunds on captured payments
- Webhooks (
PAYMENT.CAPTURE.COMPLETED,PAYMENT.CAPTURE.REFUNDED,INVOICING.INVOICE.PAID), each verified with PayPal's signature endpoint and processed once per event id - The PayPal Agent Toolkit for the assistant, with an allow-list of eight tools
- Sponsor tools: Render for hosting and the database; AG Grid and AG Charts for the owner's sales ledger.
- The rule we held to: AI proposes, a person confirms, our server prices the cart from its own database in whole cents, and PayPal is the source of truth for whether money moved.
Challenges we ran into
- Counting is harder than naming. The model named every product correctly, but on a full shelf it counted two stacked egg cartons where there were four, and had to judge a second row of jars behind the first. We did not try to make the model perfect. Instead, every count and every cart is shown to a person to correct before anything is saved or charged.
- A wrong cart must never become a wrong charge. The model is only allowed to return product ids from the stall's list and a quantity. It never sees or returns a price. Totals are calculated on the server, and the amount PayPal captures is checked against the cart before a sale is marked Paid.
- An agent that can move money needs a brake. The Agent Toolkit's tools run as soon as a model calls them. We give the model read-only PayPal tools directly, and wrap refunds and invoices so the model can only propose them. The real tool runs after the owner confirms, and a double tap cannot refund twice.
- Sandbox accounts in the wrong country. Our first sandbox accounts were created in India by default, and PayPal's checkout window failed with a generic error because India-to-India payments are not supported. Creating United States sandbox accounts fixed it.
- App permissions. Invoicing returned "NOT_AUTHORIZED" until we enabled the Invoicing feature on the sandbox app.
- Webhook testing. Events from PayPal's webhook simulator cannot pass signature verification, so we tested with real sandbox payments.
Accomplishments that we're proud of
- A stranger can pay at a stall with nothing installed and no account.
- The honesty score: a number no cash box or payment handle can give an owner.
- A payment agent with a real safety model: allow-listed tools, proposals in place of actions, and a confirm step in front of every PayPal write.
- 24 automated tests covering money arithmetic, cart pricing, the honesty score and webhook idempotency.
What we learned
- Vision models are good enough to replace a barcode scanner for a table of a dozen products, as long as a person confirms the result.
- The useful split is AI for perception and language, plain code for arithmetic, and PayPal for truth.
- Idempotency matters at every PayPal boundary: request ids on orders and invoices, and event ids on webhooks, so a retry never creates a second charge or a second ledger entry.
What's next for Trustall
- A fixed old phone as an always-on shelf camera, so the honesty score needs no manual photos.
- Recurring invoices for regular buyers such as a cafe.
- Paying each stall owner's own PayPal account through PayPal's multiparty onboarding.
- Round-up donations for community fridges and charity stalls.
Built With
- ag-charts
- ag-grid
- anthropic-claude
- drizzle
- nextjs
- paypal
- paypal-agent-toolkit
- postgresql
- react
- render
- tailwindcss
- typescript
- zod