Tebex Integration Guide
Complete guide to integrate Tebex payment system with your store
Tebex Payment Integration
Complete guide to integrate Tebex Headless API for processing payments in your store system.
Tebex is a leading payment provider for gaming communities, supporting multiple payment methods and currencies worldwide.
Prerequisites
Before you begin, ensure you have:
- ✅ A Tebex account (Sign up here)
- ✅ A Tebex Webstore
- ✅ Admin access to your dashboard
- ✅ Backend server running
Overview
The Tebex integration uses the Headless API approach:
- Products are managed in Tebex Dashboard
- Baskets are created via API
- Payments are processed by Tebex
- Webhooks notify your system of completed payments
Architecture
[Your Store] → [Tebex API] → [User Checkout] → [Tebex Webhooks] → [Your Backend]Step 1: Get Tebex Credentials
Create Tebex Account
- Go to Tebex.io
- Click "Sign Up"
- Create your account
- Verify your email
Create a Webstore
- Dashboard → Create Webstore
- Choose your game/platform
- Complete webstore setup
Get API Token
- Go to Webstore Settings
- Navigate to "Headless API" section
- Click "Create Token"
- Copy the token (format:
t-xxxxxxxxxx)
Keep your token secure! Never commit it to public repositories.
Step 2: Configure Products in Tebex
Create Categories
- Tebex Dashboard → Packages
- Click "Categories"
- Create categories (e.g., VIP, Ranks, Items)
Add Products
- Go to "Packages" → "Create Package"
- Fill in product details:
- Name: Product name
- Price: Set price and currency
- Description: Product description
- Category: Select category
- Image: Upload product image
Configure Commands (Optional)
For Minecraft/Gaming servers:
- Edit package → "Commands" tab
- Add commands to execute on purchase:
give {username} diamond 64 lp user {username} parent set vip
Step 3: Setup Webhook
Webhooks are crucial for receiving payment notifications.
Create Webhook in Tebex
- Dashboard → Settings → Webhooks
- Click "Add Webhook"
- Configure:
- URL:
https://yourdomain.com/api/store/webhook/{providerId} - Secret: Generate a secure random string
- URL:
You'll get the providerId after creating the provider in your admin panel.
Select Events
Choose these events:
- ✅
payment.completed- Payment successful - ✅
payment.refund- Refund issued - ✅
payment.chargeback- Chargeback received
Save Webhook Secret
Copy the webhook secret, you'll need it in the next step.
Step 4: Configure Provider in Admin Panel
Add Tebex Provider
- Login to your Admin Panel
- Navigate to Store → Settings
- Click "Add Provider"
- Select "Tebex" as provider type
Enter Credentials
Fill in the form:
| Field | Value | Example |
|---|---|---|
| Name | Provider name | Tebex Store |
| Public Key | Your Tebex token | t-xxxxxxxxxx |
| Webhook Secret | From Step 3 | whsec_xxxxxx |
| Active | Enable provider | ✅ Checked |
Save Configuration
- Click "Save"
- Copy the Provider ID (you'll need this for webhook URL)
Update Webhook URL
- Go back to Tebex Dashboard → Webhooks
- Edit your webhook URL with the actual Provider ID:
https://yourdomain.com/api/store/webhook/07baa137-3833-4534-832c-0c920961f82f
Step 5: Test the Integration
Test in Admin Panel
- Store → Packages (should show your Tebex products)
- Verify all products are visible
- Check categories are loaded
Test Checkout Flow
- Go to your shop page
- Add a product to basket
- Click "Checkout"
- You should be redirected to Tebex checkout
Complete Test Payment
-
Use Tebex test cards (in test mode):
- Card:
4242 4242 4242 4242 - Date: Any future date
- CVC: Any 3 digits
- Card:
-
Complete payment
-
Check backend logs for webhook
Verify Transaction
- Admin Panel → Store → Transactions
- Your test transaction should appear
- Status should be "Completed"
Webhook Verification
Your backend automatically verifies webhooks using HMAC-SHA256.
How It Works
// Backend verifies each webhook
const signature = headers['x-signature'];
const isValid = verifySignature(payload, signature, webhookSecret);
if (!isValid) {
return 403; // Forbidden
}IP Whitelisting
Tebex webhooks come from these IPs:
18.209.80.354.87.231.232
If using Cloudflare, set SKIP_WEBHOOK_IP_CHECK=true in your .env file.
Troubleshooting
Products Not Loading
Problem: Shop page shows "No products found"
Solutions:
- Verify API token is correct
- Check products are published in Tebex
- Ensure products have a price set
- Check backend logs for API errors
Webhook Not Working
Problem: Payments successful but not recorded
Solutions:
- Verify webhook URL is correct (includes provider ID)
- Check webhook secret matches
- Review backend logs:
/api/store/webhook/{providerId} - Test webhook in Tebex Dashboard → Webhooks → Send Test
Invalid Signature Error
Problem: Webhook returns "Invalid signature"
Solutions:
- Verify webhook secret in admin panel
- Ensure secret matches Tebex webhook configuration
- Check raw body is preserved (required for signature verification)
Cloudflare Issues
Problem: Webhook IP validation fails
Solution:
# Add to backend .env
SKIP_WEBHOOK_IP_CHECK=trueProduction Checklist
Before going live:
- All products configured in Tebex
- Prices are correct
- Webhook URL updated with real provider ID
- Webhook secret configured
- Test purchase completed successfully
- Transaction appears in admin panel
- SSL/HTTPS enabled on your domain
- Backend logs show successful webhooks
API Reference
Tebex Headless API Endpoints
Your backend uses these endpoints:
| Endpoint | Purpose |
|---|---|
/categories | List all categories |
/packages | List all products |
/baskets | Create/manage baskets |
/baskets/{id}/auth | Get checkout URL |
/baskets/{id}/packages | Add products to basket |
Webhook Payload Example
{
"id": "webhook-id",
"type": "payment.completed",
"date": "2024-11-05T12:00:00Z",
"subject": {
"transaction_id": "tbx-xxxxxx",
"status": "Complete",
"price": {
"amount": 9.99,
"currency": "USD"
},
"customer": {
"email": "[email protected]",
"username": "player123"
},
"products": [
{
"id": 12345,
"name": "VIP Rank",
"quantity": 1
}
]
}
}Environment Variables
Add these to your backend .env:
# Cloudflare users (optional)
SKIP_WEBHOOK_IP_CHECK=true
# For production
NODE_ENV=productionBest Practices
Security
✅ Do:
- Keep webhook secret secure
- Use HTTPS in production
- Verify webhook signatures
- Validate IP addresses (unless using Cloudflare)
❌ Don't:
- Commit secrets to git
- Use HTTP in production
- Skip signature verification
- Disable security checks without reason
Product Management
✅ Do:
- Use clear product names
- Add detailed descriptions
- Upload high-quality images
- Organize products in categories
- Set appropriate prices
❌ Don't:
- Use confusing names
- Leave descriptions empty
- Forget to set prices
- Mix unrelated products
Testing
✅ Do:
- Test in Tebex sandbox first
- Complete full checkout flow
- Verify webhook delivery
- Check transaction records
❌ Don't:
- Test with real money initially
- Skip webhook testing
- Forget to check logs
Support Resources
- 📚 Tebex Documentation
- 💬 Tebex Discord
- 🎫 Support Tickets
- 📧 Email: [email protected]
Next Steps
After successful integration:
- ✅ Configure your products
- ✅ Test thoroughly
- ✅ Set up transaction monitoring
- ✅ Configure email notifications
- ✅ Review analytics regularly
Congratulations! Your Tebex integration is complete. You can now accept payments from players worldwide! 🎉
Additional Features
Coupons & Gift Cards
Tebex supports discount codes:
// Apply coupon
await basket.applyCoupon('SUMMER2024');
// Apply gift card
await basket.applyGiftCard('GIFT-XXXX-XXXX');Subscription Products
Enable recurring payments in Tebex Dashboard:
- Edit product → "Subscription" tab
- Set renewal period (monthly, yearly)
- Save changes
Multi-Currency
Tebex automatically handles currency conversion:
- Customer sees price in their local currency
- You receive payment in your preferred currency
- Exchange rates are updated automatically
Migration from Other Providers
Switching from another provider?
- Export existing customer data
- Recreate products in Tebex
- Configure webhooks
- Run parallel for testing period
- Switch completely when confident
Need help? Check our FAQ or Contact Support.