Inspiration
Four out of five first-time donors don't come back the next year. The Fundraising Effectiveness Project's Q4 2025 report calls turning a first gift into a second the most consequential unsolved problem in the donor pipeline, and Bloomerang, citing that report, puts first-time donor retention at 18.9%.
Large charities have development directors for this. A small animal rescue has a volunteer with five hours a week. The donations arrive through PayPal, and nobody has time to notice who stopped giving, thank people properly, or chase the business pledge that never came.
What it does
Gratia turns a nonprofit's PayPal account into a live dashboard and an AI teammate. The demo runs for Harbor Lane Animal Rescue, a fictional shelter, entirely on the PayPal sandbox.
A dashboard that shows who is drifting away.
- Every gift, monthly sponsorship and business pledge from PayPal, in one AG Studio report the team can reshape.
- Four custom widgets AG Studio doesn't ship:
- campaign goals, one progress bar per campaign against what the rescue aims to raise, with donors counted and what is left to go;
- a loyalty heatmap, one row per donor and one column per month: rows that stop short, tinted amber, are donors going quiet;
- a live gift feed;
- a donor wall that thanks the top supporters.
- Click a campaign or a donor, and the whole page filters to them. Like AG Studio's own charts, the widgets keep everything in view and fade what the selection leaves out.
A donation page wired to the dashboard.
- Donors give with the PayPal JavaScript SDK v6. The server creates and captures the order with the PayPal Server SDK, and records a paid receipt in PayPal Invoicing.
- An open dashboard notices the gift within seconds: the numbers move, the feed marks it "New", and a notification names the donor and the program.
An AI development director. Click "Ask your director":
- "Who are we losing?" It reads the PayPal giving history, finds monthly sponsors who stopped, repeat donors gone quiet and first gifts never followed by a second, and drafts a personal note for each, based on what their gifts paid for.
- "Chase overdue pledges." It lists the late pledges from PayPal Invoicing and drafts a reminder. A dialog shows the exact message. Only after a person clicks "Send through PayPal" does PayPal email the donor, with a link to pay.
- "Build a board report." It briefs AG Studio's built-in agents, which build a new report page from the same PayPal data.
The model drafts and asks. Only a person can press send.
Fast to drive. Ctrl K opens a command palette anywhere in the dashboard: the director's suggestions, every page and report, the donation page.
Worth opening again tomorrow. A daily job keeps the sandbox rescue alive: sponsors give again when their month comes round, and new donors turn up. Come back on another day and the dashboard opens with what changed, for example "Since your last visit on Monday: 3 new gifts, $85."
How we built it
PayPal
| What | API |
|---|---|
| Checkout button | JavaScript SDK v6 |
| Create and capture gifts | Orders v2, through the APIMatic-generated PayPal Server SDK |
| Receipts, pledges, reminders, refunds | Invoicing v2 (create, send, record payment, record refund, remind) |
| Ledger and balance | Transaction Search, Balances |
| Programs and giving plans | Catalog Products, Billing Plans |
AI
- OpenAI GPT-5.4 mini, called through a server proxy that holds the key, only serves the site's own pages, limits calls per visitor and per day, and caps each answer.
- AG Studio's Studio Agent Framework: our Development Director is the primary agent, with its own tools (
find_donors_at_risk,list_overdue_pledges,send_pledge_reminder). It reaches AG Studio's built-in lead agent throughdelegate_to, and the lead coordinates the planning, data, page and widget agents. - The tools are ordinary functions over PayPal data, covered by tests. The model never computes who is at risk; it reads the answer and writes the note.
- In the chat, tool calls read in plain words and expand to show the donors and pledges found.
AG Studio
- The four custom widgets use the widget API, so page filters and cross-filters apply (in Studio's highlight mode, like the built-in charts), and they carry AI metadata so the built-in agents can place them too.
- A Gratia theme, a four-page report, and a custom agent working alongside the built-in ones.
The rest: Next.js 16, React 19, TypeScript, Tailwind CSS, Vercel. Vitest and GitHub Actions for tests and CI.
What we started from. PayPal's official AG Grid hackathon boilerplate gave us the PayPal REST client, the AG Studio setup and the OpenAI adapter. Everything else was built during the hackathon: the seed data, donations, the agent and its tools, the approval flow, the four custom widgets, live updates, the Gratia theme and the tests.
Built with AI. The code was written with Claude Code, using APIMatic's PayPal Context Plugin skills for the PayPal Server SDK. Changes were checked in a real browser with Playwright. The demo video's voice is generated with OpenAI text-to-speech.
Challenges we ran into
- Hours of latency, and a dashboard that had to feel live. PayPal Transaction Search can lag by hours. Mirroring each online gift as a paid invoice, and watching the invoice count from the open dashboard, brought that down to seconds.
- Widgets that stopped listening. Our first custom widget ignored filters, because Studio refreshes a widget without changing its props. We reproduced it in a browser and fixed it with one shared data hook.
- Numbers a note can't get wrong. A donor whose check was deposited twice and refunded looked like a $1,000 monthly sponsor. An agent writing personal thank-you notes can't be fed that, so the tools now leave out gifts refunded in full, and tests hold them to it.
- A public demo paying for its own model calls. That called for a same-origin check, limits per visitor and per day, and a clear message when the budget is used up.
Accomplishments that we're proud of
- A gift made on the donation page reaches an open dashboard within seconds, without a reload.
- A custom agent that hands work to AG Studio's own agents, instead of a single chatbot over a chart.
- Nothing leaves the dashboard without a person's click, and the server re-checks every reminder.
- A heatmap that answers a question a volunteer actually has, at a glance.
What we learned
- The hard part of "AI for nonprofits" isn't the writing. It's handing the model facts it can't get wrong, and keeping a person in charge of what goes out.
- PayPal's invoicing API goes a long way as a light donor database: it holds gifts, pledges, reminders, refunds and links to pay.
What's next for Gratia
- Going live on a real PayPal account, with the donation page embeddable on a nonprofit's own site.
- PayPal webhooks instead of polling.
- Thank-you notes sent directly, once a person has approved them, and a record of who was contacted.
- Monthly giving through PayPal Subscriptions, so a lapsed sponsor can restart in one click.
Built With
- ag-grid
- ag-studio
- apimatic
- claude-code
- gpt-5.4-mini
- next.js
- openai
- paypal
- paypal-invoicing-api
- paypal-javascript-sdk-v6
- paypal-orders-api
- paypal-server-sdk
- paypal-transaction-search
- playwright
- react
- tailwindcss
- typescript
- vercel
- vitest