> ## Documentation Index
> Fetch the complete documentation index at: https://docs.indic8.ing/llms.txt
> Use this file to discover all available pages before exploring further.

# Polar Setup Guide

> Step-by-step guide to connect Polar.sh Organization Access Tokens (OAT), products, and webhooks to Indic8.

Connect Polar to track software product checkouts, recurring backer tiers, donations, and GitHub sponsorship revenue.

## What You Need to Connect

| Credential                          | Where to find it in Polar                              | Description                                                             |
| :---------------------------------- | :----------------------------------------------------- | :---------------------------------------------------------------------- |
| **Organization Access Token (OAT)** | Polar Dashboard > Settings > Organization > Developers | Direct read-only API access to fetch sales, subscriptions, and products |
| **Webhook Secret Key** *(Optional)* | Polar Dashboard > Settings > Webhooks                  | Enables instant live transaction notifications                          |

***

## Part 1: Generate a Polar Access Token (OAT or PAT)

Indic8 uses Polar's REST API to read your products, active subscriptions, and one-time order volume.

<Steps>
  <Step title="Log in to Polar.sh">
    Open [Polar.sh](https://polar.sh/dashboard) and select your organization or creator profile.
  </Step>

  <Step title="Navigate to Developers Settings">
    1. In the left navigation, click **Settings**.
    2. Under the **Developers** section, click **Access Tokens** (or **Personal Access Tokens**).
  </Step>

  <Step title="Create New Access Token">
    1. Click the button **Create Token** (or **Create Organization Access Token**).
    2. Set the **Token Name** to: `Indic8 Analytics`.
    3. Under **Expiration**, select your preferred duration (e.g. `No expiration` or `1 year`).
  </Step>

  <Step title="Select Required Permission Scopes">
    Check the boxes for these read-only scopes:

    | Scope Name           | Required | What it allows Indic8 to do                                       |
    | :------------------- | :------- | :---------------------------------------------------------------- |
    | `orders:read`        | **Yes**  | Read one-time digital sales, checkouts, and customer country data |
    | `subscriptions:read` | **Yes**  | Read recurring pledges, tiers, active subscriber counts, and MRR  |
    | `products:read`      | **Yes**  | Read product titles, prices, and benefit tiers                    |
    | `customers:read`     | **Yes**  | Read buyer order counts for repeat cohort retention               |
  </Step>

  <Step title="Copy your Polar Token">
    Click **Generate Token** and immediately copy the token (it starts with `polar_oat_...` or `polar_pat_...`).
  </Step>
</Steps>

***

## Part 2: Connect Token in Indic8

1. Open your [Indic8 Dashboard](https://app.indic8.ing).
2. Navigate to **Settings > Integrations > Polar**.
3. Paste your token into the **Polar Access Token** input field.
4. Click **Connect Polar**.

Indic8 will validate the token against the Polar API and load your products and historical sales immediately.

***

## Part 3: Set up Real-Time Webhooks (Optional for Live Telemetry)

To receive live transaction pushes the second a customer buys:

<Steps>
  <Step title="Copy Indic8 Webhook URL">
    In Indic8 **Settings > Integrations > Polar**, copy your Webhook URL:

    ```text theme={null}
    https://api.indic8.ing/v1/webhooks/polar/whk_live_xxxxxxxx
    ```
  </Step>

  <Step title="Add Webhook in Polar">
    1. In Polar Dashboard, go to **Settings > Webhooks**.
    2. Click **Add Webhook Endpoint**.
    3. Paste your Indic8 Webhook URL.
    4. Subscribe to events: `order.created`, `order.refunded`, `subscription.created`, `subscription.updated`, and `subscription.canceled`.
    5. Save and copy the **Webhook Secret** into Indic8.
  </Step>
</Steps>
