API Documentation
The Magic Worlds Tracker API lets you integrate affiliate tracking into any website, game, or Web3 application.
Base URL
Track wallet connects, NFT mints, token swaps, subscriptions, referrals, and in-game actions.
Quick Start
1. Add the Tracking Script
<script src="https://api.magicworldstracker.eu/api/track/script.js"></script>
2. Track Conversions
// Wallet connection AffiliateTracker.trackWalletConnect('0x1234...abcd', 'ethereum'); // Purchase AffiliateTracker.trackPurchase(99.99, 'USD', 'order-123'); // NFT mint AffiliateTracker.trackNFTMint('#1234', 'MagicWorlds'); // Token swap AffiliateTracker.trackTokenSwap('ETH', 'MAGIC', 0.5); // Level up AffiliateTracker.trackLevelUp(5); // Subscription AffiliateTracker.trackSubscription('pro', 9.99, 'USD');
Authentication
All protected API requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
S2S Tracking
Record a conversion server-side. Authenticate with your API secret header.
curl -X POST https://api.magicworldstracker.eu/api/track/conversion \ -H "Content-Type: application/json" \ -H "X-API-Secret: YOUR_TRACKING_SECRET" \ -d '{"affiliate_code":"ABC12345","conversion_type":"purchase","conversion_value":99.99}'
Conversion Types
wallet_connect
User connects crypto wallet
purchase
Purchase or transaction
signup
User registration
in_game_action
Custom in-game event
referral
User refers another
subscription
Recurring payment
nft_mint
NFT mint event
token_swap
Token swap event
level_up
In-game level up
Affiliate Signup
Register a new affiliate. Creates a unique code, crypto wallet, and sends welcome email.
| Parameter | Type | Required |
|---|---|---|
| name | string | yes |
| string | yes | |
| merchant_slug | string | one of |
| merchant_id | integer | one of |
Affiliate Login
Request a magic login link. The link is sent via email and expires in 15 minutes.
Request a password reset email. Works for affiliates with a password set.
Affiliate Statistics
Get performance stats. period = today | week | month | all. Requires Bearer token.
List all conversions for the authenticated affiliate. Paginated.
Merchant Registration
Create a new merchant account. Returns API key + secret and sends welcome email.
Merchant Login
Login with email and password. Returns JWT token valid for 7 days.
Merchant Stats
Get merchant dashboard stats: affiliates, clicks, conversions, revenue, top affiliates. Requires merchant Bearer token.