Skip to main content
Connect Polar by pasting an organization access token. CrispStats imports your past orders and refunds, creates its own webhook when the token allows it, and records one-time purchases, new subscriptions, renewals and refunds from then on. Put the visitor id in the checkout’s metadata and each order is tied to the visit that led to it.

What is recorded

Every order is read back from Polar’s API with your token before it counts as verified revenue. Each payment carries the product name, the currency, the order’s time and the customer’s email, hashed and masked before storage.

Connect Polar

1

Open the Polar panel

In CrispStats, open the site’s Settings, then Integrations. Select Connect a payment provider and choose Polar.
2

Create the token

Under Polar organization access token, select Create an access token in Polar. Then:
  1. Open Settings, then Access tokens, and choose Create token.
  2. Name it CrispStats and choose No expiration.
  3. Tick orders:read, refunds:read, organizations:read and webhooks:write.
  4. Create the token and paste it here.
3

Paste the token and connect

Paste the token. CrispStats checks it with Polar at once and shows your organization’s name. Select Connect Polar.With webhooks:write, CrispStats creates one webhook endpoint for this site and the row shows Connected to your organization. Live. Without it, the row says “Updates every minute. Add webhooks:write to the token to see sales the moment they happen.”
4

Pass the visitor id at checkout

A personal access token (polar_pat_) is refused: “That is a personal access token for every organization you belong to. Create an organization access token instead.” Polar tokens cannot be edited once made, so a token that lacks a scope is refused with the scope it needs: create a new token with it ticked.

What the token can do

CrispStats does not ask for subscriptions:read (orders say whether they are new or a renewal), customer scopes, or any scope that changes products, checkouts or refunds. It never moves money.

How fresh the numbers are

With webhooks:write, Polar sends each order within seconds and CrispStats checks every 15 minutes as a safety net. Without it, CrispStats reads new orders and refunds every minute, so a sale appears within a minute. An order seen both ways is stored once.

Past payments

When you connect, CrispStats imports every paid order and refund since your first. See revenue history.

Test mode

Tokens made in Polar’s sandbox (sandbox.polar.sh) connect to the sandbox. The panel says “This is a test token. Test payments show with a Test tag and never count as verified revenue.” and offers Connect in test mode or Use a live key. Sandbox orders show with a Test tag and are left out of every total.

Pass the visitor id at checkout

Add the id from crispstats.id() to the checkout’s metadata as crispstats_visitor_id:
The order’s metadata is merged over the customer’s metadata, so an id on the customer also counts. The customer’s external_id is used as your own user id when the metadata has none. An order without a visitor id is still recorded and counted, without a visit.

Disconnect

Select Disconnect on the Polar row. CrispStats deletes its webhook endpoint in Polar and destroys the saved token and signing secret. Payments already recorded stay. You can then delete the token in Polar.
Connections made earlier by pasting a webhook secret keep working. They cannot import history or verify payments: connect again with a token to add both.

Next steps

Pass the visitor id

When there is no id, and attributing across days.

Refunds and renewals

How payment kinds are recorded across providers.

Revenue history

What the import reads and how it avoids counting twice.
Last modified on November 24, 2026