Dokumentasi API Terpadu
Selamat datang di Pusat Developer WarungNokos. Gunakan API Host-to-Host (H2H) ini untuk mengintegrasikan layanan Nomor Virtual, OTP otomatis, dan Sistem Saldo ke dalam website atau bot WhatsApp Anda secara White-Label (Tanpa identitas pihak ketiga).
Base URL API Endpoint
https://warungnokos.web.id/api
Autentikasi (WAJIB!)
Seluruh endpoint API membutuhkan otorisasi. Anda WAJIB menggunakan API Key yang didapat dari halaman Profil Anda. Masukkan API Key tersebut ke dalam Header request.
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| x-api-key |
string |
headers |
Ya |
Kunci API autentikasi (Contoh: wn-123xyz...) |
Users Profile & Balance
Mengambil informasi detail tentang profil akun WarungNokos Anda dan saldo terkini yang dapat digunakan untuk transaksi H2H.
Contoh kode Request:
const options = {
method: 'GET',
url: 'https://warungnokos.web.id/api/user/profile',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Accept': 'application/json'
}
};
const response = await axios(options);
Success Response:
{
"success": true,
"data": {
"username": "developer_pro",
"email": "dev@mail.com",
"balance": 150000,
"referralCode": "A1B2C3"
}
}
Services Available
Daftar lengkap layanan aplikasi (WhatsApp, Telegram, dll) yang tersedia di server kami untuk keperluan OTP.
Contoh kode Request:
const options = {
method: 'GET',
url: 'https://warungnokos.web.id/api/otp/services',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Accept': 'application/json'
}
};
const response = await axios(options);
Success Response (V2 Format):
{
"success": true,
"data": [
{
"service_code": 14,
"service_name": "WhatsApp",
"service_img": "https://link/wa.png"
},
{
"service_code": 86,
"service_name": "Telegram",
"service_img": "https://link/tg.png"
}
]
}
Countries Available
Mengambil daftar negara beserta pricelist (harga & stok) yang tersedia secara spesifik berdasarkan ID Layanan yang dipilih.
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| serviceId | string | URL Path | Ya | ID layanan (contoh: 14 untuk WhatsApp) |
Contoh kode Request:
const options = {
method: 'GET',
// Ganti :serviceId dengan ID layanan (Contoh 14)
url: 'https://warungnokos.web.id/api/otp/countries/:serviceId',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Accept': 'application/json'
}
};
const response = await axios(options);
Success Response (V2 Format):
{
"success": true,
"data": [
{
"number_id": 340437,
"name": "Indonesia",
"prefix": "+62",
"stock_total": 103,
"pricelist": [
{
"provider_id": "3837",
"server_id": 3,
"stock": 103,
"rate": 81.6,
"price": 1100
}
]
}
]
}
List Operator
Daftar lengkap operator seluler berdasarkan negara dan provider_id yang dipilih.
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| country | string | URL Path | Ya | Nama Negara (contoh: "indonesia") |
| providerId | string | URL Path | Ya | Provider ID dari list pricelist (contoh: "3837") |
Contoh kode Request:
const options = {
method: 'GET',
url: 'https://warungnokos.web.id/api/otp/operators/:country/:providerId',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Accept': 'application/json'
}
};
const response = await axios(options);
Success Response (V2 Format):
{
"success": true,
"data": [
{
"id": "any",
"name": "any",
"image": "https://link/any.ico"
},
{
"id": "telkomsel",
"name": "telkomsel",
"image": "https://link/telkomsel.jpg"
}
]
}
Create Order OTP
Endpoint untuk membeli nomor virtual. Saldo akan otomatis terpotong. (Sistem V2: Atomic & White-Label)
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| number_id | string | body | Ya | number_id dari list negara |
| provider_id | string | body | Ya | provider_id dari pricelist server |
| operator_id | string | body | Ya | id dari list operator (contoh: "any") |
| price_jual | number | body | Ya | Harga modal + markup Anda |
| service_name | string | body | Opsional | Nama layanan untuk label (Contoh: "WhatsApp") |
Contoh kode Request:
const options = {
method: 'POST',
url: 'https://warungnokos.web.id/api/otp/order',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
data: {
"number_id": "340437",
"provider_id": "3837",
"operator_id": "any",
"price_jual": 3500,
"service_name": "WhatsApp"
}
};
const response = await axios(options);
Success Response (White-Label):
{
"success": true,
"data": {
"trxId": "WN0000000125",
"serviceName": "WhatsApp",
"phoneNumber": "+62 812 3456 7890",
"amount": 3500,
"status": "waiting",
"createdAt": "2026-04-02T12:00:00.000Z"
}
}
Check Order Status
Periksa status pesanan nomor Anda (apakah SMS sudah masuk). Lakukan polling setiap 4-5 detik pada endpoint ini. (Sistem Race-Condition Safe)
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| orderId | string | URL Path | Ya | ID Trx Lokal (contoh: "WN0000000125") |
Contoh kode Request:
const options = {
method: 'GET',
// Masukkan trxId WN... di URL
url: 'https://warungnokos.web.id/api/otp/status/WN0000000125',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Accept': 'application/json'
}
};
const response = await axios(options);
Success Response (Saat SMS Masuk):
{
"success": true,
"status": "completed", // waiting, completed, canceled
"otp_code": "949708"
}
Set Order Status
Ubah status pesanan secara manual (contoh: batalkan OTP jika kelamaan). Saldo akan dikembalikan jika dibatalkan.
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| trxId | string | body | Ya | ID Trx Lokal (contoh: "WN0000000125") |
| action_status | string | body | Ya | Aksi: cancel, done, resend |
Contoh kode Request:
const options = {
method: 'POST',
url: 'https://warungnokos.web.id/api/otp/set_status',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
data: {
"trxId": "WN0000000125",
"action_status": "cancel"
}
};
const response = await axios(options);
Success Response:
{
"success": true,
"message": "Status berhasil diubah menjadi cancel"
}
Create Deposit (V2)
Buat kode tagihan pembayaran untuk top-up saldo user. Mendukung metode QRIS dan Crypto USDT. Maksimal 3 transaksi pending.
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| amount | number | body | Ya | Jumlah deposit (Min: 2000) |
| method | string | body | Opsional | Metode: qris, usdt-trc-20, dll. (Default: qris) |
Contoh kode Request:
const options = {
method: 'POST',
url: 'https://warungnokos.web.id/api/deposit/create',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
data: {
"amount": 50000,
"method": "qris"
}
};
const response = await axios(options);
Success Response (White-Label):
{
"success": true,
"trxId": "WN0000000050",
"qr_string": "00020101021126600015...",
"qr_image": "https://qris.url/img.png",
"total": 50200,
"expired_at": 1775022865340
}
Deposit Status (V2)
Periksa status pembayaran deposit. Jika berhasil, objek detail akan terisi nama Brand pembayaran (misal DANA, OVO, TRON).
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| trxId | string | URL Path | Ya | ID Deposit (contoh: "WN0000000050") |
Contoh kode Request:
const options = {
method: 'GET',
url: 'https://warungnokos.web.id/api/deposit/status/WN0000000050',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Accept': 'application/json'
}
};
const response = await axios(options);
Success Response (Lengkap dgn Metadata):
{
"success": true,
"status": "success", // pending, success, cancel
"amount": 50000,
"detail": {
"created_at": "2026-04-02 12:34:25",
"total": 50200,
"fee": 200,
"diterima": 50000,
"brand_name": "DANA",
"buyer_reff": "1js8mUeShBIw"
}
}
Deposit Cancel
Batalkan status tagihan pembayaran deposit yang masih berstatus tertunda (pending).
| Parameter | Tipe | Lokasi | Diperlukan | Deskripsi |
| trxId | string | body | Ya | ID Deposit (contoh: "WN0000000050") |
Contoh kode Request:
const options = {
method: 'POST',
url: 'https://warungnokos.web.id/api/deposit/cancel',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
data: {
"trxId": "WN0000000050"
}
};
const response = await axios(options);
Success Response:
{
"success": true,
"message": "Deposit dibatalkan",
"detail": {
"created_at": "2026-04-02 12:34:25",
"total": 50200,
"fee": 200,
"diterima": 50000,
"brand_name": "QRIS",
"buyer_reff": "-"
}
}