BetronTech
API Referansı
BetronTech API, oyun entegrasyonu için ihtiyacınız olan tüm uç noktaları tek bir çatı altında sunar. Kimlik doğrulamadan webhook yönetimine kadar her şey bu dokümanda açıklanmıştır.
BetronTech API'yi kullanabilmek için önce bir erişim token'ı almanız gerekir. Size iletilen agent_token ve agent_secret_key değerlerini Base64 ile kodlayarak bu uç noktaya gönderin.
access_token değerini sonraki tüm isteklerde Bearer formatında göndermeniz gerekir. Token'ı güvenli bir yerde saklayın.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| Authorization | string | Zorunlu | Bearer BASE64(agent_token:agent_secret_key) |
| 1 | agent_token ve agent_secret_key değerlerini alın |
| 2 | "agent_token:agent_secret_key" şeklinde birleştirin |
| 3 | Base64 ile kodlayın |
| 4 | Authorization header'ına Bearer <token> olarak ekleyin |
$agent_token = 'agent_token_buraya'; $agent_secret_key = 'secret_key_buraya'; $encoded = base64_encode( "$agent_token:$agent_secret_key" ); $response = Http::withHeaders([ 'Authorization' => 'Bearer ' . $encoded, ])->post( 'https://api.betron.tech/api/auth/authentication' ); if ($response->successful()) { $data = $response->json(); $token = $data['access_token']; }
{
"access_token": "eyJ0eXAiOiJKV1Qi...",
"token_type": "Bearer",
"expires_in": 3600
}
Belirtilen oyunu başlatır ve oyun URL'sini döner. Kimlik doğrulamadan alınan Bearer token zorunludur.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| agent_code | string | Zorunlu | Agent kodu |
| agent_token | string | Zorunlu | Agent secret key |
| game_id | string | Zorunlu | Oyun ID'si |
| type | string | Zorunlu | CHARGED veya DEMO |
| lang | string | Opsiyonel | Dil kodu: tr_TR, pt_BR |
| user_id | string | Zorunlu | Kullanıcı ID'si |
| user_name | string | Zorunlu | Kullanıcı adı |
$response = Http::withToken($token) ->withQueryParameters([ 'agent_code' => $agent_code, 'agent_token' => $agent_secret_key, 'game_id' => 'OYUN_ID', 'type' => 'CHARGED', 'lang' => 'tr_TR', 'user_id' => '1', 'user_name' => 'kullanici_adi', ])->get( 'https://api.betron.tech/api/games/game_launch' ); if ($response->successful()) { $game_url = $response->json('game_url'); }
{
"status": true,
"game_url": "https://game.provider.com/..."
}
Sistemdeki tüm oyun providerlarını listeler.
$response = Http::withToken($token) ->get('https://api.betron.tech/api/games/provider'); if ($response->successful()) { $json = $response->json(); $providers = $json['data']; }
{
"status": true,
"data": [
{
"id": 1,
"name": "Pragmatic Play",
"slug": "pragmatic"
}
]
}
Sistemdeki tüm oyunları listeler.
$response = Http::withToken($token) ->get('https://api.betron.tech/api/games/all'); if ($response->successful()) { $games = $response->json('data'); }
{
"status": true,
"data": [
{
"id": "SLOT_001",
"name": "Gates of Olympus",
"provider": "pragmatic"
}
]
}
Sistemimiz bazı olayları sizin belirlediğiniz endpoint'e POST isteği olarak iletir.
method alanına göre ayırt edilir. Endpoint'iniz bu alana göre yönlendirme yapmalıdır.
Sistemimiz bu metodu çağırdığında kullanıcının ID, e-posta ve adını döndürmeniz beklenir.
{
"method": "account_details",
"user_id": "12345"
}
{
"user_id": "12345",
"email": "kullanici@email.com",
"name_jogador": "Kullanici Adi"
}
Kullanıcının güncel bakiyesini ve hesap durumunu döndürmeniz beklenir.
{
"method": "user_balance",
"user_id": "12345"
}
{
"status": 1,
"balance": "100.50"
}
Bahis tutarını kullanıcı bakiyesinden düşüp veritabanına kaydedin.
transaction_id değerini veritabanınıza kaydetmeniz önerilir.
{
"method": "transaction_bet",
"user_id": "12345",
"amount": "10.00",
"transaction_id": "TXN_ABC123",
"game_id": "SLOT_001"
}
{
"status": 1,
"balance": "90.50"
}
Kazanç tutarını kullanıcı bakiyesine ekleyin ve veritabanına kaydedin.
{
"method": "transaction_win",
"user_id": "12345",
"amount": "50.00",
"transaction_id": "TXN_WIN456",
"game_id": "SLOT_001"
}
{
"status": 1,
"balance": "140.50"
}
İptal edilen bir bahisin iadesini işleyin. Tutarı bakiyeye ekleyip güncel bakiyeyi döndürün.
{
"method": "refund",
"user_id": "12345",
"amount": "10.00",
"transaction_id": "TXN_ABC123"
}
{
"status": 1,
"balance": "100.50"
}