Tersalin ke clipboard!
API Docs

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).

https://warungnokos.web.id/api

Seluruh endpoint API membutuhkan otorisasi. Anda WAJIB menggunakan API Key yang didapat dari halaman Profil Anda. Masukkan API Key tersebut ke dalam Header request.

ParameterTipeLokasiDiperlukanDeskripsi
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.

profile.js
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);
profile.json
{
"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.

services.js
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);
services.json
{
"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.

ParameterTipeLokasiDiperlukanDeskripsi
serviceIdstringURL PathYaID layanan (contoh: 14 untuk WhatsApp)
countries.js
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);
countries.json
{
"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.

ParameterTipeLokasiDiperlukanDeskripsi
countrystringURL PathYaNama Negara (contoh: "indonesia")
providerIdstringURL PathYaProvider ID dari list pricelist (contoh: "3837")
operators.js
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);
operators.json
{
"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)

ParameterTipeLokasiDiperlukanDeskripsi
number_idstringbodyYanumber_id dari list negara
provider_idstringbodyYaprovider_id dari pricelist server
operator_idstringbodyYaid dari list operator (contoh: "any")
price_jualnumberbodyYaHarga modal + markup Anda
service_namestringbodyOpsionalNama layanan untuk label (Contoh: "WhatsApp")
orders.js
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);
orders.json
{
"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)

ParameterTipeLokasiDiperlukanDeskripsi
orderIdstringURL PathYaID Trx Lokal (contoh: "WN0000000125")
get-status.js
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);
get-status.json
{
"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.

ParameterTipeLokasiDiperlukanDeskripsi
trxIdstringbodyYaID Trx Lokal (contoh: "WN0000000125")
action_statusstringbodyYaAksi: cancel, done, resend
set-status.js
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);
set-status.json
{
"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.

ParameterTipeLokasiDiperlukanDeskripsi
amountnumberbodyYaJumlah deposit (Min: 2000)
methodstringbodyOpsionalMetode: qris, usdt-trc-20, dll. (Default: qris)
depo-create.js
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);
depo-create.json
{
"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).

ParameterTipeLokasiDiperlukanDeskripsi
trxIdstringURL PathYaID Deposit (contoh: "WN0000000050")
depo-status.js
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);
depo-status.json
{
"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).

ParameterTipeLokasiDiperlukanDeskripsi
trxIdstringbodyYaID Deposit (contoh: "WN0000000050")
depo-cancel.js
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);
depo-cancel.json
{
"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": "-"
}
}