Inspiration

Group purchases—whether organizing a weekend camping trip, buying shared apartment supplies, or planning a team event—are often fragmented across dozens of retail browser tabs. This leads to tedious manual calculations, confusing spreadsheets, and delayed reimbursements.

The PayPal AI Hackathon ("Build What's Next with PayPal and AI") offers an open-ended challenge with over $60,000 in cash prizes to redefine how people buy and move money[1]. The competition requires developers to meaningfully combine financial transactions using PayPal with artificial intelligence, focusing heavily on agentic commerce where AI agents automate shopping and payments[3][4]. Inspired by this vision, we created CartPal AI—an autonomous conversational shopping assistant that aggregates items from multiple online retailers into a single cart and automates multi-payer micro-payment splits using PayPal Sandbox APIs

What it does

CartPal AI transforms group shopping into a single, conversational workflow:Conversational Product Search: Users specify group buying needs in plain language, while the AI agent queries millions of products across multiple retailers simultaneously.Unified Cross-Merchant Cart: Items selected from different merchants are consolidated into a single shopping cart session.Smart Discount Optimization: The assistant automatically scans for active promo codes and volume discounts to minimize total cart expenditure $\text{Cost}_{\text{total}}$.Multi-Payer PayPal Split-Checkout: Calculates each participant's fair share—allocating shipping fees and regional taxes proportionally—and triggers individual PayPal payment approvals.

Mathematical Split-Payment ModelTo ensure transparent and fair cost allocation, CartPal AI calculates individual payable amounts $S_i$ for each participant $i \in {1, 2, \dots, N}$ using the following formula:$$ S_i = P_i + \left( \frac{P_i}{\sum_{j=1}^{N} P_j} \right) \times (T + F_{\text{ship}}) - D_i $$Where:$P_i$ is the subtotal of items selected by participant $i$.$\sum_{j=1}^{N} P_j$ is the combined subtotal across all $N$ participants.$T$ is the total regional tax charged across all merchant orders.$F_{\text{ship}}$ is the total shipping and handling fee.$D_i$ is the individual discount or promo code credit allocated to participant $i$.The total cart cost across all split payments satisfies:$$ \text{Cost}{\text{total}} = \sum{i=1}^{N} S_i = \sum_{j=1}^{N} P_j + T + F_{\text{ship}} - \sum_{i=1}^{N} D_i $$

How we built it

We built CartPal AI by integrating developer ecosystem tools highlighted for the hackathon[2][4]:

  • Product Intelligence: Integrated Channel3 to access clean product catalog data across 100M+ items without web scraping
  • Payment Schemas for LLMs: Utilized APIMatic's Context Plugin to give our AI agent instant, structured PayPal context for executing payments
  • Agent Deployment: Hosted and orchestrated autonomous workflows using Render Workflows
  • Financial Dashboard: Built a dynamic split-payment UI and cart table using AG Grid and AG Studio
  • API Orchestration: Designed, tested, and documented custom endpoints linking the AI frontend to PayPal services using Postman

Challenges we ran into

  • Multi-Merchant Concurrency: Querying product availability across different retail APIs simultaneously while keeping cart pricing state synchronized.
  • Payment Concurrency: Managing multi-payer PayPal authorization states so that merchant checkouts execute only after all participants approve their share.
  • Strict Working Prototype Standard: Meeting the hackathon requirement for a functional working application rather than static mockups

Accomplishments that we're proud of

  • End-to-End Agentic Commerce: Built a functional pipeline transitioning seamlessly from natural language chat to real-time product queries and PayPal split-checkout.
  • Algorithmic Transparency: Implemented a transparent cost-splitting engine handling item subtotals, proportional shipping, tax allocations, and individual discounts.
  • Ecosystem Integration: Successfully integrated partner technologies including PayPal Sandbox APIs, Channel3, APIMatic, AG Grid, Render, and Postman* End-to-End Agentic Commerce: Built a functional pipeline transitioning seamlessly from natural language chat to real-time product queries and PayPal split-checkout.
  • Algorithmic Transparency: Implemented a transparent cost-splitting engine handling item subtotals, proportional shipping, tax allocations, and individual discounts.
  • Ecosystem Integration: Successfully integrated partner technologies including PayPal Sandbox APIs, Channel3, APIMatic, AG Grid, Render, and Postman

What we learned

  • Designing Agentic Workflows: Gained experience structuring AI agents that operate safely within financial guardrails and require explicit user authorization before executing transactions
  • Accelerated API Context: Discovered how tools like APIMatic Context Plugin streamline LLM interaction with payment APIs
  • Dynamic Financial UI: Learned how to leverage AG Grid to visualize live payment status updates as split-checkout authorizations land

What's next for CartPal AI

  • Autonomous Spending Caps: Introduce user-configurable spending limits for AI purchasing agents.
  • Social Messaging Expansion: Deploy CartPal AI as Discord and Telegram bots for inline group shopping and PayPal split payments.
  • Direct Merchant Plugins: Integrate merchant APIs for post-purchase tracking, returns, and automated refund splitting

Built With

Share this project:

Updates

Submission history