@fajarofficial/rumahotp-apisjarz
v1.0.4
Published
Unofficial Node.js client for RumahOTP API (OTP & QRIS Deposit).
Readme
RumahOTP Client (Unofficial)
Node.js wrapper sederhana untuk API RumahOTP (OTP SMS & QRIS Deposit).
Mendukung endpoint API v1 dan API v2 agar tetap kompatibel dengan seluruh fitur.
📦 Instalasi
npm install @fajarofficial/rumahotp-apisjarz🚀 Penggunaan Dasar
const RumahOtpClient = require("@fajarofficial/rumahotp-apisjarz")
const client = new RumahOtpClient("API_KEY_KAMU")
async function main() {
const services = await client.getServices()
console.log(services)
}
main()🔥 Penjelasan API Version
✅ API v1 (Legacy)
Versi lama yang masih aktif digunakan untuk beberapa endpoint penting.
Digunakan untuk:
- cek status order
- set status order
- cek balance
- deposit lama
Contoh endpoint:
/api/v1/orders/get_status
/api/v1/orders/set_status
/api/v1/user/balance
/api/v1/deposit/create🚀 API v2 (Recommended)
Versi terbaru dengan fitur lebih lengkap dan response lebih stabil.
Digunakan untuk:
- services list
- countries list
- operators list
- create order baru
- deposit terbaru
Contoh endpoint:
/api/v2/services
/api/v2/countries
/api/v2/operators
/api/v2/orders
/api/v2/deposit/create📱 FLOW ORDER OTP (RECOMMENDED)
1️⃣ Ambil Services
const services = await client.getServices()2️⃣ Ambil Negara
const countries = await client.getCountries(serviceId)3️⃣ Ambil Operator
const operators = await client.getOperators(country, providerId)4️⃣ Buat Order Nomor
const order = await client.createOrder(numberId, providerId, operatorId)Response berisi:
- order_id
- nomor HP
- expired time
- harga
5️⃣ Cek OTP Status
const status = await client.getOrderStatus(order.order_id)Status kemungkinan:
- waiting
- received
- completed
- canceled
- expiring
OTP akan muncul di otp_code.
6️⃣ Set Status Order
await client.setOrderStatus(order.order_id, "done")Status tersedia:
- done
- cancel
- resend
💰 BALANCE
const balance = await client.getBalance()💳 DEPOSIT
Buat Deposit QRIS
const depo = await client.createDeposit(10000)Deposit V2
const depo = await client.createDepositV2(10000)Cek Status Deposit
await client.getDepositStatus(depositId)
await client.getDepositStatusV2(depositId)⚠️ Tips Penting
✅ Gunakan v2 untuk order & listing data ✅ Gunakan v1 untuk status polling ✅ Jangan polling terlalu cepat (disarankan 3–5 detik) ✅ Selalu set status order setelah OTP diterima
🔐 Error Handling
Semua fungsi akan throw error jika API gagal.
Contoh:
try {
await client.getServices()
} catch (e) {
console.log(e.message)
}👑 Author
fajarofficial
⭐ Support
Jika project ini membantu, jangan lupa kasih ⭐ di npm / GitHub.
