# Polar

> Sell digital downloads or software subscriptions with a checkout that can also deliver the file or license key after payment.

Web page: https://buildladder.com/tools/polar

If you sell a set of design icons, the buyer expects a download as soon as they pay. Polar lets you attach that benefit to the product. It acts as the seller for the transaction and handles applicable sales tax.

Set up a sample product with a small file and walk through a test purchase. Follow the buyer’s download link and open the file. Checking what arrives helps you catch an old or missing attachment before launch.

- Made by: Polar
- Official site: https://polar.sh
- Cost: Free Starter plan: 5% + 50¢ per sale, plus 1.5% for cards from outside the US. Paid plans from $20 a month lower the fee. Checked 9 Nov 2026.
- What you need first: A Polar account. Before your first payout, Polar reviews your business and checks your ID.
- Who it helps: When you sell software, downloads or access to a private GitHub repository or Discord server.
- When to skip it: If you sell physical goods or human services. Polar doesn’t support them.
- Updated: 2026-11-10

## Take payments with Polar

Add a Polar checkout for one digital product. You practice in Polar’s separate sandbox with fake cards first, then switch to real payments after a review.

What you’ll end up with: A Buy button on your site that opens Polar’s checkout, takes a test payment, and tells your site when someone has paid.

### You’ll need

