Skip to Content
DocsQuickstart

Quickstart

Make your first API calls in under 5 minutes.

1. Get your API key

Sign in to the Incenta dashboard  and copy your API key from Apps > Your App > Settings.

2. Create a referral code

curl -X POST https://api.incenta.dev/v1/referrals \ -H "x-api-key: inc_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "campaignId": "camp_abc123", "referrerId": "user_456" }'

The response includes a unique referral code:

{ "referralCode": "ABC123", "referralId": "ref_789", "status": "PENDING" }

3. Track a click

When a referred user visits your landing page via a referral link:

curl -X POST https://api.incenta.dev/v1/clicks \ -H "x-api-key: inc_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "referralCode": "ABC123", "refereeId": "user_789" }'

4. Record a conversion

When the referred user completes a desired action (signup, purchase, etc.):

curl -X POST https://api.incenta.dev/v1/conversions \ -H "x-api-key: inc_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "referralCode": "ABC123", "refereeId": "user_789", "amount": 49.99, "metadata": { "plan": "premium" } }'

5. Check stats

curl https://api.incenta.dev/v1/stats?campaignId=camp_abc123 \ -H "x-api-key: inc_live_xxxxx"

Response:

{ "totalReferrals": 142, "totalClicks": 89, "totalConversions": 34, "conversionRate": 38.2, "totalRewardValue": 169.99 }
Last updated on