🩺 CareBridge Pay: Ambient Agentic Healthcare Commerce & Financial Guardrails for Seniors

Tagline: Autonomous, voice-first prescription commerce powered by the PayPal Developer Platform (Orders v2, Vault, Invoicing, Subscriptions), Model Context Protocol (MCP), and AG Grid ($5,000 Bounty).


💡 Inspiration: From a Summer in Ea Kar to a Distant IT Job — The Birth of Agentic Healthcare Commerce

A while ago, when I was still an IT student at UIT (University of Information Technology) in Ho Chi Minh City, an astrology website I had spent six months building collapsed overnight after a search algorithm update. Burned out, broke, and questioning my future, I packed a backpack and took the long bus ride back to my hometown in Ea Kar, Dak Lak (a rural farming district in Vietnam) to stay with my grandmother.

Living with her for several months, I witnessed an everyday heartbreak that never crossed my mind in the tech bubble of the city.

My grandma lives with diabetes and severe hypertension, taking 6 to 8 different pills every day. Her eyesight is fading, and her fingers tremble with arthritis. Every morning, I watched her hold blister packs up to the sunlight, squinting to read tiny labels, terrified of double-dosing. Whenever a tiny tablet slipped from her shaking fingers onto the floor, she would apologize to me—as if growing old were her fault.

Fast forward to today: I graduated from UIT and now work full-time as an IT software engineer in Ho Chi Minh City, hundreds of miles away from Ea Kar.

Living far away, a new, terrifying reality set in: The Pharmacy Runout Crisis.
Whenever her essential blood pressure or diabetes medication ran low, her care hit a brick wall. How could I expect an 78-year-old grandmother with cataracts and tremors to navigate modern banking apps, enter 16-digit credit card numbers, remember passwords, and authenticate SMS 2FA codes? She simply couldn't.

Yet, giving her an unrestricted credit card was equally dangerous due to telephone scams targeting seniors and accidental duplicate orders caused by cognitive fatigue.

Sitting at my engineering desk in the city, the realization struck me: Seniors don't need another smartphone checkout screen. They need dignified, voice-first Ambient Agentic Commerce with built-in family financial guardrails.

What if an ambient display at her bedside could proactively audit her pill inventory, autonomously reorder critical medications via pre-approved PayPal Vault tokens within a safe family monthly budget, and instantly escalate a formal PayPal Invoice to me when an order exceeds her limit?

That is why I built CareBridge Pay for the PayPal AI Hackathon 2026. It is the continuation of my promise to my grandmother—bridging the miles between a software engineer's desk in the city and a quiet bedside in Ea Kar through the trust, security, and developer power of the PayPal Developer Platform.


🌟 What CareBridge Pay Does

CareBridge Pay transforms ambient smart displays into an autonomous, voice-first healthcare commerce station for seniors and remote family caregivers:

  1. Autonomous Low-Stock Detection & Voice-First Checkout:
    When a senior confirms their morning dose hands-free, the AI agent updates the clinical log and audits remaining pill inventory. When stock drops to $\le 3$ pills, the agent proactively asks: "Eleanor, you have only 3 pills left of Amlodipine. Should I refill a 30-day supply with PayPal for $9.80?"
  2. Frictionless Settlement via PayPal Orders v2 & Vault Token:
    With a simple verbal confirmation ("Yes, please"), the Model Context Protocol (MCP) agent settles the order instantly using a pre-approved PayPal Vault token (POST /v2/checkout/orders with billing agreement token). No passwords, no phone hunting, no credit cards.
  3. Responsible Financial Guardrails via PayPal Invoicing API v2:
    To prevent fraud and overspending, the family sets a $50.00 Monthly Family Wallet limit. If a senior requests an emergency or 90-day supply (e.g., Metformin for $50.40) that exceeds the budget, CareBridge Pay halts autonomous charging. Instead, it generates an official PayPal Invoice (POST /v2/invoicing/invoices and /send) and dispatches an instant SMS notification to daughter Sarah Connor with a 1-tap remote approval link.
  4. AG Grid Medical-Financial Ledger ($5,000 Sponsor Bounty):
    Built with AG Grid Community v36, the caregiver portal correlates Eleanor's daily biometric vitals (blood pressure, glucose, heart rate) directly with medication compliance and PayPal transaction receipts (PAYID-..., CAP-...). Caregivers can filter by payment status (VAULT_CAPTURED, INVOICE_SENT), sort costs, and export certified CSV/Excel reports for rural doctors in one click.
  5. Recurring Billing via PayPal Subscriptions API ($9.99/mo Copilot Pro):
    Replaces fragile paywalls with live recurring billing (POST /v1/billing/subscriptions) to unlock continuous AI health monitoring, automated clinical reports, and hospital-grade doctor summaries.
  6. Smart Home Delivery Verification & Emergency Access:
    Integrates simulated smart porch cameras to verify package arrival on the door mat, and can automatically unlock smart deadbolts for incoming paramedics during acute clinical emergencies.

🏗️ How We Built It

