Inspiration
Digital payments have become an essential part of everyday business, but tracking transactions across payment systems can still be complicated. Payment events may arrive late, appear more than once, or contain inconsistent amounts and statuses.
When something goes wrong, identifying the actual reason often requires manually checking multiple records and tracing transaction histories.
We wanted to build a platform that makes payment reconciliation more intelligent, transparent, and easier to investigate using AI.
What it does
DapPay is an AI-powered payment reconciliation and investigation platform designed around PayPal transactions.
Its key capabilities include:
- PayPal Integration: Connects with PayPal Sandbox to retrieve orders, captures, and payment information.
- Webhook Processing: Receives payment events, verifies their authenticity, and prevents duplicate event processing.
- Automated Reconciliation: Identifies transaction discrepancies such as amount mismatches, missing records, duplicate events, and inconsistent payment statuses.
- Data Lineage: Tracks relationships between payment records and events to provide transaction traceability.
- AI-Powered Investigation: Uses AI to analyze collected evidence, construct timelines, and assist in identifying potential root causes.
- Investigation Reports: Produces structured, evidence-backed investigation results instead of relying on unsupported assumptions.
How we built it
We developed DapPay using a full-stack architecture.
Backend: Python and FastAPI handle API operations, PayPal integration, webhook processing, reconciliation workflows, and AI investigation services.
Database: PostgreSQL stores merchant orders, payment captures, webhook events, reconciliation exceptions, and investigation reports. SQLAlchemy and Alembic manage database models and migrations.
Data Lineage: NetworkX is used to represent relationships between payment records and events.
AI Integration: Ollama with Qwen 2.5 3B supports investigation and root-cause analysis. Deterministic validation and evidence checks help prevent unsupported AI conclusions.
Frontend: Next.js, React, TypeScript, and Tailwind CSS provide the dashboard and application interface.
The system follows an important principle: financial reconciliation decisions are based on deterministic logic, while AI assists with interpreting evidence and explaining investigation findings.
Challenges we ran into
One of our biggest challenges was handling payment events that arrive in unexpected orders, including duplicate deliveries and delayed updates.
We also had to ensure that monetary calculations remained precise, avoiding floating-point errors when processing financial values.
Another challenge was building a reliable relationship between payment records, webhook events, and reconciliation exceptions so that investigations could be traced back to their underlying evidence.
Integrating a local AI model while maintaining structured outputs and preventing unsupported root-cause explanations required additional validation and testing.
Finally, connecting the frontend securely to the backend introduced authentication and merchant-isolation considerations that remain part of our production-readiness work.
Accomplishments that we're proud of
- Successfully integrated PayPal Sandbox payment and webhook workflows.
- Implemented webhook signature verification and duplicate-event handling.
- Built a reconciliation engine capable of detecting transaction discrepancies.
- Developed a transaction lineage system for tracing related records and events.
- Integrated a locally hosted LLM for evidence-based investigation.
- Implemented structured investigation reports with evidence references.
- Added JWT authentication and merchant-level access isolation to backend APIs.
- Built a responsive frontend and integrated the Payments module with real backend endpoints.
What we learned
We learned that payment reconciliation is not simply comparing two amounts. It requires understanding event lifecycles, handling inconsistent data, preserving financial precision, and maintaining traceability.
We also learned that AI should not replace deterministic financial validation. Instead, AI is more useful when it works with verified evidence, explains anomalies, and helps investigators understand complex transaction histories.
Building DapPay helped us understand the challenges of combining payment infrastructure, event-driven systems, data lineage, security, and AI into one application.
What's next for DapPay
Our next steps include completing trusted identity-provider integration, expanding real-time frontend integration across all modules, improving webhook monitoring and recovery, supporting additional payment providers, and strengthening production deployment and observability.
Our long-term vision is to make DapPay an intelligent payment operations platform where businesses can not only identify payment discrepancies but also understand how they happened and investigate them with confidence.
Built With
- docker
- fastapi
- networkx
- next.js
- ollama
- postgresql
- python
- qwen2.5
- react
- sqlalchemy
- tailwind
- typescript