# Next.js boilerplate with Polar

> Subscriptions and one-time payments on Polar, the merchant of record: hosted checkout, the customer portal, refunds that revoke access, and a signature-verified webhook with delivery-id idempotency. Plans live in src/lib/pricing.ts and /pricing renders with no keys.

Merchant of record for developers. Polar sells to your customer, so tax is its job.

- **Category:** Payments
- **Pricing:** Free Starter plan at 5% + 50c per transaction. Paid plans lower the rate: Pro is $20/month at 3.8% + 40c, and Growth and Scale go lower. Non-US cards add 1.5%. Tax calculation, filing and liability are included. Organisations created before May 27, 2026 can stay on the Early Member plan: 4% + 40c, plus 0.5% on subscriptions.
- **Best for:** Solo founders and small teams selling digital products or SaaS worldwide, by subscription or as a one-time lifetime deal. You skip registering for VAT, GST and US sales tax before your twentieth customer.
- **Requires:** database, auth
- **Conflicts with:** stripe, dodo
- **Vendor docs:** https://polar.sh/docs/introduction

## Trade-offs

- Polar is the seller on the customer's statement and invoice. That is the point: the tax liability moves to Polar. It also means the descriptor is not your brand, and enterprise buyers sometimes ask why.
- Payouts arrive on Polar's schedule, after it has collected and remitted. Plan your runway on that, especially in the first month.
- The fee is higher than a direct card processor because tax is included. At high volume, compare it with a processor plus a tax vendor.
- One product is one price. A plan sold monthly, yearly and for life is three Polar products and three env ids. `billing:sync-plans` creates them for you.
- Sandbox and production are separate Polar deployments with separate tokens, products and webhook secrets. Launch day is a second setup, not a switch.
- Fewer billing knobs than Stripe. For a plain subscription or a lifetime deal that is often enough.

## Known fixes it ships

- [Merchant of record explained, what Polar takes on that Stripe leaves with you](https://agenticboilerplate.com/cookbook/polar/merchant-of-record-vs-stripe): With Stripe you are the seller and you owe VAT, GST and US sales tax yourself. Polar sells on your behalf and carries that liability. What actually changes, what it costs, and how little of it reaches your code.
- [Moving from Stripe to Polar without breaking existing customers](https://agenticboilerplate.com/cookbook/polar/migrate-a-stripe-catalogue-to-polar): You cannot transfer live Stripe subscriptions to Polar. Sell new customers on Polar, keep Stripe's webhook alive for the ones you have, move them at renewal, and let the provider-neutral billing rows carry access through the whole overlap.
- [One-time and subscription products on Polar, from lifetime deal to renewal](https://agenticboilerplate.com/cookbook/polar/one-time-and-subscription-products-on-polar): Polar sells one price per product, so a plan sold monthly, yearly and for life is three products. How each kind checks out, which webhook proves it was paid, where it is stored, and how access resolves when a customer holds both.
- [Refunds and disputes on Polar, and taking access back exactly once](https://agenticboilerplate.com/cookbook/polar/refunds-and-disputes-on-polar): A refund arrives as order.refunded with the whole order. A dispute arrives as nothing at all. How this repo revokes a lifetime deal in both cases, why partial refunds keep access, and why a late paid delivery cannot give it back.
- [Polar sandbox to production, the checklist that stops launch-day silence](https://agenticboilerplate.com/cookbook/polar/sandbox-to-production-checklist): Sandbox and production are separate Polar deployments with separate tokens, product ids and webhook secrets. Nothing carries over. Everything that has to be recreated, in order, and how to prove it worked.
- [Polar webhooks arrive twice and sign two ways, make the handler survive both](https://agenticboilerplate.com/cookbook/polar/webhook-idempotency): At-least-once delivery means duplicates and out-of-order events are normal traffic, and Polar changed its signing key format in September 2026. Verify with both keys, claim the webhook-id before any write, re-read subscriptions and let orders only move forward.

## Generate it

[Build a repo with Polar](https://agenticboilerplate.com/build?b=polar)

---

Agentic Boilerplate: A Next.js repo your agent already knows. Free during launch, then $99 once.

- Site map for agents: https://agenticboilerplate.com/llms.txt
- Public API: https://agenticboilerplate.com/openapi.json
- Contact: agenticstudio@gmail.com
