Supaffi

Set up/Connect Polar

Connect Polar

Sell through Polar instead of Stripe, with an organization access token.

A product can sell through Polar instead of Stripe. Polar is a merchant of record, so it handles your sales tax. Available since 0.8.0.

Pick Polar for a product

When you add a product, set Payments to Polar. The choice is made once, when the product is created.

Connect your Polar organization

  1. Create an organization access token in Polar

    Give it these scopes:

    ScopeUsed for
    webhooks:readChecks the webhook Supaffi made.
    webhooks:writeCreates the webhook that tells Supaffi about sales.
    discounts:readLists your discounts for promo codes.
    discounts:writeCreates and deletes affiliates' promo codes.
  2. Paste it in the Payments step

    The token starts with polar_oat_. Supaffi checks it, then creates its webhook in Polar, pointing at https://<your-subdomain>/api/webhooks/polar. You never set up a webhook yourself.

A token from Polar's sandbox works too, for testing. If Polar rejects the token, the step shows Polar rejected that token. Create a new one and paste it again.

Tag your checkouts

Polar checkout links on your pages need nothing more than the tracking script. It adds the referral to every link to buy.polar.sh, sandbox links included.

If your server creates Polar checkout sessions, pass the __supaffi_referral cookie in the checkout metadata under supaffi_referral, as with Stripe Checkout Sessions:

Polar checkout
const referralToken = cookies.get("__supaffi_referral");

await polar.checkouts.create({
  // ...your existing options
  metadata: {
    // ...your existing metadata
    ...(referralToken && { supaffi_referral: referralToken }),
  },
});

To stop a payment from earning, set the metadata key supaffi to false on the checkout, the subscription or the customer in Polar.

What earns

  • One-time purchases, a subscription's first payment and every renewal, plan changes included.
  • Commissions are on what the customer paid after discounts and before tax.
  • A free trial starts earning at its first paid order.
  • Refunds, partial or full, lower or cancel the commission, including refunds Polar makes on its own to head off a chargeback.
  • A subscription earns nothing more once Polar ends it.

Promo codes on Polar

Promo codes work the same way, with a Polar discount in place of a Stripe coupon. The program's Customer discount lists your Polar discounts.

  • Each affiliate's code is a new discount copied from the program's one: same amount, duration and products, under their code.
  • Polar has no rule for first-time customers, so each code works once per customer instead.
  • You can link a discount code that already exists in Polar.
  • Turning off a code Supaffi made deletes it in Polar.

How Polar differs from Stripe

StripePolar
ChargebacksAn open chargeback holds its commission until it closes.Polar sends no chargeback events. The holding period is your protection.
Self-referralsCaught by the affiliate's email or card.Caught by email only. Polar does not share the card.
Sales taxYours to handle.Handled by Polar.