Inspiration

In my country Nicaragua, and across Latin America, buying from a stranger online is an act of faith. You find the item on a marketplace or a social media post, you agree on a price, and then nobody wants to move first. The buyer is afraid of paying and receiving an empty box. The seller is afraid of shipping and then hearing "it never arrived". Most of the time the conversation simply ends there, and a sale that both people wanted is lost.

The usual answers do not fit. Meeting in person is not possible across cities, cash on delivery shifts all the risk to the seller, and nobody will pay a lawyer or wait weeks for a support ticket over a 25 dollar item. Escrow solves half the problem, because someone holds the money, but classic escrow needs a person to judge every argument, and that person costs more than the sale.

So we asked: can an AI, working inside strict rules, settle the common cases on evidence alone, and leave people only the cases that truly need them?

What it does

Evenhand sits between buyer and seller:

  1. The seller creates a deal and shares a link. The buyer pays with PayPal, and the platform holds the money. The seller cannot touch it.
  2. The seller proves the parcel with three photos: the item, the item in its box, and the sealed parcel with its shipping label. A code from the deal must be handwritten in two of them, so old or borrowed photos fail.
  3. A vision model reads the label (carrier, tracking number, weight, date) and compares the item with the listing. Rules, not a confidence score, decide: ship, ask for specific new photos, or cancel and refund the buyer.
  4. The money moves last. The seller is paid when the buyer confirms receipt or automatically after a deadline. If the buyer opens a dispute, the AI compares both sides' photos and releases or refunds on its own. Only a real contradiction goes to a human mediator.

For example, the weight on the label must fit the product. With \(w_g\) the weight on the label and \(w_e\) the model's estimate for the product with its packing, the deal ships only if

$$\frac{|w_g - w_e|}{w_e} \le 0.25$$

A rule like that is easy to explain to both sides, which matters more than a clever score.

How we built it

  • PayPal (sandbox): Orders v2 to create and capture the payment, Payments v2 for refunds, Payouts v1 to pay the seller, shipment tracking to attach the carrier and tracking number read from the label, and Webhooks with signature verification. A deal only becomes held, released or refunded when PayPal's webhook confirms it, and every call carries an idempotency key stored before the call is sent.
  • AI: a vision model (Qwen3.8-27B on Nebius) through the Vercel AI SDK. Its output is validated with Zod; an invalid answer or a timeout is retried once and then sent to a person, so a failed call never moves money.
  • Rules and a state machine: the model only reports findings. A pure rules module decides, and a single state machine is the only code allowed to call the payout and refund APIs, logging every transition.
  • Fraud checks without AI: the handwritten code, label dates, tracking formats per carrier, reused photos (SHA-256) and edited photos (EXIF).
  • App: Next.js 16, React 19, TypeScript, Tailwind CSS, Supabase (Postgres, private storage, Realtime) and Vercel. The mediator queue is built with AG Grid.
  • Eval: a 12-case runner that sends real photos through the production audit and arbitration with the real model.

Challenges we ran into

Being fair to honest people. It is easy to build a checker that stops fraud by stopping everyone. Our first eval run did exactly that: a handwritten "4" was read as "H" or "U", and every unboxing photo shows an open box, which the AI counted as "not sealed". Real sellers write with whatever pen they have and pack however they can. Instead of asking them to be more careful, we fixed the system: codes now match across handwriting lookalikes, and a parcel only counts as tampered with when the photo shows signs of it. Honest deals stopped dropped from 6 of 9 to 2 of 9, with no fraud let through.

Money that is confirmed late. PayPal confirms captures and payouts by webhook, seconds or minutes after the buyer returns. Showing "waiting for payment" right after paying confused people, so we added a "Confirming payment" state that changes what the screen says without moving the deal early.

Keeping the AI out of the money path. The model never moves money directly. That made the design slower to build and much easier to trust.

What we learned

Over three runs of our eval (36 decisions with real photos and the production model), no fraudulent deal got through (0 of 27) and 34 of 36 decisions were correct. Both misses sent an honest case to a person instead of paying: a cautious failure, not a costly one.

The hardest part of an AI judge is not catching fraud. It is not punishing honest people for messy handwriting or a dark photo. Measuring both kinds of mistakes separately changed how we built the product.

What's next

PayPal's delayed disbursement instead of capture-then-payout, real sign-in with a seller reputation, and a larger eval with more products and carriers. Our goal is simple: that two strangers in Latin America can close a sale they both want, without either one having to trust the other first.# Inspiration

Built With

Share this project:

Updates

Submission history