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. Start on the free-forever plan — 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"

# Record your first conversion
curl -X POST https://trytrackli.com/api/conversion \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $TRACKLI_API_KEY" \
  -d '{
    "customerEmail": "buyer@example.com",
    "affiliateRefCode": "partner123",
    "orderAmount": 4900,
    "currency": "usd"
  }'

API Reference

REST

All endpoints accept and return JSON. Authenticate with an X-API-Key header. Base URL: https://trytrackli.com/api

POST
/api/conversion

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

curl

curl -X POST https://trytrackli.com/api/conversion \
  -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://trytrackli.com/api/conversion", {
  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
/api/track/order

Track an order from your payment processor and automatically calculate the affiliate commission. Include the payment event ID for deduplication.

curl

curl -X POST https://trytrackli.com/api/track/order \
  -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://trytrackli.com/api/track/order", {
  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 to the public ingestion API. 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

Pass your key in the X-API-Key request header. The key is validated on every call to the public API endpoints (POST /api/conversion and POST /api/track/order).

# Include the key in the X-API-Key header on every request
curl -X POST https://trytrackli.com/api/conversion \
  -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"
  }'

# 401 is returned if the key is missing or invalid
# { "message": "Invalid or missing API key" }
const res = await fetch("https://trytrackli.com/api/conversion", {
  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",
  }),
});

if (res.status === 401) {
  throw new Error("Invalid or missing API key");
}
const data = await res.json();