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

# Quickstart

> Add affiliate tracking with Tolt: install tolt.js, track signups and payments, and see your first referred sale in minutes.

Every Tolt setup is the same three pieces. Add them in order and you're live. For the same flow explained step by step, see [Track with tolt.js](/guides/with-toltjs).

1 tolt.js

2 tolt.signup()

3 Payments

&#x20;Tolt

**1. Add the script to your site**

Paste this in the `<head>` of every page, including your marketing site and your app. Your public key is in **Dashboard → Settings → Integrations**.

```html index.html theme={"system"}
<script
  async
  src="https://cdn.tolt.io/v2/tolt.js"
  data-tolt="YOUR_PUBLIC_KEY"
></script>
```

When someone lands on `acme.com/?ref=sam`, the script records the click and remembers Sam in a first-party cookie. Using a framework? See [Install tolt.js](/tracking/script).

**2. Tell Tolt when someone signs up**

Call `tolt.signup()` right after a visitor creates an account. It turns the click into a customer that belongs to Sam, for good. It waits for the click to be recorded, and `?.` skips it if an ad blocker stopped the script. If your signup completes as the page loads, for example on an OAuth callback, check `window.tolt` first and wait for the `toltScriptLoaded` event if it isn't there yet.

```js signup.js theme={"system"}
const result = await window.tolt?.signup(user.email);

if (result?.customer_id) {
  // Save it on your user. You'll need it to record payments.
  await saveToltCustomerId(user.id, result.customer_id);
}
```

Visitors who didn't come through a partner link are ignored, so you can call it for everyone.

**3. Record payments**

**Stripe, Paddle, Chargebee**

Connect your billing provider in **Dashboard → Settings → Integrations**, then follow its guide to pass the referral at checkout. Payments, renewals and refunds flow in automatically.

> **[Stripe](/integrations/stripe)**

> **[Paddle](/integrations/paddle)**

> **[Chargebee](/integrations/chargebee)**

**Any other billing**

Create an API key in **Dashboard → Settings → Integrations → Tolt API**, then report every successful charge from your server, renewals included. Amounts are in the smallest unit of your program's currency (cents for USD).

```ts TypeScript theme={"system"}
import { ToltApiClient } from "@tolt/api";

const tolt = new ToltApiClient({ token: process.env.TOLT_API_KEY! });

await tolt.transactions.create({
  customer_id: user.toltCustomerId, // from step 2
  amount: 4900, // $49.00
  charge_id: charge.id,
  source: "api",
});
```

```python Python theme={"system"}
import os
from tolt import ToltApi

tolt = ToltApi(token=os.environ["TOLT_API_KEY"])

tolt.transactions.create(
    customer_id=user.tolt_customer_id,  # from step 2
    amount=4900,  # $49.00
    charge_id=charge.id,
    source="api",
)
```

```bash cURL theme={"system"}
curl https://platform.tolt.com/v2/transactions \
  -H "Authorization: Bearer $TOLT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_3VbHc5dPj8fKq2LmZx7RtYw",
    "amount": 4900,
    "charge_id": "ch_123",
    "source": "api"
  }'
```

**4. Test the whole loop**

Create a test partner in the dashboard, open their link in a private window, sign up, and pay. Within a few seconds you'll see the customer and a commission under that partner.

Test partner Private windowClickacme.com/?ref=test0sSignupyour test email Lead1mPayment\$49.002mCommission\$14.70 Created2m

> [!TIP]
>
> Working with an AI coding agent? Run `npx skills add toltapp/skills` and ask it to "Integrate Tolt into this app". [More on building with AI](/ai).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.