Before you start
You need:- The Affixo snippet on every page of your site, as described in Integrate Affixo tracking. It is what tells Polar which affiliate sent the buyer.
- A program with a commission set, so a sale has something to pay.
- Admin access to your Polar organization, to create the token.
- Billing access in Affixo, to change how your workspace takes payments.
Step 1: Create a Polar token
In Polar, open Settings → Access Tokens and create an organization access token. Tick these permissions and no others:
Copy the token when Polar shows it. It starts with
polar_oat_.
If you give the token an expiry date, put a reminder in your calendar to reconnect with a new token before it runs out. Polar’s own guide is Organization access tokens.
Step 2: Paste it into Affixo
- In Affixo, open Settings → Payments & products and choose I use Polar.
- Pick Live for your real store. (Use Sandbox for a Polar sandbox token, see Test it with the Polar sandbox.)
- Paste the token and click Connect Polar.
Step 3: Your Polar checkout links
Checkout links on your site work as they are. When the snippet sees a link to a Polar checkout, it adds the visitor’s id to it as Polar’sreference_id. Polar keeps that id on the order, and Affixo uses it to find the affiliate.
The snippet recognises links to buy.polar.sh, Polar checkout pages on polar.sh, and Polar checkout links (api.polar.sh/v1/checkout-links/...), plus their sandbox versions. The links have to be on a page where the snippet is installed.
If your server creates checkouts with Polar’s API, there’s no link for the snippet to tag. Pass the visitor id yourself:
If you already put your own
reference_id on a checkout link, the snippet leaves it alone. Sales from that link can then only be matched by the buyer’s email, if they signed up as a lead first. See Attribution.What Affixo books
Polar doesn’t send dispute webhooks, so Affixo checks your Polar disputes every 15 minutes. A chargeback can take that long to show.
Each Polar event is booked once, however many times Polar sends it.
Test it with the Polar sandbox
Polar has a separate sandbox with test cards. Connect it in Affixo as its own Sandbox connection. Sandbox sales book as test sales with test commissions, which are never paid and never counted in reports, payouts or alerts.- In the Polar sandbox, create a product and a checkout link, and put the link on a page of your site that has the snippet. (A test page is fine.)
- Create a sandbox organization access token with the same permissions as in step 1.
- In Affixo, choose Sandbox on Settings → Payments & products, paste the sandbox token and click Connect Polar sandbox.
- Open your site through an affiliate’s link with
_sa_test=1added, for examplehttps://yoursite.com/?ref=jane&_sa_test=1. That marks your visit as a test for the next 30 minutes in that browser. See Test links. - Click the Polar checkout link and pay with Polar’s test card
4242 4242 4242 4242, any future expiry and any CVC. - Within a few seconds the sale shows on Referrals as a test sale, credited to that affiliate. The Check it works box on the Polar screen also says Sandbox events are arriving.
- To test refunds, refund part of the order in the Polar sandbox and watch the commission shrink.
Change or remove the connection
- Rotate the token: create a new token in Polar, then paste it with Reconnect live (or Reconnect sandbox). Affixo adds the new webhook before it removes the old one, so no sale is missed. The new token must be for the same Polar organization.
- Disconnect: click Disconnect on the connection. Affixo removes its webhook in Polar and deletes the token. New sales stop coming in until you reconnect. Sales already booked stay as they are.
- Stop using Polar: after disconnecting, Use Stripe or another processor, at the top of the page, takes you back to the list of options. This only works until your first real (live) Polar sale. After that the workspace stays on Polar.
Troubleshooting
Still stuck? Contact support and include the Polar order id.