Inspiration

Freelance procurement is notoriously slow. Clients and freelancers waste days haggling over prices, drafting contracts, and chasing down invoices. We wanted to see what happens when you combine AI function calling with PayPal's robust APIs to create a true Agentic Commerce experience—an AI that doesn't just chat, but actively negotiates, signs contracts, and moves money autonomously.

What it does

Autonomous Freelancer Negotiator & Payer is an end-to-end procurement agent.

  1. The Setup: A client inputs a project requirement and a strict maximum budget (e.g., $500).
  2. The Negotiation: The AI agent contacts the freelancer. If the freelancer quotes above budget (e.g., $650), the AI autonomously counters with a strategic lower offer, negotiating until an agreement is reached within the client's limit.
  3. The Contract: Once agreed, the system auto-generates a Master Freelance Agreement for digital signature.
  4. The Payment: Upon the client approving the final work, the platform seamlessly executes the payment authorization via the PayPal Orders API and disburses the funds directly to the freelancer using the PayPal Payouts API.

How we built it

  • Frontend: Next.js (App Router) and Tailwind CSS for a sleek, real-time fintech dashboard.
  • Backend: Node.js and Express.js handle the core API, utilizing Prisma ORM with PostgreSQL for exact financial state tracking (using strict Decimal types to avoid floating-point errors).
  • AI Engine: We used OpenAI's GPT-4o, relying heavily on Function Calling. The LLM never holds financial credentials; instead, it outputs structured JSON to trigger backend functions like finalize_contract which the backend verifies against the strict budget rules.
  • Payments: Integrated the PayPal Sandbox REST APIs (Orders v2 and Payouts) to handle the escrow and final disbursement, secured by webhook signature verification.

Challenges we ran into

Ensuring the AI strictly adhered to the budget ceiling without hallucinating higher offers was our biggest hurdle. We solved this by abstracting the financial authority away from the LLM. The AI can only propose a contract via a function call; our Express.js backend enforces the hard validation rules before any PayPal API is triggered.

Accomplishments that we're proud of

We successfully built a zero-touch procurement flow. Seeing the AI agent reject a high quote, negotiate a compromise, and instantly trigger a PayPal transaction upon project completion felt like witnessing the future of B2B commerce.

What's next

We plan to expand the agent's capabilities to handle multi-milestone payouts (releasing funds in 25% increments via PayPal as project phases are completed) and integrate multi-agent negotiations where a client AI negotiates directly with a freelancer AI.

Built With

Share this project:

Updates

Submission history