Inspiration

Anyone who sells project work knows the pattern: the next phase starts on schedule while the last invoice is still unpaid, and by the time anyone notices, the team has worked weeks for free. Invoicing tools don't know about the schedule, and project tools don't know about the money. We're building Zilla OS, an AI operating system for running a company, and we wanted a module that ties the two together so work only moves forward when the money does.

What it does

  • Paste a scope, a client billing email and a budget. Grok plans the project into priced phases with dependencies, validated against a strict schema.
  • The plan renders on a Bryntum Gantt chart where every phase is a payment gate. Bars are colored by payment state: Draft, Invoiced, Paid, Overdue.
  • One click (or one sentence to the agent) creates and sends a real PayPal invoice for the phase through the PayPal Agent Toolkit.
  • When the client pays, a verified PayPal INVOICING.INVOICE.PAID webhook marks the phase paid and unlocks the next one.
  • When an invoice goes past due, the agent shifts every dependent phase, recalculates the launch date, and drafts a client update. A person approves before any reminder or email goes out.
  • A chat agent answers "What's overdue?" in plain words with the new dates, invoices phases, pushes milestones and sends PayPal reminders, all through typed tools.

How we built it

  • Next.js 15 (App Router), React 19, TypeScript, Tailwind, hosted on Vercel at https://milestones.zillalabs.ai
  • PayPal: Invoicing API v2 via @paypal/agent-toolkit (create, send, get, list, record payment, send reminder), OAuth handled by the toolkit, webhooks verified with POST /v1/notifications/verify-webhook-signature. All in the PayPal sandbox.
  • AI: xAI Grok via the OpenAI-compatible API. A planner call returns JSON checked with Zod (one self-repair retry), then amounts are scaled to the budget and dates walked in dependency order. An operator agent runs a bounded tool loop over our domain tools plus the PayPal toolkit tools; all state changes go through tools, and money-moving actions require human approval.
  • Bryntum Gantt Community (MIT) for the schedule surface, with payment status as a task field, column and bar color.
  • Vitest coverage for the schema, the overdue scheduling engine, and webhook verification. Demo mode runs with no keys so anyone can try it.

Challenges we ran into

  • PayPal's record-payment endpoint often returns only a payment_id; we had to confirm state by re-reading the invoice.
  • Time zones: an invoice dated "today" in UTC is "tomorrow" for a US merchant in the evening, so PayPal schedules it instead of sending it. We now date invoices in the merchant's time zone.
  • Keeping the Gantt, the agent and PayPal in sync: we made PayPal the source of truth for payment state and made the agent act only through tools, so it can't "say" a phase is paid without PayPal agreeing.
  • Making an agent that moves money safe: every send, reminder and client email is gated on human approval.

Accomplishments that we're proud of

  • A full loop in the real PayPal sandbox: AI plan, real invoice, verified webhook, schedule unlocks, overdue replan, approved reminder.
  • The schedule reacts to money automatically, which neither invoicing tools nor Gantt tools do on their own.
  • Open source (MIT), tested, and runnable with or without keys.

What we learned

The PayPal Agent Toolkit makes it practical to give an LLM real payment capabilities, and the hard design work is the guardrails: schema validation, tool-only state changes, and human approval on anything that moves money or messages a client.

What's next for Zilla Milestones

  • Deeper inside Zilla OS: milestone status flowing into the company brain, cash forecasting and resourcing.
  • PayPal Payouts to pay subcontractors the moment a client phase is paid; partial payments and deposits; PayPal USD (PYUSD) settlement where eligible.
  • Client portal with PayPal Checkout for pay-and-approve in one step; multi-currency invoicing.

Built With

  • bryntum
  • bryntum-gantt
  • grok
  • next.js
  • node.js
  • paypal
  • paypal-agent-toolkit
  • paypal-invoicing-api
  • paypal-webhooks
  • react
  • tailwindcss
  • typescript
  • vercel
  • vitest
  • xai
  • zod
Share this project:

Updates

Submission history