Inspiration
A buyer says their order never arrived. For a small merchant, responding means finding receipts, checking tracking records, reviewing messages, and deciding what they can confidently say.
We built Dispute Defender around a simple question: can AI help merchants prepare evidence-backed responses to PayPal disputes while making missing information visible and keeping them in control?
Our goal is to reduce the effort of assembling a response without inventing evidence or making promises about dispute outcomes.
What it does
Dispute Defender brings the merchant’s dispute-response workflow into one workspace:
- Import the case: retrieve the buyer’s complaint and case details from PayPal sandbox.
- Gather evidence: upload supporting text, PDF, PNG, or JPEG documents.
- Review the facts: generate a timeline, missing-evidence flags, potential contradictions, and an AI-drafted response.
- Inspect the sources: open references to check the document passages behind findings.
- Approve the reply: edit and save the response, then explicitly approve an eligible inquiry message before sending it to PayPal sandbox.
- Export the package: download the case and review information.
The app checks that cited documents exist and quoted passages appear in their text. These checks make the output traceable; they do not prove document authenticity or guarantee that a claim is correct.
When delivery confirmation is missing, the merchant should see that gap—not an invented claim that the package arrived.
How we built it
We built the interface with React, TypeScript, and Vite, supported by a Node.js API. SQLite stores case state and audit events, while uploaded originals are retained on disk.
The backend connects to PayPal’s sandbox Disputes API to import cases and send approved inquiry replies. API credentials stay on the server.
Our AI workflow uses OpenAI’s GPT-4.1 mini for document extraction and structured analysis. A second model pass reviews the candidate output. Server-side validation checks the response structure, source references, and exact quotations, with bounded correction attempts to control cost.
Draft revision checks help prevent sending stale responses. Recorded submission states and retry restrictions help handle situations where a network failure leaves acceptance uncertain.
The project runs locally, with setup instructions and configuration guidance in our public repository.
Challenges we ran into
Making AI output verifiable. A model can produce convincing wording while paraphrasing a passage presented as an exact quotation. We added strict source validation and improved correction feedback to identify failing references. Some generations can still fail validation, so reliability remains an area for improvement.
Understanding PayPal’s case-dependent actions. Inquiry messaging and formal delivery-evidence submission are separate workflows. We had to inspect case status and available actions instead of assuming every dispute supports every operation.
Keeping the demonstration honest. Our test uses a synthetic transaction and clearly labelled fictional evidence. We distinguished those test inputs from the real sandbox API interaction, then verified that our app’s reply appeared in PayPal’s Resolution Centre.
Accomplishments that we're proud of
- Imported an actual PayPal sandbox dispute for a synthetic $20 transaction.
- Sent an inquiry reply through Dispute Defender and verified its appearance in PayPal’s Resolution Centre.
- Built an evidence-review workflow with source inspection, editable responses, and explicit merchant approval.
- Passed 29 automated tests, covering areas including citation validation, mocked AI workflows, case updates, approval checks, and PayPal integration behaviour.
Our verified live sandbox write is inquiry messaging. Formal delivery-evidence attachment submission is implemented as a separate, case-dependent path, but has not been verified end-to-end against PayPal.
What we learned
The value of AI assistance goes beyond writing a polished response. It should help a merchant understand what their records support, what is missing, and where human judgment is needed.
We also learned that source quotations are only one layer of validation. A quotation can exist in a document without supporting the conclusion drawn from it.
Finally, external API states, uncertain network outcomes, and reproducible setup matter just as much as the model output when building a complete workflow.
What's next for Dispute Defender
Our next priorities are improving citation-generation reliability, expanding evaluation across document formats and dispute scenarios, and validating formal evidence submission on eligible sandbox cases.
We also want to introduce multi-merchant authentication and measure whether the workflow reduces preparation time for merchants. We have not measured dispute win-rate improvements.
Dispute Defender’s direction remains straightforward: help merchants understand their evidence, prepare a clear response, and stay in control of what gets sent.
Built With
- api
- disputes
- gpt-4.1
- mini
- node.js
- openai
- paypal
- react
- sqlite
- typescript
- vite
- zod