Trackli Docs
Everything you need to integrate Trackli with your application.
Quick Start Guide
Get up and running in minutes. Create affiliates, generate referral links, and record your first conversion.
Read guideAPI Reference
Full REST API reference for conversions, orders, affiliates, and webhooks. Includes curl and JavaScript examples.
View API docsQuick 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. Start on the free-forever plan — 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"
# 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"
}'Referral Links
Referral links are the foundation of affiliate tracking. When a visitor clicks a referral link, Trackli records the click server-side and redirects to your destination URL with the ref code appended. Attribution is handled via server-side matching — no cookies required.
How it works
- Affiliate shares their unique referral link
- Visitor clicks the link — Trackli records the click (timestamp, IP, user agent)
- Visitor is redirected to your destination URL with the ref code passed as a URL parameter
- When the visitor purchases, pass the ref code to
POST /api/conversionor include it in your payment platform metadata
Example URLs
# Redirect-based tracking link
GET https://trytrackli.com/yourbrand/partner123
# The system will:
# 1. Record the click (affiliate, timestamp, IP, user agent)
# 2. Redirect the visitor to your destination URL
# e.g. https://yoursite.com?ref=partner123
# Your app should persist the ref parameter and
# include it when calling the conversion API or
# pass it in your payment platform metadata (e.g. Stripe checkout metadata)API Reference
All endpoints accept and return JSON. Authenticate with an X-API-Key header. Base URL: https://trytrackli.com/api
/api/conversionRecord 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" }/api/track/orderTrack 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
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
- 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
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();