> 🔥 Baru mulai? Baca Panduan 3 Langkah Instan dulu — lebih lengkap, dengan contoh kode copy-paste!
>
> ⚠️ API Services Mirel Tower terpisah dari Mirel ERP & POS. Dokumen ini khusus API.
| Info | Detail |
| ----------------- | --------------------------------------------------------------------- |
|---|---|
| Format | Semua POST → application/json → response application/json |
| SDK PHP | MirelTowerClient.php |
| SDK JS | mirel-tower-client.js |
| Composer | composer require mirel/tower-sdk |
| GitHub | github.com/phyranyansen/Mirel-API-Services |
Pilih salah satu cara:
| Cara | Contoh |
| ------------------------------ | --------------------------------------- |
|---|---|
Header Authorization: Bearer | Authorization: Bearer KJ8F2M...abc123 |
| POST / JSON body | {"license_key": "KJ8F2M...abc123"} |
> ⚠️ Case-sensitive! KJ8F2M ≠ kj8f2m.
| Header X-Mirel-API-Key | Hasil |
| ------------------------ | --------------------------------------------------------- |
|---|---|
mirel_live_* / kosong | 🚀 Production — AI beneran, potong saldo token |
| Paket | Batas |
| ---------- | ---------- |
|---|---|
| Pro | 20 request |
| Enterprise | 60 request |
> Kalau kena 429, tenang — tunggu retry_after detik, lanjut lagi.
/api/v1/ai)| Endpoint | Paket | Gunanya |
| ---------------------- | ---------- | ---------------------------- |
|---|---|---|
business-init | Standard | Setel data bisnis baru |
guide | Standard | Tanya AI Assistant (gratis) |
validate-ai-usage | Standard | Cek saldo token |
topup-confirm | Standard | Konfirmasi top-up |
process-journal | Pro | Buat jurnal akuntansi |
accounting-reconcile | Pro | Rekonsiliasi bank vs invoice |
match-transaction | Pro | Cocokkan transaksi |
map-coa | Pro | Mapping COA |
detect-anomaly | Pro | Deteksi transaksi aneh |
tax-calculate | Pro | Hitung pajak |
nl-query | Pro | Tanya data pake bahasa biasa |
forecast-demand | Enterprise | Prediksi permintaan stok |
finance-insights | Enterprise | Wawasan keuangan |
parse-document | Enterprise | OCR dokumen |
cashflow-forecast | Enterprise | Proyeksi arus kas |
sentiment-analyze | Enterprise | Analisis sentimen |
smart-procurement | Enterprise | Rekomendasi belanja |
| Kode | Arti | Solusi |
| ------- | ----------------- | -------------------------------- |
|---|---|---|
| 402 | Token habis | Top-up atau tunggu reset bulanan |
| 403 | Paket kurang | Upgrade paket |
| 429 | Kegencetan | Tunggu bentar, ulangi |
> 📖 Panduan lengkap + contoh kode: api-public-guide.md