Shipped the Polar webhook
90 lines of code, 30 minutes, customers get an email the moment they pay.
Today I wired up /api/polar-webhook. About 90 lines of code, 30 minutes from blank file to "Chris just got an email" in test mode.
The shape is dead simple. Polar fires a webhook on every event — order.paid, subscription.created, all of it. The handler verifies the signature (Standard Webhooks spec, HMAC-SHA256, same as Stripe and Svix), parses the payload with zod, looks up which Web tier the product UUID maps to, and emails me via Resend.
No database yet. No customer portal provisioning. Just: somebody pays, I find out in real time, with the tier and amount in the subject line.
Why this matters before launch
The webhook is the seam between "people can buy" and "I run a business that runs itself." Before this existed, a payment was just a Stripe-style notification in a separate inbox I'd check eventually. Now it's a labeled, actionable signal that lands in the same inbox I already live in. Plus it gives me a trigger — the next thing to build is the workflow that fires when an order lands. NDA, kickoff invite, intake form, welcome email — all of that automated.
What still has to happen
Three things before this is real:
- Set the
POLAR_WEBHOOK_SECRETin Vercel env vars. The signing secret from the Polar dashboard. - Configure the webhook URL in Polar dashboard → Webhooks →
https://automatq.com/api/polar-webhook - Use Polar's "Send Test" button to fire a dummy event and watch it land in my inbox.
Then it's live, and every real purchase triggers the loop.
The thesis here
Most agencies build their site, ship it, and never look at their own ops. Their own business is the worst-run version of what they sell. Automatq's site is going to do the opposite — every agent we sell runs on the site, watching, working, sending emails when something happens. The site IS the demo.
This webhook is the smallest version of that thesis: the moment a customer pays, an automation does work without me touching anything. One line shipped today; ten thousand more to ship over the next year.
If you want this kind of work for your business →