API Documentation
Complete reference for the TechMazet REST API. All endpoints, authentication methods, and code examples.
Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Your API key is generated from the TechMazet dashboard and should be kept secure. Never expose it in client-side code.
// Example cURL request
curl -X GET \
https://api.techmazet.com/api/v1/providers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
📢 Base URL
All API requests should be made to the following base URL. Use the appropriate environment based on your deployment stage.
https://api.techmazet.com
// Sandbox (for testing)
https://sandbox-api.techmazet.com
API Endpoints
All available endpoints for the v1 API. All responses are in JSON format.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/game/launch |
Launch a game session for a player |
| POST | /api/v1/game/launch/transfer |
Transfer funds for game launch |
| GET | /api/v1/transactions |
Retrieve transaction history |
| GET | /api/v1/providers |
List available game providers |
| GET | /api/v1/games |
List available games with filtering |
| GET | /api/v1/games/{id} |
Get details for a specific game |
| POST | /api/v1/transactions |
Create a new transaction |
| GET | /api/v1/wallet/balance |
Get wallet balance |
Request / Response
🎮 POST /api/v1/game/launch
Launch a game session. Returns a game URL for redirecting the player.
Request
Host: api.techmazet.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"provider": "PGSoft",
"game_id": "fortune-tiger",
"player_id": "user_abc123",
"currency": "USD",
"session_token": "eyJhbGciOiJIUzI1NiIs..."
}
Response 200 OK
"success": true,
"data": {
"game_url": "https://game-provider.com/launch?token=...",
"transaction_id": "tx_9k2m4x",
"expires_at": "2024-01-15T11:30:00Z"
}
}
📋 GET /api/v1/transactions
Retrieve transaction history with optional filtering.
Response 200 OK
"success": true,
"data": [
{
"id": "tx_9k2m4x",
"type": "game_result",
"amount": -25.50,
"currency": "USD",
"status": "settled",
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"per_page": 25,
"total": 142
}
}
Integration Examples
// TechMazet API Client Example
require 'vendor/autoload.php';
use TechMazet\Client;
$client = new Client([
'api_key' => getenv('TECHMAZET_API_KEY'),
'base_url' => 'https://api.techmazet.com',
]);
// Launch a game
$response = $client->post('/api/v1/game/launch', [
'provider' => 'PGSoft',
'game_id' => 'fortune-tiger',
'player_id' => 'user_abc123',
'currency' => 'USD',
]);
if ($response->successful()) {
$data = $response->json();
header('Location: ' . $data['data']['game_url']);
} else {
echo 'Error: ' . $response->body();
}
curl -X POST \
https://api.techmazet.com/api/v1/game/launch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"PGSoft","game_id":"fortune-tiger","player_id":"user_abc123","currency":"USD"}'
# Get transaction history
curl -X GET \
https://api.techmazet.com/api/v1/transactions?page=1&per_page=25 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Error Codes
The API uses conventional HTTP response codes and provides structured error details.
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions for this resource |
| 404 | Not Found | The requested resource does not exist |
| 429 | Rate Limited | Too many requests. Retry after the specified delay |
| 500 | Server Error | Internal server error. Contact support if persistent |
| 503 | Service Unavailable | Provider temporarily unavailable. Automatic retry recommended |
Rate Limits
API rate limits are applied per API key. Limits vary by plan tier. Response headers include your current usage and reset time.
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1705312200