Documentation

Trackli Docs

Everything you need to integrate Trackli with your application.

Quick Start

Guide

Get up and running with Trackli in three simple steps. Create your account, generate an API key, and start tracking referrals.

1

Create your Trackli account

Sign up at trytrackli.com. All plans include a 14-day free trial — no credit card required.

2

Generate your API key

Go to Settings and click Generate API Key. Store it securely — it is shown only once.

3

Start tracking referrals

Create affiliates, generate referral links, and use the API to record conversions.

# Store your API key
export TRACKLI_API_KEY="tk_live_your_key_here"

# Verify your key works
curl -H "x-api-key: $TRACKLI_API_KEY" \
  https://api.trackli.io/v1/account

API Reference

REST

All endpoints accept and return JSON. Authenticate with an x-api-key header. Base URL: https://api.trackli.io/v1

POST
/v1/conversions

Record a conversion when a referred customer completes a purchase or sign-up.

curl

curl -X POST https://api.trackli.io/v1/conversions \
  -H "Content-Type: application/json" \
  -H "x-api-key: tk_live_your_key_here" \
  -d '{
    "customerEmail": "buyer@example.com",
    "affiliateRefCode": "partner123",
    "orderAmount": 4900,
    "currency": "usd"
  }'

JavaScript

const res = await fetch("https://api.trackli.io/v1/conversions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.TRACKLI_API_KEY,
  },
  body: JSON.stringify({
    customerEmail: "buyer@example.com",
    affiliateRefCode: "partner123",
    orderAmount: 4900,
    currency: "usd",
  }),
});

const data = await res.json();
console.log(data);
// { id: "conv_abc123", status: "recorded" }
POST
/v1/orders

Track an order from Stripe or your payment processor. Include the event ID for deduplication.

curl

curl -X POST https://api.trackli.io/v1/orders \
  -H "Content-Type: application/json" \
  -H "x-api-key: tk_live_your_key_here" \
  -d '{
    "stripeEventId": "evt_1abc",
    "amountTotal": 4900,
    "currency": "usd",
    "customerEmail": "buyer@example.com",
    "affiliateRefCode": "partner123"
  }'

JavaScript

const res = await fetch("https://api.trackli.io/v1/orders", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.TRACKLI_API_KEY,
  },
  body: JSON.stringify({
    stripeEventId: "evt_1abc",
    amountTotal: 4900,
    currency: "usd",
    customerEmail: "buyer@example.com",
    affiliateRefCode: "partner123",
  }),
});

const data = await res.json();
console.log(data);
// { order: { id: "ord_xyz" }, commission: { id: "com_456", amount: 490, status: "pending" } }

Authentication

Auth

Trackli uses API keys to authenticate requests. Generate a key from your dashboard under Settings. Include it in every request as an x-api-key header.

Generating an API key

  1. Log in to your Trackli dashboard
  2. Navigate to Settings
  3. Click Generate API Key
  4. Copy and store the key securely — it is shown only once

Using your API key

# Include the key in the x-api-key header
curl -H "x-api-key: tk_live_your_key_here" \
  https://api.trackli.io/v1/account

# Response
{
  "id": "acc_123",
  "email": "you@example.com",
  "plan": "startup"
}
const res = await fetch("https://api.trackli.io/v1/account", {
  headers: {
    "x-api-key": process.env.TRACKLI_API_KEY,
  },
});

const account = await res.json();
console.log(account);
// { id: "acc_123", email: "you@example.com", plan: "startup" }