P24 Affiliate API

Developer documentation for integrating brands and affiliates with the P24 iGaming Affiliate Platform.

Base URL
https://p24-affiliate-api.savio-sami.workers.dev
Platform
https://p24-affiliate.pages.dev

Authentication

All protected endpoints require a Bearer token in the Authorization header. Tokens are valid for 7 days.

Login

POST /auth/login Public
Request
{
  "email": "owner@yourbrand.com",
  "password": "YourPassword"
}
Response
{
  "token": "eyJhbGci...",
  "role": "owner",
  "name": "BetMax Gaming",
  "email": "owner@betmax.com"
}

Using the Token

Header
Authorization: Bearer eyJhbGci...

Change Password

POST /auth/change-password Any
{
  "email": "you@example.com",
  "current_password": "OldPass",
  "new_password": "NewPass123!"
}

Roles

RoleCreated ByAccess
adminSystemFull platform — users, products, payouts, fraud, reports
ownerAdminManage your products, commission rules, affiliate applications, reports, branding
affiliateSelf-registerBrowse products, get tracking links, view earnings and conversions, request payouts
Affiliate accounts start as pending after registration. An admin must approve them before they can access the dashboard.

Products Owner

Products represent your iGaming brand (sportsbook, casino, poker room, etc.) that affiliates will promote.

GET/owner/productsList your products
POST/owner/productsCreate a product
Create Product
{
  "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.

POST/owner/products/:id/commissionSet commission rule
CPA
{
  "model":       "cpa",
  "cpa_amount":  45,    // USD paid per FTD
  "min_deposit": 10     // minimum deposit to qualify
}
RevShare
{
  "model":   "revshare",
  "rev_pct": 30   // 30% of net revenue per player
}
Hybrid (CPA + RevShare)
{
  "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.

GET/owner/applicationsPending applications
PUT/owner/applications/:id/approveApprove — link goes live
PUT/owner/applications/:id/rejectReject application
GET/owner/affiliatesAll affiliates promoting your products

Reports Owner

GET/owner/reports/overviewClicks, FTDs, commission summary
GET/owner/reports/clicks-over-timeDaily click trend

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.

GET/owner/brandingGet current branding
PUT/owner/brandingUpdate branding
{
  "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.

POST/auth/registerPublic
{
  "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

GET/affiliate/productsAvailable products + commission rates
POST/affiliate/products/:id/applyApply to promote a product
Apply Response
{
  "ok": true,
  "tracking_code": "aff6-p2-mpwxmc30",
  "message": "Application submitted. Awaiting approval."
}
The tracking link is inactive until the product owner approves your application.

Tracking Links Affiliate

GET/affiliate/linksYour tracking links + status

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
Important: Store the 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

1
Player Clicks
Tracking link
2
Redirect
click_id appended
3
Player Signs Up
Store click_id
4
Player Deposits
Fire postback
5
Commission
Auto-calculated
POST/postbackPublic
Request Body (JSON)
{
  "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"
}
Success Response
{
  "status":     "ok",
  "commission": 45,
  "click_id":   "b305f697-..."
}

cURL Example

cURL
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"
  }'
Send the postback from your server, not from the browser. Never expose your integration to client-side code.

Earnings & Payouts Affiliate

GET/affiliate/earningsFull ledger with running balance
POST/affiliate/payoutRequest a payout
Payout Request
{
  "amount":   100,
  "method":   "crypto",    // bank | crypto | paypal | wise
  "details": {
    "wallet":  "TRX8xK2m...",
    "network": "TRC20"
  }
}

Reports Affiliate

GET/affiliate/reports/overviewClicks, conversions, commission summary
GET/affiliate/reports/clicks-over-timeDaily click trend
GET/affiliate/reports/playersPlayer-level breakdown
GET/affiliate/reports/traffic-sourcesBreakdown by sub1 tag + country

All accept ?from=YYYY-MM-DD&to=YYYY-MM-DD

Event Types

EventTriggersNotes
registrationCPL commissionPlayer creates account
depositAny deposit (logged, tracked)
ftdCPA commissionFirst Time Deposit — triggers flat CPA payout if min_deposit met
revenueRevShare commissionNet revenue from player — % calculated based on rev_pct

Commission Models

ModelHow It Works
cpaFlat amount paid per FTD. Optional min_deposit threshold.
revsharePercentage of net revenue per player, every time revenue event fires.
hybridCPA on FTD + RevShare on revenue events. Both apply.
cplFlat amount per registration event.
cpcFlat amount per unique click.

Error Codes

HTTPErrorMeaning
400VariousMissing or invalid parameters
401Invalid credentials / Invalid tokenWrong password or expired JWT
403Forbidden / pending_approvalWrong role, or affiliate not yet approved
404Not foundResource doesn't exist
409Email already registeredDuplicate registration attempt
200ignored: duplicate_clickClick was a duplicate (same IP + product in 24h)
200ignored: already_convertedSame click_id + event already recorded

P24 iGaming Affiliate Platform · Built by Tornet VAS · Open Platform →