API Reference
Auto-generated
Affiliates
API reference for affiliates endpoints.
Auto-generated
This page was generated from the OpenAPI spec. Run
make generate-docs to refresh after spec changes.POST /api/v1/affiliates/apply
POST
/api/v1/affiliates/applyApply to become an affiliate
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| notes | string | Optional | notes |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/affiliates/apply \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json"Response Example
JSON
{
"status": "ok"
}GET /api/v1/affiliates/me
GET
/api/v1/affiliates/meGet my affiliate profile
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/affiliates/me \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"user_id": "example",
"referral_code": "example",
"referral_link": "example",
"status": "example",
"commission_rate": "example"
}GET /api/v1/affiliates/me/conversions
GET
/api/v1/affiliates/me/conversionsList my conversion history
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| status | string | Optional | Filter by conversion status |
| page | integer | Optional | Page numberDefault: 1 |
| page_size | integer | Optional | Items per pageDefault: 20 |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/affiliates/me/conversions \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json"Response Example
JSON
{
"items": [],
"total": 0,
"page": 0,
"page_size": 0
}GET /api/v1/affiliates/me/stats
GET
/api/v1/affiliates/me/statsGet my affiliate stats
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/affiliates/me/stats \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json"Response Example
JSON
{
"clicks_30d": 0,
"clicks_90d": 0,
"conversions_total": 0,
"conversions_pending": 0,
"conversions_approved": 0,
"conversions_paid": 0
}POST /api/v1/affiliates/track/click
POST
/api/v1/affiliates/track/clickRecord an affiliate click
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| referral_code | string | Required | Affiliate referral code from the ref= URL parameter (e.g. REF-ABCD1234). |
| landing_page | string | Optional | landing_page |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/affiliates/track/click \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"referral_code": "example_referral_code"
}'Response Example
JSON
{
"recorded": true
}