Inspiration
Modern enterprise infrastructure provisioning requires fast, reliable, and secure financial execution. However, traditional procurement workflows are bogged down by manual approvals and fragile browser-based checkouts. We built the PayPal Autonomous Procurement Agent to bridge natural language intent and secure financial settlement using Agentic Commerce.
What it does
The project is a CLI-driven procurement engine that translates natural language requests into fully audited, compliant, and executed financial transactions. Using Google Gemini AI, it evaluates risk parameters, enforces corporate spending policies, and executes direct server-to-server payments through the PayPal REST API v2 using the sandbox environment.
How we built it
- Core Engine: Built in Python with a professional terminal interface using the
richlibrary. - AI Compliance: Integrates the
google-genaiSDK with a resilient local heuristic fallback engine to handle upstream API rate limits seamlessly. - Financial Settlement: Communicates directly with PayPal REST API v2, managing OAuth2 authentication, idempotency request IDs (
PayPal-Request-Id), and automated capture via direct payment sources in Sandbox.
Challenges we ran into
Handling high-demand rate limits from AI APIs during live procurement execution, which we solved by engineering an immediate heuristic fallback system. Additionally, automating server-to-server order capture in PayPal Sandbox required precise payload mapping of the payment_source field to eliminate manual browser redirects.
Accomplishments that we're proud of
Achieving completely autonomous, server-to-server transaction settlement in PayPal Sandbox without requiring manual browser redirects or user intervention, wrapped in an enterprise-grade compliance guardrail framework.
What we learned
Building robust agentic systems requires strict failure-mode isolation, explicit idempotency management for API state changes, and defensive prompt engineering to parse structured data reliably.
What's next for PayPal Autonomous Procurement Agent
- Integrating multi-agent authorization hierarchies for tiered corporate spending limits.
- Expanding payment tokenization to support recurring SaaS subscriptions via PayPal Vault APIs.
- Adding automated post-settlement ERP webhook integrations (e.g., SAP, QuickBooks).