Polar Integration Guide

Set up affiliate tracking for Polar checkouts and subscriptions with Discover Mac Apps using first-party cookies and webhook integration.

Polar is a platform built specifically for developers, open-source maintainers, and indie hackers. Integrating Polar with Discover Mac Apps is fast and efficient.

1. Finding Your Webhook Secret in Polar

  1. Navigate to your Polar Dashboard.
  2. Go to Settings > Webhooks.
  3. Click Add Webhook.
  4. URL: Enter the unique Discover Mac Apps webhook URL from your dashboard.
  5. Secret: Polar will provide a webhook secret. Copy this and paste it into your Discover Mac Apps dashboard.

2. Listening to Polar Events

When configuring the webhook in Polar, you should listen to:

  • order.created (Fired on successful one-time purchases)
  • subscription.created (Fired on new subscriptions)
  • subscription.updated (Fired when payments renew)

3. Connecting the Affiliate ID

Similar to other platforms, if you are using Polar's API to generate checkouts, you must pass the affiliate ID in the checkout metadata.

Read the dma_aff_ref cookie from the user's browser, and pass it under the metadata key when creating a Polar checkout session. This ensures the webhook payload we receive contains the affiliate reference.

Was this article helpful?
Still need help? Contact Support