Geliştirici Dokümantasyonu

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.

BASE URL
https://api.betron.tech/api
POST /auth/authentication
Kimlik Doğrulama

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.

ℹ️ Alınan access_token değerini sonraki tüm isteklerde Bearer formatında göndermeniz gerekir. Token'ı güvenli bir yerde saklayın.
Header Parametreleri
ParametreTipZorunluAçıklama
Authorization string Zorunlu Bearer BASE64(agent_token:agent_secret_key)
Token Oluşturma Adımları
1agent_token ve agent_secret_key değerlerini alın
2"agent_token:agent_secret_key" şeklinde birleştirin
3Base64 ile kodlayın
4Authorization header'ına Bearer <token> olarak ekleyin
PHP — Laravel
$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'];
}
Başarılı Yanıt (200)
JSON
{
  "access_token": "eyJ0eXAiOiJKV1Qi...",
  "token_type":   "Bearer",
  "expires_in":   3600
}
GET /games/game_launch
Oyun Başlat

Belirtilen oyunu başlatır ve oyun URL'sini döner. Kimlik doğrulamadan alınan Bearer token zorunludur.

Query Parametreleri
ParametreTipZorunluAçıklama
agent_codestringZorunluAgent kodu
agent_tokenstringZorunluAgent secret key
game_idstringZorunluOyun ID'si
typestringZorunluCHARGED veya DEMO
langstringOpsiyonelDil kodu: tr_TR, pt_BR
user_idstringZorunluKullanıcı ID'si
user_namestringZorunluKullanıcı adı
PHP — Laravel
$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');
}
Başarılı Yanıt (200)
JSON
{
  "status":   true,
  "game_url": "https://game.provider.com/..."
}
GET /games/provider
Providerları Listele

Sistemdeki tüm oyun providerlarını listeler.

PHP — Laravel
$response = Http::withToken($token)
    ->get('https://api.betron.tech/api/games/provider');

if ($response->successful()) {
    $json      = $response->json();
    $providers = $json['data'];
}
JSON Yanıt
{
  "status": true,
  "data": [
    {
      "id":   1,
      "name": "Pragmatic Play",
      "slug": "pragmatic"
    }
  ]
}
GET /games/all
Tüm Oyunları Listele

Sistemdeki tüm oyunları listeler.

PHP — Laravel
$response = Http::withToken($token)
    ->get('https://api.betron.tech/api/games/all');

if ($response->successful()) {
    $games = $response->json('data');
}
JSON Yanıt
{
  "status": true,
  "data": [
    {
      "id":       "SLOT_001",
      "name":     "Gates of Olympus",
      "provider": "pragmatic"
    }
  ]
}
Webhook Metodları

Sistemimiz bazı olayları sizin belirlediğiniz endpoint'e POST isteği olarak iletir.

WEBHOOK URL
https://api.betron.tech/betrontech_api
⚠️ Tüm webhook istekleri gelen method alanına göre ayırt edilir. Endpoint'iniz bu alana göre yönlendirme yapmalıdır.
POSTHesap Detayı
account_details
Kullanıcının ID, e-posta ve adını döndürür.
POSTKullanıcı Bakiye
user_balance
Kullanıcının güncel bakiyesini ve durum bilgisini döndürür.
POSTBahis İşlemi
transaction_bet
Bahis kesilir, bakiyeden düşüldükten sonraki tutar döndürülür.
POSTKazanç İşlemi
transaction_win
Kazanç eklenir, eklendikten sonraki bakiye döndürülür.
POSTİade
refund
İptal edilen bahis iade edilir, güncel bakiye döndürülür.
POST/betrontech_api → account_details
Hesap Detayı

Sistemimiz bu metodu çağırdığında kullanıcının ID, e-posta ve adını döndürmeniz beklenir.

Gelen İstek
JSON — Gelen
{
  "method":  "account_details",
  "user_id": "12345"
}
Döndürmeniz Gereken Yanıt
JSON — Yanıt
{
  "user_id":      "12345",
  "email":        "kullanici@email.com",
  "name_jogador": "Kullanici Adi"
}
POST/betrontech_api → user_balance
Kullanıcı Bakiye

Kullanıcının güncel bakiyesini ve hesap durumunu döndürmeniz beklenir.

Gelen İstek
JSON — Gelen
{
  "method":  "user_balance",
  "user_id": "12345"
}
Döndürmeniz Gereken Yanıt
JSON — Yanıt
{
  "status":  1,
  "balance": "100.50"
}
POST/betrontech_api → transaction_bet
Bahis İşlemi

Bahis tutarını kullanıcı bakiyesinden düşüp veritabanına kaydedin.

ℹ️ Gelen transaction_id değerini veritabanınıza kaydetmeniz önerilir.
Gelen İstek
JSON — Gelen
{
  "method":         "transaction_bet",
  "user_id":        "12345",
  "amount":         "10.00",
  "transaction_id": "TXN_ABC123",
  "game_id":        "SLOT_001"
}
Döndürmeniz Gereken Yanıt
JSON — Yanıt
{
  "status":  1,
  "balance": "90.50"
}
POST/betrontech_api → transaction_win
Kazanç İşlemi

Kazanç tutarını kullanıcı bakiyesine ekleyin ve veritabanına kaydedin.

Gelen İstek
JSON — Gelen
{
  "method":         "transaction_win",
  "user_id":        "12345",
  "amount":         "50.00",
  "transaction_id": "TXN_WIN456",
  "game_id":        "SLOT_001"
}
Döndürmeniz Gereken Yanıt
JSON — Yanıt
{
  "status":  1,
  "balance": "140.50"
}
POST/betrontech_api → refund
İade

İptal edilen bir bahisin iadesini işleyin. Tutarı bakiyeye ekleyip güncel bakiyeyi döndürün.

Gelen İstek
JSON — Gelen
{
  "method":         "refund",
  "user_id":        "12345",
  "amount":         "10.00",
  "transaction_id": "TXN_ABC123"
}
Döndürmeniz Gereken Yanıt
JSON — Yanıt
{
  "status":  1,
  "balance": "100.50"
}