Sms Onayla
Fiyatlar SMS Onay API SSS İletişim
GELİŞTİRİCİLER & BAYİLER

Bayi REST API Dokümantasyonu

JSON tabanlı modern REST API ile numara satın alma, canlı SMS okuma ve otomatik iptal/iade işlemlerini dakikalar içinde yazılımınıza bağlayın.

Base URL
https://smsonayla.org/api/v1

Tüm yanıtlar UTF-8 JSON formatındadır.

Kimlik Doğrulama
X-Api-Key: ps_••••••••

Header olarak veya ?api_key= parametresiyle gönderin.

Durumlar & Limitler
waiting received completed cancelled failed

Hız limiti: 120 istek / dakika.

GET /balance

Bakiye Sorgula

Hesabınızın güncel bakiyesini ve varsayılan para birimini döndürür.

Request ()
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://smsonayla.org/api/v1/balance"
$ch = curl_init('https://smsonayla.org/api/v1/balance');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Api-Key: YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
import requests

r = requests.get('https://smsonayla.org/api/v1/balance', headers={'X-Api-Key': 'YOUR_API_KEY'})
print(r.json())
JSON Response
{
    "ok": true,
    "balance": 250,
    "currency": "TRY"
}
GET /services

Servis Listesi

Aktif tüm servisleri, slug/kodlarını, başlangıç fiyatlarını ve canlı toplam stoklarını listeler.

Request ()
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://smsonayla.org/api/v1/services"
$res = file_get_contents('https://smsonayla.org/api/v1/services?api_key=YOUR_API_KEY');
$services = json_decode($res, true);
r = requests.get('https://smsonayla.org/api/v1/services', headers={'X-Api-Key': 'YOUR_API_KEY'})
print(r.json()['services'][:5])
JSON Response
{
    "ok": true,
    "currency": "TRY",
    "services": [
        {
            "slug": "telegram",
            "code": "tg",
            "name": "Telegram",
            "min_price": 14.5,
            "stock": 420
        }
    ]
}
GET /countries?service=telegram

Ülkeler & Canlı Stok

Seçilen servis için mevcut ülkeleri, anlık stok adetlerini ve satış fiyatlarını döndürür.

Parametreler
service string — Servis slug veya kodu (ör. telegram veya tg)
Request ()
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://smsonayla.org/api/v1/countries?service=telegram"
$res = file_get_contents('https://smsonayla.org/api/v1/countries?service=telegram&api_key=YOUR_API_KEY');
r = requests.get('https://smsonayla.org/api/v1/countries', params={'service': 'telegram'}, headers={'X-Api-Key': 'YOUR_API_KEY'})
JSON Response
{
    "ok": true,
    "service": "telegram",
    "currency": "TRY",
    "countries": [
        {
            "iso2": "TR",
            "code": "62",
            "name": "Turkey",
            "price": 22.5,
            "stock": 145
        }
    ]
}
POST /buy

Numara Satın Al

Çoklu sağlayıcı otomatik failover desteğiyle anında sanal numara satın alır.

Parametreler
service string (required) — Servis slug veya kodu (ör. telegram)
country string (required) — Ülke ISO2 veya kodu (ör. TR veya 62)
Request ()
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"service":"telegram","country":"TR"}' \
  "https://smsonayla.org/api/v1/buy"
$ch = curl_init('https://smsonayla.org/api/v1/buy');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ['X-Api-Key: YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode(['service' => 'telegram', 'country' => 'TR']),
  CURLOPT_RETURNTRANSFER => true,
]);
$order = json_decode(curl_exec($ch), true);
r = requests.post('https://smsonayla.org/api/v1/buy', json={'service': 'telegram', 'country': 'TR'}, headers={'X-Api-Key': 'YOUR_API_KEY'})
print(r.json()['order']['phone_number'])
JSON Response
{
    "ok": true,
    "order": {
        "id": 1042,
        "order_number": "ORD-8X92K1M3AB",
        "phone_number": "+905551234567",
        "status": "waiting",
        "price": 22.5,
        "currency": "TRY"
    },
    "balance": 227.5
}
GET /order?id=ORD-8X92K1M3AB

Sipariş & SMS Kodu Sorgula

Siparişin durumunu ve gelen doğrulama kodunu canlı olarak sorgular. 3–5 saniyede bir çağrılması önerilir.

Parametreler
id string (required) — Sipariş numarası (ORD-...) veya ID
Request ()
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://smsonayla.org/api/v1/order?id=ORD-8X92K1M3AB"
$order = json_decode(file_get_contents('https://smsonayla.org/api/v1/order?id=ORD-8X92K1M3AB&api_key=YOUR_API_KEY'), true);
r = requests.get('https://smsonayla.org/api/v1/order', params={'id': 'ORD-8X92K1M3AB'}, headers={'X-Api-Key': 'YOUR_API_KEY'})
print(r.json()['order']['sms_code'])
JSON Response
{
    "ok": true,
    "order": {
        "order_number": "ORD-8X92K1M3AB",
        "phone_number": "+905551234567",
        "status": "received",
        "sms_code": "482915",
        "sms_text": "Your verification code is 482915"
    }
}
POST /cancel

Sipariş İptal & İade

Kod gelmemiş siparişi iptal eder ve tutarı bakiyenize anında iade eder.

Parametreler
id string (required) — İptal edilecek sipariş numarası
Request ()
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"ORD-8X92K1M3AB"}' \
  "https://smsonayla.org/api/v1/cancel"
// POST https://smsonayla.org/api/v1/cancel with ['id' => 'ORD-8X92K1M3AB']
r = requests.post('https://smsonayla.org/api/v1/cancel', json={'id': 'ORD-8X92K1M3AB'}, headers={'X-Api-Key': 'YOUR_API_KEY'})
JSON Response
{
    "ok": true,
    "status": "cancelled",
    "refunded": true,
    "balance": 250
}
POST /finish

Siparişi Tamamla

Doğrulama kodu teslim alınmış siparişi tamamlandı olarak kapatır.

Parametreler
id string (required) — Tamamlanacak sipariş numarası
Request ()
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"ORD-8X92K1M3AB"}' \
  "https://smsonayla.org/api/v1/finish"
// POST https://smsonayla.org/api/v1/finish with ['id' => 'ORD-8X92K1M3AB']
r = requests.post('https://smsonayla.org/api/v1/finish', json={'id': 'ORD-8X92K1M3AB'}, headers={'X-Api-Key': 'YOUR_API_KEY'})
JSON Response
{
    "ok": true,
    "status": "completed"
}

HTTP Durum & Hata Kodları

HTTPError CodeAçıklama
401 API_KEY_INVALID Eksik veya geçersiz X-Api-Key.
403 ACCOUNT_SUSPENDED Hesap askıya alınmış.
404 ORDER_NOT_FOUND Servis, ülke veya sipariş bulunamadı.
422 PURCHASE_FAILED Yetersiz bakiye veya tüm sağlayıcılarda stok tükendi.
429 TOO_MANY_REQUESTS Dakikalık hız limiti (120/dk) aşıldı.
Çerez tercihleri

Deneyiminizi iyileştirmek, güvenliği sağlamak ve KVKK uyumluluğu için çerezler kullanıyoruz. Çerez Politikası

Çerez tercihleri

💬 Canlı Destek