Base URL: https://beliotp.id/api/v1/
Semua request menggunakan metode POST dan parameter dikirim menggunakan format x-www-form-urlencoded.
1. Cek Profil & Saldo
POST profile
| Parameter | Wajib | Deskripsi |
api_key | Ya | API Key yang didapat dari halaman profil Anda. |
Contoh Respon Berhasil:
{
"status": true,
"data": {
"nama": "Toko OTP",
"email": "toko@email.com",
"saldo": 150000
}
}
2. Ambil Daftar Layanan & Harga
POST services
| Parameter | Wajib | Deskripsi |
api_key | Ya | API Key Anda. |
server | Tidak | Pilih server: server1 atau server2. Default: server1. |
Contoh Respon Berhasil:
{
"status": true,
"server": "server1",
"data": [
{
"service": "wa",
"service_name": "WhatsApp",
"country": "6",
"country_name": "Indonesia",
"price": "3500.00"
}
]
}
3. Order Nomor OTP
POST order
| Parameter | Wajib | Deskripsi |
api_key | Ya | API Key Anda. |
server | Ya | Server yang digunakan: server1 atau server2. |
service | Ya | Kode layanan dari endpoint services (contoh: wa). |
country | Ya | Kode negara dari endpoint services (contoh: 6). |
Contoh Respon Berhasil:
{
"status": true,
"order_id": "API-1638291039",
"phone": "6281234567890",
"price": 3500
}
4. Cek Status & Ambil Kode OTP
POST check
| Parameter | Wajib | Deskripsi |
api_key | Ya | API Key Anda. |
order_id | Ya | Order ID yang didapat saat melakukan order. |
Contoh Respon (Menunggu OTP):
{
"status": true,
"order_status": "pending"
}
Contoh Respon (OTP Masuk):
{
"status": true,
"order_status": "received",
"otp": "893120"
}
5. Batalkan Order
POST cancel
| Parameter | Wajib | Deskripsi |
api_key | Ya | API Key Anda. |
order_id | Ya | Order ID yang ingin dibatalkan. |
Catatan: Pembatalan hanya bisa dilakukan jika status OTP masih 'pending' dan mengikuti kebijakan waktu pembatalan dari pusat.
Contoh Respon Berhasil:
{
"status": true,
"message": "Order berhasil dibatalkan dan saldo dikembalikan"
}
6. Contoh Script PHP Lengkap
Gunakan script di bawah ini sebagai referensi untuk menghubungkan sistem Anda dengan API kami menggunakan cURL PHP.
<?php
$api_key = 'API_KEY_ANDA_DISINI';
$base_url = 'https://beliotp.id/api/v1/';
function sendRequest($endpoint, $data) {
global $base_url;
$ch = curl_init($base_url . $endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// ---------------------------------------------------------
// 1. CONTOH ORDER OTP DI SERVER 1 (PRIORITAS)
// ---------------------------------------------------------
$order_data_s1 = [
'api_key' => $api_key,
'server' => 'server1',
'service' => 'wa', // Kode layanan WhatsApp di Server 1
'country' => '6' // Kode negara Indonesia di Server 1
];
$order_s1 = sendRequest('order', $order_data_s1);
print_r($order_s1);
// ---------------------------------------------------------
// 2. CONTOH ORDER OTP DI SERVER 2 (PREMIUM)
// ---------------------------------------------------------
$order_data_s2 = [
'api_key' => $api_key,
'server' => 'server2',
'service' => '13', // Kode layanan WhatsApp di Server 2
'country' => '340437' // Kode negara Indonesia di Server 2
];
$order_s2 = sendRequest('order', $order_data_s2);
print_r($order_s2);
// ---------------------------------------------------------
// 3. CONTOH CEK STATUS OTP (Berlaku untuk semua server)
// ---------------------------------------------------------
// Anggap kita mendapat order_id dari respon order di atas
$check_data = [
'api_key' => $api_key,
'order_id' => 'API-1638291039' // Ganti dengan order_id yang didapat
];
$check_status = sendRequest('check', $check_data);
print_r($check_status);
// ---------------------------------------------------------
// 4. CONTOH MEMBATALKAN ORDER (Berlaku untuk semua server)
// ---------------------------------------------------------
$cancel_data = [
'api_key' => $api_key,
'order_id' => 'API-1638291039'
];
$cancel_order = sendRequest('cancel', $cancel_data);
print_r($cancel_order);
?>