P24 Affiliate API
Developer documentation for integrating brands and affiliates with the P24 iGaming Affiliate Platform.
Authentication
All protected endpoints require a Bearer token in the Authorization header. Tokens are valid for 7 days.
Login
{
"email": "owner@yourbrand.com",
"password": "YourPassword"
}
{
"token": "eyJhbGci...",
"role": "owner",
"name": "BetMax Gaming",
"email": "owner@betmax.com"
}
Using the Token
Authorization: Bearer eyJhbGci...
Change Password
{
"email": "you@example.com",
"current_password": "OldPass",
"new_password": "NewPass123!"
}
Roles
| Role | Created By | Access |
|---|---|---|
| admin | System | Full platform — users, products, payouts, fraud, reports |
| owner | Admin | Manage your products, commission rules, affiliate applications, reports, branding |
| affiliate | Self-register | Browse products, get tracking links, view earnings and conversions, request payouts |
Products Owner
Products represent your iGaming brand (sportsbook, casino, poker room, etc.) that affiliates will promote.
{
"name": "BetMax Sports",
"vertical": "sports_betting", // sports_betting | casino | poker | esports | other
"url": "https://betmaxsports.com",
"description": "Premier sports betting with 500+ markets"
}
Commission Rules Owner
Set how affiliates earn from your product. Applied automatically when a postback conversion is received.
{
"model": "cpa",
"cpa_amount": 45, // USD paid per FTD
"min_deposit": 10 // minimum deposit to qualify
}
{
"model": "revshare",
"rev_pct": 30 // 30% of net revenue per player
}
{
"model": "hybrid",
"cpa_amount": 40,
"rev_pct": 20,
"min_deposit": 20
}
Managing Affiliates Owner
When an affiliate applies to promote your product, you receive an application to approve or reject. Only approved applications generate active tracking links.
Reports Owner
All report endpoints accept ?from=YYYY-MM-DD&to=YYYY-MM-DD. Default: last 30 days.
Branding Owner
Customize the platform colors and logo for your affiliates. Loaded dynamically via ?owner=ID on the frontend.
{
"company_name": "BetMax Gaming",
"logo_url": "https://cdn.betmax.com/logo.png",
"primary_color": "#6366f1",
"secondary_color": "#10b981",
"support_email": "affiliates@betmax.com",
"footer_text": "Powered by BetMax Gaming"
}
Registration Affiliate
Affiliates self-register via the platform or API. Accounts start as pending until an admin approves them.
{
"name": "John Media",
"email": "john@johnmedia.com",
"password": "SecurePass123!",
"website": "https://johnmedia.com", // optional
"phone": "+1234567890", // optional
"country": "IQ", // optional
"payment_method": "crypto", // bank | crypto | paypal | wise
"payment_details": {
"wallet": "TRX8xK2m...",
"network": "TRC20"
}
}
Browse & Apply Affiliate
{
"ok": true,
"tracking_code": "aff6-p2-mpwxmc30",
"message": "Application submitted. Awaiting approval."
}
Tracking Links Affiliate
Once approved, your tracking link format is:
https://p24-affiliate-api.savio-sami.workers.dev/t/{tracking_code}
Optional sub-parameters for traffic source tracking:
https://.../t/aff6-p2-abc?sub1=google&sub2=brand_campaign&sub3=banner_v2
When a user clicks the link, they are redirected to the product URL with these params appended:
https://betmaxsports.com/?click_id=b305f697-ce23-4216-9b81-fd05d61f1789&aff=aff6-p2-abc
click_id against the player's session. You will need it for the postback.Postback (Server-to-Server) Affiliate
When a tracked player completes an action on your platform, send a postback to credit the affiliate's commission.
Postback Flow
{
"click_id": "b305f697-ce23-4216-9b81-fd05d61f1789", // from tracking redirect
"event_type": "ftd", // registration | deposit | ftd | revenue
"amount": 200, // deposit/revenue amount in USD
"currency": "USD"
}
{
"status": "ok",
"commission": 45,
"click_id": "b305f697-..."
}
cURL Example
curl -X POST https://p24-affiliate-api.savio-sami.workers.dev/postback \ -H "Content-Type: application/json" \ -d '{ "click_id": "b305f697-ce23-4216-9b81-fd05d61f1789", "event_type": "ftd", "amount": 200, "currency": "USD" }'
Earnings & Payouts Affiliate
{
"amount": 100,
"method": "crypto", // bank | crypto | paypal | wise
"details": {
"wallet": "TRX8xK2m...",
"network": "TRC20"
}
}
Reports Affiliate
All accept ?from=YYYY-MM-DD&to=YYYY-MM-DD
Event Types
| Event | Triggers | Notes |
|---|---|---|
| registration | CPL commission | Player creates account |
| deposit | — | Any deposit (logged, tracked) |
| ftd | CPA commission | First Time Deposit — triggers flat CPA payout if min_deposit met |
| revenue | RevShare commission | Net revenue from player — % calculated based on rev_pct |
Commission Models
| Model | How It Works |
|---|---|
| cpa | Flat amount paid per FTD. Optional min_deposit threshold. |
| revshare | Percentage of net revenue per player, every time revenue event fires. |
| hybrid | CPA on FTD + RevShare on revenue events. Both apply. |
| cpl | Flat amount per registration event. |
| cpc | Flat amount per unique click. |
Error Codes
| HTTP | Error | Meaning |
|---|---|---|
| 400 | Various | Missing or invalid parameters |
| 401 | Invalid credentials / Invalid token | Wrong password or expired JWT |
| 403 | Forbidden / pending_approval | Wrong role, or affiliate not yet approved |
| 404 | Not found | Resource doesn't exist |
| 409 | Email already registered | Duplicate registration attempt |
| 200 | ignored: duplicate_click | Click was a duplicate (same IP + product in 24h) |
| 200 | ignored: already_converted | Same click_id + event already recorded |
P24 iGaming Affiliate Platform · Built by Tornet VAS · Open Platform →