- A website or web app you’re building with your AI tool, running on your computer.
- PLAN.md, with the digital product you want to sell and its price.
- To take real payments: your site online, a government ID, and a bank account for payouts.
- Polar sandbox account (https://sandbox.polar.sh): It’s free and takes test payments only
- Polar account (https://polar.sh): It has no monthly fee on the Starter plan and takes a fee from each sale

### Your part

- Create the sandbox account, the product and the access token.
- Copy keys into your .env file.
- Pay with the test card, then pass Polar’s review to get paid out.

### Step 1 of 6: Create a sandbox account and a product

This step is mine to do. Walk me through it, one action at a time:
- Go to sandbox.polar.sh and create a testing account using a sign-in option shown there.
- Create an organization when asked. It holds your products and customers.
- Open Products and create a new product. Choose a one-time purchase or a subscription, then set a fixed price.
- Save the product. Your AI tool will ask for its product ID later, and that ID is safe to share.

It worked when: Your Polar sandbox organization holds one product with its price.

If something goes wrong:
- You signed in at polar.sh instead. Open the organization switcher and click Go to sandbox. Or type sandbox.polar.sh into your browser.
- You don’t know if Polar allows what you sell. Read Polar’s Acceptable Use Policy before you build. It lists what you can’t sell.

### Step 2 of 6: Save your access token in .env

This step is mine to do. Walk me through it, one action at a time:
- Ask your AI tool: “Which file in this folder should hold secret keys, and is it ignored by Git? Don’t ask me for the key.”
- If that file isn’t ignored by Git yet, ask your AI tool to add it to .gitignore before you go on.
- In your sandbox organization’s settings, open the area for organization access tokens and create one.
- Give it a name and an expiration date. Scopes set what the token is allowed to do. Ask your AI tool which ones a checkout needs.
- Copy the token. Open the file your AI tool named, such as .env, and add POLAR_ACCESS_TOKEN= followed by the token.
- Add a second line, POLAR_ENVIRONMENT=sandbox, then save the file.

It worked when: A file that Git ignores holds POLAR_ACCESS_TOKEN and POLAR_ENVIRONMENT=sandbox.

If something goes wrong:
- You get an error about your token. Sandbox tokens only work with the sandbox. Check you made it at sandbox.polar.sh, and POLAR_ENVIRONMENT says sandbox.
- You pasted the token into your AI tool’s chat by mistake. In the organization’s settings, revoke that access token and create a new one. Save the new token in your file.

### Step 3 of 6: Add a checkout for one product

Read PLAN.md in this folder. It says what I want to sell.

I want to add Polar payments for one product, in Polar’s sandbox only. No real money.

Before you write code, check Polar’s current official docs at polar.sh/docs for checkouts. Then look at my code and tell me:
- whether it has a server part that can keep a secret token safe
- if it doesn’t, the simplest option, such as a Polar Checkout Link, and what adding a server would change

Wait for my answer. Then build the smallest version that works:
- a Buy button on the page where people decide to buy
- a checkout that sends them to Polar’s hosted checkout page
- a page they come back to after paying

Rules:
- Read the access token from POLAR_ACCESS_TOKEN. Use the sandbox or production server based on POLAR_ENVIRONMENT, which is “sandbox” for now. Never put a token in code.
- Read the product ID from a POLAR_PRODUCT_ID environment variable, because it changes when I take real payments. Tell me where to find it. It’s safe to share.
- Keep everything that already works. Ask before you change something big.

When you’re done, explain in plain words what you changed, and how I can see the Buy button.

It worked when: The Buy button on your site opens Polar’s checkout page with your product and price.

If something goes wrong:
- Your AI tool says your site has no server part. Ask it to compare two choices in plain words: a Polar Checkout Link, or adding a small server. Pick one before it builds.
- The checkout says the product wasn’t found. Check POLAR_PRODUCT_ID is the ID from your sandbox product. Products from polar.sh don’t exist in the sandbox.

### Step 4 of 6: Buy it with a test card

This step is mine to do. Walk me through it, one action at a time:
- Open your site and click your Buy button.
- Use the email address you signed up with. The sandbox only sends emails to members of your organization.
- Enter the card number 4242 4242 4242 4242, any future expiry date and any CVC.
- Pay, then wait to come back to your site.
- Look for the new order in your sandbox dashboard.

It worked when: You land back on your site, and your sandbox dashboard shows a successful test order.

If something goes wrong:
- You don’t come back to your site after paying. Tell your AI tool: “After a test payment, I don’t land back on my site. Please find out why.”

### Step 5 of 6: React when a payment succeeds

The test checkout works. Now I want my site to react when a payment succeeds, using a Polar webhook.

Check Polar’s current docs on webhooks first. Then:
- Add a webhook route that listens for order.paid.
- Verify every event with Polar’s official SDK, using the raw request body and the signing secret from the POLAR_WEBHOOK_SECRET environment variable.
- When a payment succeeds, do this one thing: (say what should happen, like “email the download link” or “mark the order as paid”).
- Give access from the webhook, not from the page they come back to, because people can close that page before it loads.
- Make it safe if the same event arrives twice.

If my site has no server part, stop and explain my options before you build anything.

To test on my computer, check Polar’s docs for how to forward sandbox webhooks to my machine, for example with the Polar CLI. Tell me the exact steps, and I’ll run any command myself in a separate terminal. Tell me where to find or set the signing secret, and I’ll put it in my .env file myself.

Keep everything that already works. When you’re done, explain what changed and how to check it worked.

It worked when: After a test payment, your site does the one thing you asked, and the terminal forwarding your webhooks shows order.paid.

If something goes wrong:
- The webhook fails with a signature error. Check POLAR_WEBHOOK_SECRET in your .env file matches the secret for this endpoint, then restart your site.
- Nothing happens after a payment. Check the forwarding command is still running in its own terminal. Then tell your AI tool what that terminal shows.

### Step 6 of 6: Switch to real payments

This step is mine to do. Walk me through it, one action at a time:
- Finish building first. Polar reviews faster when your product, checkout and webhook work and your site is online.
- Go to polar.sh and create your real account and organization. Create your product again with the same price.
- Open Finance, then Account. Submit your business for approval, verify your ID with a selfie, and connect a payout account. Finish any details Polar asks for, and check the account’s status before you take real payments.
- In your real organization’s settings, create an organization access token. Save it in your host’s settings as POLAR_ACCESS_TOKEN.
- In the same settings, set POLAR_ENVIRONMENT to production and POLAR_PRODUCT_ID to your real product’s ID.
- In Settings, then Webhooks, click Add Endpoint. Enter your live webhook address, choose Raw, set a secret and pick order.paid.
- Save that secret in your host’s settings as POLAR_WEBHOOK_SECRET.
- Don’t test with a real card, because Polar treats it as card testing. Make a 100% discount code instead, so no money moves.

It worked when: Your public site has a live checkout, and the live keys are only in your host’s settings.

Before we move on, check with me:
- Does a purchase with your 100% discount code make your site do the one thing you asked?

If something goes wrong:
- You can’t get paid out yet. Payouts wait for Polar’s review. Polar says initial reviews can take up to 14 days. A payout you request during a review shows as Held for review, then pays out after approval. Later reviews can hold payouts while purchases and renewals continue.
- The live checkout fails but the sandbox worked. Check every setting in your host uses production values: the token, the product ID and the webhook secret. Then put your site online again.

Compare Polar with the other options: https://buildladder.com/concepts/payments.md
