Inspiration

Appointment businesses lose money in silence: a 2 PM cancellation or a Thursday afternoon nobody booked just expires. Booking tools wait for customers to show up. Nobody sells the hour.

What it does

DayCloser is an outbound sales agent for appointment businesses, built first for one photography studio (two photographers, two services, eight synthetic contacts).

  1. Finds unused capacity on a Bryntum Scheduler timeline: never-booked gaps and openings created by cancellations.
  2. Sell this opening. The agent ranks only contacts who opted in, by service fit, photographer history, preferred day and time, and time since their last session. Opted-out contacts are excluded in code, not by prompt.
  3. Starts the conversation. Each invitee gets a personal invitation with a concrete, feasible offer: service, photographer, time, fixed deposit. The customer never had to ask.
  4. Adapts to a live reply. "Thursday's tricky, could we do Saturday morning?" fires a server-side event; the agent checks real availability and replaces offer v1 with v2, and the timeline shows the live offer move.
  5. Collects a deposit with PayPal. The slot is held during checkout, re-checked at capture, and becomes a confirmed booking.

How we built it

  • Builder.io Agent-Native: agent runtime and chat, shared typed actions used by the agent, the UI and HTTP, SQL persistence, and a server-side event automation (customer replied -> agent run).
  • Bryntum Scheduler: the merchant's resource timeline (photographers as resources; bookings, holds, cancellations, live offers and openings as events; drag to move, context menu to cancel or sell).
  • Bryntum Grid: the Customers page, with every contact, consent, preferences, next booking and live outreach status, grouped by consent with a filter bar and row expander.
  • Bryntum Calendar: the same bookings, openings and live offers in day, week, month and agenda views with a photographer filter; clicking an opening opens it in Studio to sell.
  • PayPal sandbox: Orders v2 deposit create and capture with idempotency keys, a 15-minute slot hold and a capture-time feasibility check; if the studio cancels a paid booking, the deposit is refunded automatically (Payments v2).
  • One feasibility rule guards every offer, move, checkout and capture. The model proposes; the code decides what is possible.

Challenges

Letting an LLM negotiate without letting it invent: prices, deposits and services live only in the database, every offer is validated, and the agent has no discount tool. Two people can be offered the same opening; the first deposit wins and the others are closed out.

What's next

Email/SMS delivery, calendar sync, multi-location studios.

AI tools used

  • Builder.io Agent-Native agent (model via OpenRouter): ranks and personalises invitations, reads replies, revises offers.
  • Hark (AI assistant): helped write and test the code and this write-up.

APIMatic Context Plugin for PayPal

Every PayPal call in DayCloser goes through the APIMatic-generated PayPal TypeScript SDK: createOrder, getOrder and captureOrder for the booking deposit, and refundCapturedPayment / getCapturedPayment to refund the deposit automatically when the studio cancels a booking DayCloser sold. The AI coding agent that wrote this followed the APIMatic Context Plugin's typescript-integrate-paypal workflow, using the plugin's TypeScript skills and the SDK map shipped with the SDK, and wrote a contract sheet (paypal-plan.md in the repo) before any code. Each write carries a PayPal-Request-Id; refunds take a durable claim first (a dc_refunds row with UNIQUE(capture_id)) and re-read the capture if PayPal's answer is lost. Verified in the PayPal sandbox: a $45.00 deposit captured (72003549W4948223C) and refunded on cancel (0N95201633641864X); a second cancel made no second PayPal call.

Built With

Share this project:

Updates

Submission history