API Reference
Referrals API
Endpoints for tracking and managing reseller and affiliate referrals.
Track Referrer Click
Tracks a click from a referral link to attribute sign-ups and conversions to the correct reseller. This is a crucial first step in the referral lifecycle.
Request Example
curl -X POST "https://api.ainstein.ai/track-referrer-click" \
-H "Content-Type: application/json" \
-d '{
"referrer": "reseller-slug",
"timestamp": "2025-08-12T12:00:00.000Z",
"userAgent": "Mozilla/5.0..."
}'Body
referrer(string)The referral slug or Clerk User ID of the reseller.
timestamp(string)The ISO 8601 timestamp of the click event.
userAgent(string)The user agent string of the client.
orgId(string)The Clerk organization ID, if available.
orgSlug(string)The organization slug, if available.
Responses
Response Example
{
"success": true,
"sessionId": "session_1660305600000_abcdef123",
"resellerName": "reseller-slug",
"orgId": "org_2zYd7GcLtWqLr5Mlh8W48wPoAwQ"
}Response Example
{
"error": "Reseller not found"
}