Trackli Docs
Everything you need to integrate Trackli with your application.
Quick Start
Get up and running with Trackli in three simple steps. Create your account, generate an API key, and start tracking referrals.
Create your Trackli account
Sign up at trytrackli.com. All plans include a 14-day free trial — no credit card required.
Generate your API key
Go to Settings and click Generate API Key. Store it securely — it is shown only once.
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/accountReferral Links
Referral links are the foundation of affiliate tracking. When a visitor clicks a referral link, Trackli records the click, sets a first-party cookie, and redirects to your destination URL.
How it works
- Affiliate shares their unique referral link
- Visitor clicks the link and lands on your site
- Trackli records the click with timestamp, IP, and referrer
- A first-party cookie attributes future conversions to this affiliate
Example URLs
# Basic referral link
https://yoursite.com?ref=partner123
# With UTM parameters
https://yoursite.com?ref=partner123&utm_source=affiliate&utm_medium=link&utm_campaign=launch
# Redirect-based tracking
GET https://trytrackli.com/yourbrand/partner123
# The system will:
# 1. Record the click (affiliate, timestamp, IP, user agent)
# 2. Set a 90-day first-party attribution cookie
# 3. Redirect the visitor to your destination URLAPI Reference
All endpoints accept and return JSON. Authenticate with an x-api-key header. Base URL: https://api.trackli.io/v1
/v1/conversionsRecord 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" }/v1/ordersTrack 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
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
- Log in to your Trackli dashboard
- Navigate to Settings
- Click Generate API Key
- 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" }