Mulai Cepat
- Daftar di app.wargaplus.id untuk mendapatkan akses API.
- Ambil API key dari dashboard (mode sandbox/production).
- Gunakan environment variable untuk menyimpan kredensial.
Autentikasi
Gunakan header Authorization Bearer API_KEY untuk setiap permintaan.
- Semua endpoint wajib HTTPS.
- Token berbeda untuk sandbox dan production.
- Jika gagal auth, server mengembalikan
401 Unauthorizeddengan error codeauth_invalid_token.
Base URL & Versi
- Sandbox:
sandbox-api.wargaplus.id/v1 - Production:
api.wargaplus.id/v1
Endpoint Utama
GET /environments
Daftar lingkungan yang Anda kelola.
- Query:
page,page_size - Response 200:
data array dengan id dan name - Error: 401 (auth_invalid_token), 429 (rate_limited)
POST /announcements
Kirim pengumuman ke warga.
- Payload: title, body, environment_id, channels
- Response 201: id dan status
- Error: 400 (invalid_body), 401, 403 (forbidden), 429
POST /bills
Buat tagihan/iuran baru.
- Payload: title, amount, due_date, environment_id, resident_ids
- Response 201: id dan status
- Error: 400 (invalid_body), 401, 403, 404 (environment_not_found), 429
POST /payments/confirm
Konfirmasi pembayaran manual.
- Payload: bill_id, reference, paid_at
- Response 200: bill_id dan status
- Error: 400 (invalid_body), 401, 403, 404 (bill_not_found), 409 (already_paid), 429
GET /reports
Ringkasan laporan aktivitas.
- Query:
from,to,environment_id - Response 200: payments (count, amount), announcements, tickets
- Error: 401, 403, 429
Webhook
- Daftarkan URL webhook di dashboard.
- Kami mengirim event:
payment.paid,bill.overdue,announcement.sent. - Verifikasi tanda tangan header
X-WP-Signaturemenggunakan HMAC-SHA256. - Balas 2xx; percobaan ulang dilakukan hingga 3 kali dengan backoff.
Rate Limit
- Default: 100 request/menit per API key (sandbox dan production dihitung terpisah).
- Header response:
X-RateLimit-Limit,X-RateLimit-Remaining - Jika melebihi limit, server mengembalikan
429 Too Many Requests.
Error & Response
Semua error mengikuti format:
Error response format example Format: error object dengan code dan message
Kode error umum:
auth_invalid_token- Token tidak validinvalid_body- Request body tidak validnot_found- Resource tidak ditemukanrate_limited- Melebihi rate limit
Contoh Permintaan
Contoh menggunakan cURL:
curl -X GET api.wargaplus.id/v1/environments -H "Authorization Bearer YOUR_API_KEY" Dukungan Teknis
Pertanyaan teknis atau bantuan integrasi: dev@wargaplus.id
GitHub: github.com/wargaplus/wargaplus