CareBridge Pay is architected as an enterprise-grade full-stack TypeScript monorepo:

  • PayPal Developer Platform Integration:
    • Orders API v2: High-fidelity autonomous order creation and capture (createPayPalOrder, capturePayPalOrder).
    • Vault API: Pre-approved tokenization for 1-click frictionless senior transactions without 2FA fatigue.
    • Invoicing API v2: Automated drafting, merchant dispatching, and dynamic recipient_view_url retrieval for caregiver remote authorization.
    • Subscriptions API: Live recurring plan billing with safe fallback handling.
    • Webhooks: Validated webhook signature verification (POST /api/paypal/webhook) with real-time SSE broadcasting to the frontend.
  • AI & Agentic Orchestration:
    • Model Context Protocol (MCP): Express-based MCP Server implementing Streamable HTTP (SSE) with 7 tools (orderRefill, logDoseStatus, recordVitals, clinicalAdvisor, ringDeviceHub, negotiateAdherence, getTodaySchedule).
    • AWS Bedrock Claude 3.5 Haiku Tool-Use: Native structured reasoning and clinical guardrails intercepting unauthorized dosage changes.
    • High-Fidelity Offline Heuristic Engine: Zero-crash deterministic fallback for evaluation environments without active AWS credentials.
  • Frontend & Data Visualization:
    • Next.js 15 (React 19, Tailwind CSS): Ambient 10-foot UI with high-contrast Senior Desk Clock and dual caregiver console.
    • AG Grid Community v36: Enterprise telemetry ledger with custom cell renderers, multi-column sorting, quick-search filters, and client-side CSV export.
  • Database & Verification:
    • Atomic SQLite WAL Storage (better-sqlite3): ACID compliance for transactions, monthly wallet caps, and 30-day vitals.
    • Automated Testing: 98 unit tests across 9 suites passing 100% via Vitest.
    • Postman Collection & Render Blueprint: Official Postman collection (CareBridge_PayPal.postman_collection.json) and render.yaml for multi-platform developer onboarding.

đź§— Challenges We Ran Into

  1. Vault-to-Invoice Multi-Turn Escalation Logic:
    Ensuring the agent seamlessly switches from an autonomous Vault settlement to a formal PayPal Invoice when cumulative monthly spending crosses the $50 threshold required rigorous state machine design and atomic SQLite transactions.
  2. Sandbox Invoicing View Permissions:
    PayPal Sandbox strictly requires invoices to transition from DRAFT to SENT before public buyer links (recipient_view_url) become accessible. We engineered an automatic /send dispatch pipeline that retrieves live view URLs while remaining resilient under simulation.
  3. Preventing Agent Runaway Loops:
    To prevent an AI agent from repeatedly placing orders, we instituted inventory debouncing and strict low-stock thresholds ($\le 3$ pills), ensuring seniors are prompted only when clinically necessary.
  4. Synchronizing Biometric Vitals with Financial Telemetry in AG Grid:
    Correlating disparate clinical logs (daily blood pressure readings) with financial transaction receipts into a unified, high-performance AG Grid table required complex memoized join pipelines.

🏆 Accomplishments That We're Proud Of

  • 98/98 Tests Passing (100% Green): Complete test coverage across 9 test files, verifying PayPal order creation, Vault charging, cumulative limit enforcement, and MCP tool execution.
  • True Agentic Commerce in Geriatric Care: Proved that AI agents can do more than answer questions—they can execute responsible, dignified financial commerce for vulnerable populations.
  • Sponsor Bounty Alignment: Built a flagship AG Grid Community v36 implementation that transforms cold financial data into meaningful clinical correlations.
  • Dual-Engine Resilience: CareBridge Pay runs flawlessly with live PayPal Sandbox credentials, yet gracefully degrades to high-fidelity simulation so judges can test every feature without friction.

📚 What We Learned

  1. Agentic Commerce Demands Financial Guardrails: Giving AI access to payment rails requires strict, human-in-the-loop escalation paths. Autonomous spending caps paired with PayPal Invoicing provide the perfect balance between convenience and family trust.
  2. Ambient Computing is Dignity: Accessibility for the elderly is not about making phone buttons bigger; it is about eliminating the phone entirely. Meeting seniors through voice and glanceable bedside displays preserves their independence.
  3. Code Built with Love Endures: Building software for my grandmother in Ea Kar gave every API endpoint, test case, and commit true purpose.

🚀 What's Next for CareBridge Pay

  • Direct Pharmacy Network Settlement: Integrating with local pharmacy dispatch APIs across Southeast Asia and the US to link PayPal orders directly to automated prescription fulfillment.
  • Medicare & Insurance Co-pay Split: Extending our PayPal Orders engine to automatically calculate and deduct Medicare/HSA allowances before charging the remaining co-pay.
  • Hardware Pilot in Ea Kar: Deploying CareBridge Pay on dedicated touch displays in rural clinics in Dak Lak to assist elderly patients with chronic disease management.

Built With

Share this project:

Updates

Submission history