Skip to main content
If you sell through Polar, you don’t need to write any code to run your affiliate program. You paste one Polar token into Affixo. Affixo checks it, adds its own webhook in your Polar account, and from then on every paid order, renewal, refund and chargeback comes in by itself and pays (or takes back) the right commission. Affixo only reads your Polar sales. It never charges your customers, never moves money in Polar, and never pays your affiliates for you.

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.
One processor per account. A workspace takes its sales from Stripe, from Polar, or from your own server, never more than one. If this workspace has already used Stripe, it can’t switch to Polar. Use a new workspace for your Polar products, or contact support if you think the Stripe link is a mistake.While your workspace is set to Polar, Affixo doesn’t book live sales sent by your own server through /v1/track/sale or /postback, so one purchase can’t pay two commissions. Those calls get a 409 with the error processor_connected, so turn your server’s sale reporting off. Test sales, leads and refunds still work.

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.
None of these permissions lets Affixo create orders, issue refunds or move money. Polar doesn’t tell Affixo which permissions a token has, so we can’t check this for you: a token that can also write orders, refunds or products would still connect, and could change your Polar account if it ever leaked. Tick only the permissions above.

Step 2: Paste it into Affixo

  1. In Affixo, open Settings → Payments & products and choose I use Polar.
  2. Pick Live for your real store. (Use Sandbox for a Polar sandbox token, see Test it with the Polar sandbox.)
  3. Paste the token and click Connect Polar.
Affixo then: You’ll see the connection as Connected, with the last 4 characters of the token and the time of the last event from Polar. Affixo never shows the token again. In Polar, the new webhook appears under Settings → Webhooks. Leave it there: it is how your sales reach Affixo. 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’s reference_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.
Start every sandbox purchase from a test visit. Affixo keeps test and live data apart: a sandbox sale only matches a test click, and a normal visit is a live click. If you click an affiliate link the usual way and then pay in the sandbox, the sale arrives but credits no one.
  1. 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.)
  2. Create a sandbox organization access token with the same permissions as in step 1.
  3. In Affixo, choose Sandbox on Settings → Payments & products, paste the sandbox token and click Connect Polar sandbox.
  4. Open your site through an affiliate’s link with _sa_test=1 added, for example https://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.
  5. Click the Polar checkout link and pay with Polar’s test card 4242 4242 4242 4242, any future expiry and any CVC.
  6. 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.
  7. To test refunds, refund part of the order in the Polar sandbox and watch the commission shrink.
A sandbox connection doesn’t count as your payments being connected. Connect Live before you launch.

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.