tutorialapideveloperintegrasinode.jspythonphprest api

Cara Integrasi API KirimKode untuk Developer

KirimKode Team12 Maret 2026263 dilihat

Kenapa Menggunakan API KirimKode?

Jika Anda developer yang membutuhkan nomor virtual secara programatik — baik untuk QA testing, automasi registrasi, atau integrasi ke platform Anda — API KirimKode menyediakan akses lengkap ke semua fitur melalui REST API.

Persiapan

Dapatkan API Key

  1. Daftar di kirimkode.com
  2. Buka halaman API Docs di dashboard
  3. Generate atau salin API Key Anda

Base URL

https://api.kirimkode.com/v1

Semua request memerlukan header:

X-API-Key: YOUR_API_KEY

Endpoint Utama

1. Cek Saldo

curl -H "X-API-Key: YOUR_KEY" https://api.kirimkode.com/v1/balance

Response:

{

"success": true,

"data": { "balance": 125000, "currency": "IDR" },

"timestamp": "2026-03-11T..."

}

2. Lihat Layanan Tersedia

curl "https://api.kirimkode.com/v1/services?server=api1&country=6" \

-H "X-API-Key: YOUR_KEY"

3. Buat Order

curl -X POST https://api.kirimkode.com/v1/order \

-H "X-API-Key: YOUR_KEY" \

-H "Content-Type: application/json" \

-d '{"server":"api1","country":6,"service":"wa","operator":"any"}'

4. Cek Status OTP

curl "https://api.kirimkode.com/v1/order/ORDER_ID/status" \

-H "X-API-Key: YOUR_KEY"

5. Cancel Order

curl -X POST "https://api.kirimkode.com/v1/order/ORDER_ID/cancel" \

-H "X-API-Key: YOUR_KEY"

Contoh Integrasi Node.js

const API_KEY = "YOUR_API_KEY";

const BASE = "https://api.kirimkode.com/v1";

async function getOTP(service, country) {

// 1. Buat order

const order = await fetch(${BASE}/order, {

method: "POST",

headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },

body: JSON.stringify({ server: "api1", country, service, operator: "any" }),

}).then(r => r.json());

console.log("Nomor:", order.data.number);

// 2. Poll OTP

while (true) {

const status = await fetch(${BASE}/order/${order.data.order_id}/status, {

headers: { "X-API-Key": API_KEY },

}).then(r => r.json());

if (status.data.code) {

console.log("OTP:", status.data.code);

return status.data.code;

}

await new Promise(r => setTimeout(r, 5000));

}

}

Error Handling

Semua error menggunakan format konsisten:

{

"success": false,

"error": { "message": "Insufficient balance", "code": "INSUFFICIENT_BALANCE" },

"timestamp": "2026-03-11T..."

}

Error code yang umum: MISSING_FIELDS, INSUFFICIENT_BALANCE, OUT_OF_STOCK, CANCEL_TOO_EARLY.

Rate Limiting

API dibatasi 60 request per menit untuk endpoint umum dan 10 request per menit untuk auth/deposit. Jika melebihi limit, Anda akan mendapat response 429.

Kesimpulan

API KirimKode dirancang untuk developer yang membutuhkan integrasi cepat dan reliable. Dengan format response yang konsisten dan dokumentasi lengkap, Anda bisa mulai mengintegrasikan nomor virtual ke aplikasi Anda dalam hitungan menit. Kunjungi kirimkode.com/api-docs untuk dokumentasi lengkap.

Butuh Nomor Virtual untuk OTP?

Dapatkan nomor virtual instan dari 200+ negara mulai dari Rp 1.200.