RefKit Docs
Developer Integration

API Reference

Request and response contracts for SDK-facing routes.

POST /track

Tracks an event for the business identified by API key.

Request

{
  "eventName": "referral",
  "referrer": "alex-ally",
  "metadata": {
    "referredUserEmail": "new-user@example.com",
    "campaign": "spring_launch"
  },
  "idempotencyKey": "custom-key-12345678",
  "source": "partner-web"
}

Response Shapes

Synchronous path:

{
  "success": true,
  "processedSynchronously": true,
  "queued": false
}

Queued path:

{
  "success": true,
  "queued": true,
  "jobId": "...",
  "jobType": "EVENT_PROCESS",
  "message": "Event accepted for asynchronous processing"
}

POST /sdk/referrals/apply

Applies referral code and optionally creates referred user.

Request

{
  "referralCode": "alex-ally",
  "referredUserEmail": "new-user@example.com",
  "referredUserName": "New User",
  "source": "partner-web"
}

Response Shapes

Synchronous path (referredUserId provided):

{
  "success": true,
  "processedSynchronously": true,
  "queued": false
}

Queued path (referredUserEmail only):

{
  "success": true,
  "queued": true,
  "jobId": "...",
  "jobType": "SDK_REFERRAL_APPLY",
  "message": "Referral apply accepted for asynchronous processing"
}

GET /sdk/referrals?limit=50

Returns referrals associated with the current API key.

  • limit is clamped to 1..200.

On this page