Skip to main content

Build Your Own Integration

Note: Most users should start with our Discord Bot or Telegram Bot — they're production-ready and require no coding. This section is for developers who want to build custom integrations.

The API is Universal

Loyalteez's API is platform-agnostic. Any system that can make HTTP POST requests can integrate:

  • Game servers — Reward players for achievements, playtime, events
  • Mobile apps — Reward users for actions, purchases, referrals
  • Websites — Reward visitors for signups, purchases, engagement
  • Custom bots — Build bots for any platform
  • IoT devices — Reward for sensor events, check-ins, interactions

How It Works

  1. Your system detects a user action
  2. POST to our API with event details + user identifier
  3. We handle the rest — wallet creation, token distribution, blockchain
Your System
↓ HTTP POST
Loyalteez Event Handler

Shared Services (Streaks, Leaderboards, etc.)

Blockchain (Wallet creation, LTZ transfer)

Authentication

MethodBest ForHow It Works
HMAC SignatureServer-to-serverSign requests with your Security Key
Platform ValidationDiscord, TelegramWe verify your platform credentials
Domain ValidationWebsitesWe verify the request origin

Authentication Deep-Dive

Quick Example

curl -X POST https://api.loyalteez.app/loyalteez-api/manual-event \
-H "Content-Type: application/json" \
-H "X-Loyalteez-Brand-Id: 0xYourBrandId" \
-H "X-Loyalteez-Signature: <HMAC-SHA256>" \
-H "X-Loyalteez-Timestamp: 1705862400000" \
-d '{
"brandId": "0xYourBrandId",
"eventType": "quest_completed",
"userEmail": "[email protected]",
"metadata": {
"platform": "your_game",
"quest_name": "First Blood",
"difficulty": "hard"
}
}'

More Examples (Python, Node.js, Go)

User Identification

Use the pattern: {platform}_{user_id}@loyalteez.app

PlatformExample
Discord[email protected]
Telegram[email protected]
Your Game[email protected]
Email[email protected] (direct email works too)

User Identification Deep-Dive

What You Get

Event Handler API

Track user actions and distribute rewards:

  • POST /loyalteez-api/manual-event
  • Returns transaction hash and new balance
  • Automatic wallet creation on first reward

Shared Services

Platform-agnostic services for consistent experiences:

ServicePurpose
Streak ServiceTrack consecutive activity
Leaderboard ServiceRankings across metrics
Achievement ServiceGamified milestones
Perks ServiceRedeemable rewards

Gas Relayer

Gasless transactions for perk redemption:

  • Users don't pay gas fees
  • Works with any frontend
  • POST /relay with signed transaction

Prerequisites

  1. Partner Portal Accountpartners.loyalteez.app
  2. Brand ID — Your wallet address (Settings → Account)
  3. Security Key — For HMAC authentication (Settings → Security)
  4. Events Configured — Create events in Partner Portal

Implementation Steps

  1. Generate Security Key in Partner Portal
  2. Create your events (event types, rewards, cooldowns)
  3. Implement HMAC signing in your backend
  4. Make API calls when users complete actions
  5. Handle responses (success, cooldown, errors)

Complete Implementation Guide

Rate Limits

LimitValue
Requests per second100
Requests per minute1,000
Requests per hour10,000

Rate limits are per brand. Contact support for higher limits.

Error Handling

Common error responses:

StatusMeaningAction
400Invalid requestCheck payload
401Authentication failedCheck signature
404Brand/event not foundVerify IDs
429Rate limitedSlow down
500Server errorRetry with backoff

Error Codes Reference

Next Steps

  1. Authentication Guide — Implement HMAC signing
  2. User Identification — Best practices
  3. Code Examples — Ready-to-use code
  4. API Reference — Complete API docs