TERMBridge — From Agreement to Payment
Live link - https://tear-mbridge.vercel.app/
Code link - https://github.com/raj-x3/TEARMbridge
Inspiration
In B2B transactions, agreeing on a deal is only one part of the process. Businesses still have to compare purchase orders with master agreements, check amendments, resolve mismatched terms, obtain approvals, generate invoices, and track payments.
A small discrepancy — such as an incorrect discount, quantity, delivery timeline, or payment term — can create unnecessary delays and confusion.
We wanted to build something that connects these disconnected steps into one structured workflow.
That idea became TERMBridge: a commercial agreement-to-payment platform that brings document intelligence, negotiation, approvals, and PayPal invoicing together.
What it does
TERMBridge takes a business transaction from its initial documents to payment:
- Document Intelligence: Users upload purchase orders, master agreements, and amendments. AI analyses the documents and extracts relevant commercial terms with references to their source evidence.
- Evidence Validation: Extracted information is checked against the original documents so users can review where a finding came from.
- Commercial Decision Engine: A deterministic rules engine compares the extracted terms and identifies mismatches involving quantity, pricing, discounts, delivery schedules, and payment conditions.
- Counteroffer Generation: When terms do not align, TERMBridge proposes corrections based on the applicable commercial rules.
- Mutual Approval: Buyers and sellers review and approve the same version of the proposed terms.
- PayPal Invoicing: Once the transaction is finalised, TERMBridge creates and sends a PayPal invoice.
- Payment Reconciliation: Payment status is reconciled against PayPal's authoritative invoice status.
The goal is to make the entire process more transparent, traceable, and predictable.
How we built it
We built TERMBridge using Next.js, TypeScript, Supabase, Gemini, and the PayPal Developer Platform (Sandbox).
- Frontend: Next.js and TypeScript power the dashboard, agreement workbench, purchase orders, counteroffers, invoices, and transaction workflows.
- Backend and database: Supabase handles persistent data, authentication, document storage, workspace isolation, and audit records.
- AI layer: Gemini analyses uploaded business documents, extracts commercial terms, and identifies relevant information across multiple documents.
- Decision engine: We deliberately kept financial calculations and commercial rule evaluation deterministic rather than relying on an LLM to make financial decisions.
- Payment integration: PayPal Sandbox handles invoice creation and the payment demonstration. Payment status is verified through PayPal's invoice API and reconciled with TERMBridge.
One important design decision was separating AI interpretation from business-critical decisions. AI helps understand documents, while deterministic logic validates commercial conditions and calculates financial values.
Challenges we faced
One of our biggest challenges was making document analysis reliable.
Extracting a number from a PDF is not enough. The system also needs to understand which document it came from, whether an amendment changes an earlier agreement, and whether the extracted value is actually supported by the source.
Another challenge was handling conflicting terms. For example, a purchase order might specify Net 60 payment terms while a later applicable amendment specifies Net 45. TERMBridge needed to identify the discrepancy and use the operative agreement rather than simply accepting the latest extracted text.
We also had to make the negotiation and approval process consistent. Both parties must approve the exact same version of a counteroffer, and the finalised transaction must not silently change afterward.
Finally, integrating PayPal introduced its own challenges around Sandbox buyer accounts, invoice lifecycle states, and payment verification. We tested the complete Sandbox payment journey and verified the resulting paid status against PayPal's invoice API.
What we learned
Building TERMBridge taught us that integrating AI into a real business workflow involves much more than connecting an API to a chatbot.
We learned about document processing, evidence-based extraction, database design, authentication and access control, deterministic financial calculations, API integrations, payment lifecycles, and end-to-end testing.
We also learned the importance of distinguishing between what an AI model suggests and what a system can safely verify.
Most importantly, we experienced how different components — AI, backend systems, databases, commercial rules, and payment APIs — must work together to solve an actual problem.
What's next
We see TERMBridge evolving into a broader commercial operations platform with deeper accounting integrations, more advanced agreement versioning, stronger counterparty verification, and support for additional payment providers.
Our vision is simple: businesses should spend less time reconciling paperwork and more time getting deals done.
TERMBridge — From agreement to payment.
Built With
- api
- apidocument
- artificial-intelligence
- automation
- business
- fintech
- full-stack
- gemini
- generative-ai
- google-ai
- intelligence
- invoice
- management
- next.js
- payment
- paypal
- paypal-sandbox
- processing
- python
- react
- rest
- saas
- supabase
- typescript
- workflow

