Inspiration

Merchants lose time and money when a buyer goes straight to the bank. Many “item not received,” damaged-item, and unrecognized-charge cases are fixable if the merchant replies quickly and can act within a clear policy. FirstReply puts an always-on resolution agent where buyers need it most: the store, order email, card-statement descriptor, and hosted help page.

What it does

FirstReply verifies the buyer against a single order, checks live PayPal order and shipment data, then applies code-enforced limits, delivery rules, and trust tiers before it offers a refund, reshipment, or explanation. It can match a PayPal soft descriptor to an order, assess a damage photo before proposing a partial refund, and route high-risk money actions to a merchant approval queue.

If a buyer opens a PayPal dispute anyway, the Dispute Agent matches the dispute to the FirstReply case, recommends fight, offer, or accept, and prepares a response with the supporting order, tracking, conversation, policy, and audit evidence. The merchant remains the person who submits the response.

How we built it

We built FirstReply with Next.js, TypeScript, Tailwind CSS, PostgreSQL, and Drizzle. The agent loop uses the Vercel AI SDK with PayPal Agent Toolkit and PayPal REST APIs for Orders, Tracking, refunds, and Customer Disputes. Every payment action passes through a deterministic policy engine; the model proposes an action, while code decides whether it is allowed.

The merchant console includes live cases, approvals, policy controls, an append-only audit timeline, dispute drafting, evidence-PDF preview, and impact metrics. A demo panel lets us create scenario orders, simulate carrier status, and reset the local demo state.

Challenges

PayPal sandbox partner onboarding is unavailable to hackathon apps, so the demo uses sandbox merchant credentials while preserving the production path of partner onboarding. Sandbox dispute timing and available response actions can vary, so prevention is the primary product story. We also had to make policy limits enforceable outside the prompt: no refund, reshipment, or dispute action can bypass the code policy engine.

Accomplishments and learnings

We delivered an end-to-end prevention flow, merchant approvals, real sandbox refund support, photo assessment, dispute drafting with a case-record PDF, and a 22-scenario deterministic evaluation that passes 100%. We learned that hard money limits beat prompt-only promises, and that an append-only audit record is useful both for merchant visibility and for a later dispute response.

What's next

Next we will add PayPal partner onboarding, transaction-search order sync for real merchant storefronts, inquiry-stage make-offer actions, and buyer/merchant notifications.

Built With

Share this project:

Updates

Submission history