AgentPay: Autonomous AI Commerce
Inspiration
Traditional online commerce depends heavily on manual negotiations, disconnected payment workflows, and human-driven coordination between buyers and sellers.
We asked ourselves: What if AI agents could negotiate commercial deals autonomously, validate agreements, and execute payments while keeping humans in control of financial authorization?
That question inspired AgentPay — an autonomous AI commerce platform that brings AI-driven negotiation, deterministic financial safeguards, and PayPal payment infrastructure into one workflow.
Our goal was to go beyond building another AI chatbot and demonstrate how multiple specialized AI agents could collaborate to complete a commercial transaction safely.
What it does
AgentPay enables AI agents representing buyers and sellers to negotiate commercial terms, reach agreements, validate risks, and prepare payments through PayPal Sandbox.
The platform consists of four specialized agents:
- Buyer Agent: Represents the customer, communicates purchasing requirements, and negotiates within a defined budget.
- Seller Agent: Represents the vendor, proposes pricing, and protects minimum acceptable commercial terms.
- Negotiation Agent: Coordinates negotiations using LangGraph, manages negotiation rounds, and determines when consensus is reached.
- Risk Agent: Applies deterministic validation rules to check financial limits, agreement structure, and transaction eligibility.
Once an agreement passes risk validation, the buyer explicitly authorizes payment through PayPal. AgentPay verifies PayPal's approval before capturing the payment.
The platform also maintains a transaction ledger and audit stream to provide visibility into the complete workflow.
How we built it
We built AgentPay using a full-stack architecture with specialized AI agents and PayPal payment integration.
Technology stack:
- Frontend: React 19, Vite, TypeScript, Tailwind CSS
- Backend: Node.js, Express, TypeScript
- AI: Google Gemini
- Agent orchestration: LangGraph
- Payment integration: Official PayPal Agent Toolkit and PayPal Sandbox
- Persistence: JSON-based transaction and negotiation stores
Workflow:
- Initiate a negotiation with service requirements, budget, and delivery constraints.
- Buyer and Seller agents exchange offers and counteroffers.
- Negotiation Agent coordinates the process until consensus is reached or the negotiation limit is exhausted.
- Risk Agent validates the proposed agreement using deterministic rules.
- The buyer explicitly authorizes the payment.
- AgentPay verifies PayPal approval and captures the payment through PayPal Sandbox.
- The completed transaction is recorded in the ledger, with events available in the audit stream.
We deliberately separated AI-powered commercial reasoning from deterministic financial enforcement. This ensures that AI agents can negotiate flexibly without independently overriding financial safeguards.
Challenges we ran into
One of our biggest challenges was coordinating multiple autonomous agents while maintaining predictable financial outcomes.
We addressed this by separating AI reasoning from deterministic validation. Google Gemini powers commercial negotiations, while the Risk Agent independently checks agreements against explicit business rules.
Another major challenge was implementing the complete PayPal payment lifecycle. Creating an order was not enough. We needed to handle buyer approval, independently verify the approved order, prevent unauthorized captures, and record the final transaction.
We also worked on reliability through:
- Duplicate-operation protection.
- Transaction ownership validation.
- Atomic storage operations and recovery.
- Payment amount and currency verification.
- Audit logging and error handling.
Balancing autonomous execution with human control was another important design consideration, particularly for financial operations.
Accomplishments that we're proud of
We're proud to have built a working end-to-end autonomous commerce workflow rather than just a conceptual AI demonstration.
Some key accomplishments include:
- Successfully implemented four specialized agents for buyer representation, seller representation, negotiation, and risk validation.
- Enabled autonomous buyer-seller negotiations using Google Gemini and LangGraph.
- Implemented deterministic financial and agreement validation.
- Integrated the official PayPal Agent Toolkit.
- Successfully completed a $85.00 USD PayPal Sandbox payment, including buyer approval and payment capture.
- Built a transaction ledger and audit stream to track payment activity.
- Added safeguards against unauthorized captures and duplicate operations.
- Created a live dashboard to monitor negotiations, agents, payments, and system activity.
Most importantly, we demonstrated that autonomous AI negotiation can be connected to an actual payment workflow while preserving explicit human authorization.
What we learned
Building AgentPay gave us practical experience in:
- Designing and coordinating multi-agent AI systems.
- Building autonomous workflows with LangGraph.
- Integrating Google Gemini with specialized AI agents.
- Combining LLM reasoning with deterministic business rules.
- Integrating PayPal Sandbox order creation, buyer approval, and payment capture.
- Implementing human-in-the-loop financial authorization.
- Building transaction tracking, auditability, and payment safeguards.
We learned that successful agentic commerce requires more than intelligent agents. It also needs reliable orchestration, clear authorization boundaries, and deterministic controls.
What's next for AgentPay: Autonomous AI Commerce
AgentPay is a foundation for exploring how AI agents can participate in future digital commerce.
Our next steps include:
- Multi-party negotiations: Support more complex negotiations involving multiple buyers and sellers.
- Agent identity and trust: Introduce stronger identity, reputation, and authorization mechanisms for participating agents.
- Advanced risk intelligence: Expand risk validation with configurable policies and transaction monitoring.
- Persistent commerce memory: Enable agents to learn from previous negotiations and commercial preferences.
- Marketplace integration: Connect AgentPay with digital marketplaces and service providers.
- Production readiness: Explore database-backed persistence, distributed coordination, authentication, and PayPal production integration.
Our vision is a future where AI agents can discover opportunities, negotiate agreements, and coordinate commerce securely, with humans retaining control over important financial decisions.
Autonomous negotiation. Deterministic risk control. Human-authorized payments.
AgentPay is an independent hackathon project and uses PayPal Sandbox for demonstration and testing. It is not affiliated with or endorsed by PayPal.
Built With
- agentic-ai
- ai-agents
- ai-orchestration
- express.js
- fintech
- generative-ai
- google-gemini
- langgraph
- llm
- multi-agent-systems
- node.js
- payment-processing
- paypal
- paypal-agent-toolkit
- paypal-sandbox
- python
- react
- rest-api
- typescript