API & Webhook Documentation

Panduan Integrasi Host-to-Host (H2H) secara Real-Time.

Base URL API: https://beliotp.id/api/v1/

Semua request API menggunakan metode POST dan tipe konten application/x-www-form-urlencoded.

1. Cek Profil & Saldo

Endpoint ini digunakan untuk mengecek informasi profil dan sisa saldo akun Anda.

POST profile
ParameterTipeWajibDeskripsi
api_keyStringYaAPI Key unik milik akun Anda.
curl -X POST https://beliotp.id/api/v1/profile \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "api_key=API_KEY_ANDA"
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://beliotp.id/api/v1/profile', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query([ 'api_key' => 'API_KEY_ANDA' ]), ]); $response = curl_exec($curl); curl_close($curl); echo $response;
const axios = require('axios'); const qs = require('qs'); let data = qs.stringify({ 'api_key': 'API_KEY_ANDA' }); axios.post('https://beliotp.id/api/v1/profile', data) .then((response) => { console.log(response.data); });
Contoh Response (JSON)
{
  "status": true,
  "data": {
    "nama": "Toko OTP",
    "email": "toko@email.com",
    "saldo": 150000
  }
}

2. Topup Saldo (Generate QRIS)

Endpoint ini digunakan untuk membuat tagihan otomatis (QRIS / Payment Link) agar Anda bisa mengisi saldo melalui API.

POST topup
ParameterTipeWajibDeskripsi
api_keyStringYaAPI Key unik milik akun Anda.
amountIntegerYaNominal topup (Contoh: 50000). Minimal Rp 2.000.
curl -X POST https://beliotp.id/api/v1/topup \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "api_key=API_KEY_ANDA&amount=50000"
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://beliotp.id/api/v1/topup', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query([ 'api_key' => 'API_KEY_ANDA', 'amount' => 50000 ]), ]); $response = curl_exec($curl);
Contoh Response (JSON)
{
  "status": true,
  "invoice_id": "INV-1718901234-567",
  "amount": 50000,
  "total_amount": 50245,
  "payment_url": "https://app.digitalolshop.com/...",
  "qris_data": "00020101021226610014COM.GO-JEK...",
  "message": "Tagihan berhasil dibuat."
}

3. Ambil Daftar Layanan & Harga

Endpoint ini digunakan untuk mengambil daftar harga layanan (WhatsApp, Telegram, dll) beserta kode negara yang tersedia.

POST services
ParameterTipeWajibDeskripsi
api_keyStringYaAPI Key unik milik akun Anda.
serverStringOpsionalPilih: server1, server2, atau server3. Default: server1.
curl -X POST https://beliotp.id/api/v1/services \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "api_key=API_KEY_ANDA&server=server3"
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://beliotp.id/api/v1/services', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query([ 'api_key' => 'API_KEY_ANDA', 'server' => 'server3' ]), ]); $response = curl_exec($curl);
Contoh Response (JSON)
{
  "status": true,
  "server": "server3",
  "data": [
    {
      "service": "wa",
      "service_name": "WhatsApp",
      "country": "6",
      "country_name": "Indonesia",
      "price": "3500.00"
    }
  ]
}

4. Order Nomor OTP

Membuat pesanan nomor virtual. Sistem kami dilengkapi Auto-Pilot, Anda tidak perlu repot mencari ID Operator, kami akan otomatis membelikan operator termurah yang stoknya tersedia.

POST order
ParameterTipeWajibDeskripsi
api_keyStringYaAPI Key Anda.
serverStringYaPilih: server1, server2, atau server3.
serviceStringYaKode layanan dari endpoint services (contoh: wa).
countryStringYaKode negara dari endpoint services (contoh: 6).
curl -X POST https://beliotp.id/api/v1/order \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "api_key=API_KEY_ANDA&server=server3&service=wa&country=6"
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://beliotp.id/api/v1/order', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query([ 'api_key' => 'API_KEY_ANDA', 'server' => 'server3', 'service' => 'wa', 'country' => '6' ]), ]); $response = curl_exec($curl);
Contoh Response Berhasil (JSON)
{
  "status": true,
  "order_id": "API-1638291039",
  "service_code": "wa",
  "service_name": "WhatsApp",
  "country_code": "6",
  "country_name": "Indonesia",
  "phone": "6281234567890",
  "price": 3500
}

5. Cek Status / Ambil OTP (Manual)

Meskipun kami menyarankan menggunakan Webhook, Anda tetap bisa melakukan polling manual untuk mengecek apakah SMS OTP sudah masuk atau pesanan dibatalkan.

POST check
ParameterTipeWajibDeskripsi
api_keyStringYaAPI Key Anda.
order_idStringYaOrder ID dari respon transaksi sebelumnya.
Contoh Response (Menunggu SMS)
{
  "status": true,
  "service_code": "wa",
  "service_name": "WhatsApp",
  "country_code": "6",
  "country_name": "Indonesia",
  "phone": "6281234567890",
  "price": 3500,
  "order_status": "pending"
}
Contoh Response (OTP Berhasil Masuk)
{
  "status": true,
  "service_code": "wa",
  "service_name": "WhatsApp",
  "country_code": "6",
  "country_name": "Indonesia",
  "phone": "6281234567890",
  "price": 3500,
  "order_status": "received",
  "otp": "893120"
}

6. Batalkan Order

POST cancel
ParameterTipeWajibDeskripsi
api_keyStringYaAPI Key Anda.
order_idStringYaOrder ID yang ingin dibatalkan.
Contoh Response (JSON)
{
  "status": true,
  "message": "Order berhasil dibatalkan dan saldo dikembalikan"
}

7. Webhook Real-Time (Rekomendasi)

Daripada Anda melakukan looping request terus menerus ke endpoint check, sistem kami bisa langsung menembak URL website/sistem Anda secara seketika saat SMS OTP masuk atau saat pesanan dibatalkan (Refund Otomatis).

Cara Mengaktifkan: Masukkan URL Webhook website Anda di menu Integrasi API pada Dashboard. Kami akan mengirim HTTP POST Request dengan tipe application/json.
Payload JSON yang dikirim saat SMS OTP Diterima
{
  "event": "otp.received",
  "order_id": "API-1638291039",
  "phone": "6281234567890",
  "otp": "893120",
  "status": "selesai"
}
Payload JSON yang dikirim saat Pesanan Dibatalkan/Expired
{
  "event": "otp.cancelled",
  "order_id": "API-1638291039",
  "status": "batal"
}