@extends('layouts.app') @push('styles') @endpush @section('content') @php $endpoints = [ [ 'id' => 'balance', 'icon' => 'fa-wallet', 'method' => 'GET', 'path' => '/api/v1/balance', 'title' => 'Cek Saldo', 'desc' => 'Mendapatkan informasi saldo dan profil akun.', 'params' => [], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"OK\",\n \"data\": {\n \"balance\": 50000,\n \"balance_idr\": \"Rp 50.000\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\"\n }\n}", ], [ 'id' => 'services', 'icon' => 'fa-list', 'method' => 'GET', 'path' => '/api/v1/services', 'title' => 'Daftar Layanan', 'desc' => 'Mendapatkan semua layanan OTP aktif beserta harga. Gunakan ?search= untuk filter nama layanan.', 'params' => [ ['name'=>'search','type'=>'string','req'=>false,'desc'=>'Filter nama layanan, contoh: ?search=whatsapp'], ], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"OK\",\n \"data\": [\n {\n \"service_id\": \"whatsapp\",\n \"name\": \"WhatsApp\",\n \"country\": \"id\",\n \"operator\": \"any\",\n \"price\": 600,\n \"price_idr\": \"Rp 600\"\n }\n ]\n}", ], [ 'id' => 'create-order', 'icon' => 'fa-circle-plus', 'method' => 'GET', 'path' => '/api/v1/order/create', 'title' => 'Buat Order', 'desc' => 'Membuat order OTP baru via query string. Saldo dipotong otomatis sesuai harga layanan.', 'params' => [ ['name'=>'service_id', 'type'=>'string', 'req'=>true, 'desc'=>'service_id dari Daftar Layanan, contoh: whatsapp'], ['name'=>'number_id', 'type'=>'string', 'req'=>true, 'desc'=>'ID nomor yang tersedia dari RumahOTP'], ['name'=>'provider_id', 'type'=>'string', 'req'=>true, 'desc'=>'ID provider dari RumahOTP'], ['name'=>'country', 'type'=>'string', 'req'=>false, 'desc'=>'Kode negara (default: id)'], ], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"Order berhasil dibuat.\",\n \"data\": {\n \"order_code\": \"OTP-1234567890-ABCDE\",\n \"rumahotp_order_id\": \"ro_xxxxxxxxxxxx\",\n \"service_id\": \"whatsapp\",\n \"service_name\": \"WhatsApp\",\n \"phone_number\": \"+62878xxxxxxxx\",\n \"country\": \"id\",\n \"status\": \"pending\",\n \"amount\": 600,\n \"expires_at\": \"2026-06-05T10:30:00+07:00\"\n }\n}", ], [ 'id' => 'order-status', 'icon' => 'fa-rotate', 'method' => 'GET', 'path' => '/api/v1/order/status', 'title' => 'Cek Status', 'desc' => 'Mengecek status order langsung ke RumahOTP. Cocok untuk polling OTP secara realtime.', 'params' => [ ['name'=>'order_code', 'type'=>'string','req'=>false,'desc'=>'order_code dari sistem (contoh: OTP-1234567890-ABCDE)'], ['name'=>'rumahotp_id', 'type'=>'string','req'=>false,'desc'=>'rumahotp_order_id jika sudah diketahui'], ], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"OK\",\n \"data\": {\n \"order_code\": \"OTP-1234567890-ABCDE\",\n \"rumahotp_order_id\": \"ro_xxxxxxxxxxxx\",\n \"local_status\": \"pending\",\n \"otp_code\": null,\n \"sms_code\": null,\n \"rumahotp_response\": {}\n }\n}", ], [ 'id' => 'order-detail', 'icon' => 'fa-magnifying-glass', 'method' => 'GET', 'path' => '/api/v1/order/{code}', 'title' => 'Detail Order', 'desc' => 'Mendapatkan detail lengkap satu order berdasarkan order_code atau ID.', 'params' => [ ['name'=>'{code}','type'=>'string','req'=>true,'desc'=>'order_code atau ID order (di URL path, bukan query)'], ], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"OK\",\n \"data\": {\n \"id\": 1,\n \"order_code\": \"OTP-1234567890-ABCDE\",\n \"rumahotp_order_id\": \"ro_xxxxxxxxxxxx\",\n \"service_id\": \"whatsapp\",\n \"service_name\": \"WhatsApp\",\n \"phone_number\": \"+62878xxxxxxxx\",\n \"country\": \"id\",\n \"status\": \"success\",\n \"otp_code\": \"123456\",\n \"sms_code\": null,\n \"sms_text\": \"Your WhatsApp code is 123456\",\n \"amount\": 600,\n \"expires_at\": \"2026-06-05T10:30:00+07:00\",\n \"created_at\": \"2026-06-05T10:00:00+07:00\",\n \"updated_at\": \"2026-06-05T10:05:00+07:00\"\n }\n}", ], [ 'id' => 'cancel-order', 'icon' => 'fa-ban', 'method' => 'GET', 'path' => '/api/v1/order/cancel', 'title' => 'Cancel Order', 'desc' => 'Membatalkan order OTP yang masih berstatus pending. Saldo akan dikembalikan otomatis.', 'params' => [ ['name'=>'order_code', 'type'=>'string','req'=>false,'desc'=>'order_code dari sistem (contoh: OTP-1234567890-ABCDE)'], ['name'=>'rumahotp_id', 'type'=>'string','req'=>false,'desc'=>'rumahotp_order_id jika sudah diketahui. Wajib salah satu.'], ], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"Order berhasil dibatalkan. Saldo dikembalikan.\",\n \"data\": {\n \"order_code\": \"OTP-1234567890-ABCDE\",\n \"status\": \"cancelled\",\n \"refund\": 600,\n \"refund_idr\": \"Rp 600\",\n \"new_balance\": 50600,\n \"rumahotp_response\": {}\n }\n}", ], [ 'id' => 'orders', 'icon' => 'fa-list-check', 'method' => 'GET', 'path' => '/api/v1/orders', 'title' => 'Daftar Order', 'desc' => 'Mendapatkan daftar order milik akun, diurutkan dari yang terbaru. Mendukung filter status dan pagination.', 'params' => [ ['name'=>'limit', 'type'=>'integer','req'=>false,'desc'=>'Jumlah data per halaman (max 50, default 10)'], ['name'=>'page', 'type'=>'integer','req'=>false,'desc'=>'Nomor halaman (default 1)'], ['name'=>'status','type'=>'string', 'req'=>false,'desc'=>'Filter status: pending | success | cancelled | expired'], ], 'body_example' => null, 'response' => "{\n \"success\": true,\n \"message\": \"OK\",\n \"data\": {\n \"total\": 42,\n \"page\": 1,\n \"limit\": 10,\n \"orders\": [\n {\n \"id\": 1,\n \"order_code\": \"OTP-1234567890-ABCDE\",\n \"service_id\": \"whatsapp\",\n \"service_name\": \"WhatsApp\",\n \"phone_number\": \"+62878xxxxxxxx\",\n \"country\": \"id\",\n \"status\": \"success\",\n \"otp_code\": \"123456\",\n \"sms_code\": null,\n \"amount\": 600,\n \"expires_at\": \"2026-06-05T10:30:00+07:00\",\n \"created_at\": \"2026-06-05T10:00:00+07:00\"\n }\n ]\n }\n}", ], [ 'id' => 'errors', 'icon' => 'fa-triangle-exclamation', 'method' => null, 'path' => null, 'title' => 'Kode Error', 'desc' => 'Daftar HTTP status code yang mungkin dikembalikan oleh API.', 'params' => [], 'body_example' => null, 'response' => null, ], ]; @endphp {{-- PAGE HEADER --}}
{{-- AUTH INFO --}}X-API-Key: nk_xxxxxxxxxxxxxxxx?api_key=nk_xxx
{{ $baseUrl }}{{ $ep['path'] }}
{{ $ep['desc'] }}
{{-- Section: Endpoint detail --}}{{ $ep['response'] }}
{{ $ep['desc'] }}