PayVia — AI Negotiates. PayPal Settles.

Inspiration

What if buying something online didn't mean accepting the listed price? What if your personal AI agent could negotiate with the seller's AI agent before you ever reached checkout?

Traditional e-commerce is built around a relatively passive buyer experience: search, compare, select and pay. While AI has made product discovery and recommendations smarter, the actual commercial negotiation between buyers and merchants remains largely manual.

We wanted to explore a different possibility: What if AI agents could negotiate on behalf of both sides of a transaction?

That question inspired PayVia, an AI-powered commerce negotiation platform developed for the PayPal Hackathon. Our vision is to move beyond AI-assisted shopping towards Agentic Commerce, where autonomous AI agents can represent buyer and merchant interests, negotiate mutually acceptable terms and prepare transactions for secure payment.

What it does

PayVia introduces an AI-to-AI negotiation layer between product discovery and payment.

Instead of simply accepting a listed price, buyers submit their purchase intent, including their desired product, maximum budget and delivery requirements. A Buyer AI agent represents the customer's interests, while a Merchant AI agent negotiates according to the seller's authorized pricing policies and commercial boundaries.

The platform coordinates this negotiation through four key stages:

1. Purchase Intent & Discovery

Buyers describe what they want, define their budget and specify delivery expectations. PayVia uses this structured intent to identify relevant purchasing opportunities.

2. Autonomous AI Negotiation

Buyer and Merchant AI agents exchange proposals and counteroffers. Negotiations operate within predefined constraints, including buyer budget ceilings and merchant-authorized minimum prices.

3. Agreement & Explicit Approval

Once mutually acceptable terms are reached, PayVia generates a structured commercial agreement. The buyer can review the negotiated price, savings, merchant identity and delivery commitments. Agreement integrity is protected through SHA-256 hashing, and explicit buyer approval is required before payment authorization.

4. PayPal Payment Settlement

After approval, PayVia creates and processes the payment through the PayPal Orders v2 integration using the PayPal Sandbox environment. The transaction is then verified and reflected in PayVia's payment confirmation and fulfillment workflow.

The fundamental principle is simple: AI can negotiate the deal, but the buyer remains in control of the purchase.

How we built it

We built PayVia as a full-stack AI-powered commerce platform, combining autonomous agent workflows, backend financial safeguards, persistent transaction management and payment integration.

Our application uses Next.js, React and TypeScript for the frontend, with Node.js and Prisma ORM supporting backend operations and database access. PostgreSQL provides persistent storage for shopping intents, merchants, policies, negotiation sessions, proposals, agreements, transactions and payment records.

For AI-powered negotiation, we integrated Google's Gemini models to support interactions between buyer and merchant agents. Rather than allowing agents to negotiate without restrictions, we implemented deterministic server-side validation to enforce buyer budget ceilings and merchant pricing floors.

A key part of the architecture is separating negotiation, agreement approval and payment settlement into distinct stages.

We use SHA-256 hashing to identify and verify the integrity of canonical agreement terms. The buyer must explicitly approve the agreement before the payment workflow can proceed.

For payment processing, we integrated PayPal Orders v2 through PayPal Sandbox, allowing us to demonstrate order creation, buyer authorization, payment capture and transaction confirmation without processing live-money transactions.

The platform also explores post-payment fulfillment tracking, connecting the completed transaction with delivery commitments and operational milestones.

Our architecture prioritizes persistent data, server-side validation, transaction integrity and clear separation between AI decision-making and financial authorization.

Challenges we ran into

One of our biggest challenges was ensuring that autonomous AI negotiation remained commercially controlled.

Allowing two AI agents to exchange offers is relatively straightforward. Ensuring that those offers remain within legitimate financial boundaries is much harder.

We had to design safeguards so that the Buyer AI could never exceed the customer's stated budget and the Merchant AI could never negotiate below the merchant's authorized pricing floor.

Another challenge was maintaining consistency throughout the transaction lifecycle. The negotiated offer, agreement terms, approval state and PayPal payment amount must remain aligned. Any mismatch could compromise transaction integrity.

Integrating PayPal Sandbox also required careful handling of order creation, buyer authorization, payment capture and asynchronous payment confirmation.

We additionally worked through database initialization, relational integrity, merchant-policy associations and deployment configuration to make the application operate reliably with persistent PostgreSQL storage.

These challenges pushed us to think beyond building an impressive AI demonstration and focus on the engineering required to make agent-driven commerce reliable and trustworthy.

Accomplishments that we're proud of

Our biggest accomplishment is bringing the idea of AI-to-AI commercial negotiation into a working end-to-end prototype.

We are particularly proud of:

  • Autonomous Agent Negotiation: Implementing buyer and merchant AI agents that negotiate proposals within defined commercial constraints.
  • Merchant-Controlled Pricing: Enforcing server-side pricing floors and preventing unauthorized discounts.
  • Buyer-Centric Financial Control: Keeping the buyer's budget private and requiring explicit approval before payment.
  • Agreement Integrity: Using SHA-256 hashing to protect the integrity of agreed commercial terms.
  • PayPal Integration: Connecting negotiated agreements to PayPal Orders v2 Sandbox payment authorization and settlement.
  • Transaction Lifecycle: Connecting purchase intent, negotiation, agreement, payment confirmation and fulfillment tracking.
  • End-to-End Demonstration: Bringing the complete journey together in a single application rather than presenting isolated AI features.

Most importantly, PayVia demonstrates how AI agents can participate in commercial decision-making without removing the buyer's authority over the final transaction.

What we learned

Building PayVia taught us that the future of AI in commerce is not simply about creating smarter chatbots or better product recommendations.

It is about designing systems where independent AI agents can communicate, negotiate and make decisions within clearly defined boundaries.

We learned the importance of deterministic business rules alongside probabilistic AI models, especially when financial decisions are involved.

We also gained practical experience with AI agent orchestration, structured negotiation workflows, secure payment integration, database consistency, agreement verification and transaction lifecycle management.

One of our biggest takeaways was that trust is not an additional feature in agentic commerce; it is the foundation on which the entire experience must be built.

What's next for PayVia

PayVia is an early step towards a more connected and intelligent commerce ecosystem.

Our next direction is to explore multi-merchant negotiation, where a single buyer agent could communicate with multiple merchant agents, compare negotiated offers and identify the most suitable deal based on price, delivery and buyer preferences.

We also envision more advanced agent memory, personalized purchasing preferences, expanded merchant integrations, richer negotiation strategies and stronger transaction verification.

As agentic commerce evolves, we believe buyers should be able to delegate the effort of negotiation without delegating control over their money.

Our long-term vision is a commerce ecosystem where AI agents negotiate, merchants retain control over their commercial policies, buyers remain in charge of approvals and trusted payment infrastructure completes the transaction.

PayVia is built around one simple idea:

AI negotiates. PayPal settles.

Developed for the PayPal Hackathon.

Built With

Share this project:

Updates

Submission history