Profile & Resource Quota
Frog Cloud memisahkan pengelolaan kredensial (Auth) dan informasi pribadi (Profile) untuk meningkatkan performa sistem. Dokumentasi ini mencakup cara Frontend merender data pribadi pelanggan, kuota layanan (seperti limit VM), serta pengaturan preferensi notifikasi.
1. Menarik Info Singkat Dasbor (User Info)
Saat pelanggan pertama kali mendarat di halaman utama Dasbor, Frontend membutuhkan ringkasan data yang cepat tanpa harus memuat seluruh entitas profil.
GET /api/inf
Respons (200 OK): Mereturn informasi vital seperti Nama Lengkap pengguna, Saldo Dompet (Balance) saat ini, kuota limit terpakai, dan hitungan jumlah notifikasi yang belum dibaca.
{
"id": 123,
"email": "johndoe@example.com",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"is_active": true,
"is_registration_completed": true,
"is_identity_verified": false,
"is_2fa_active": true,
"account_type": "P",
"account_type_description": "PERSONAL",
"billing_type": "POSTPAID",
"actual_balance": 150000,
"current_balance": 150000,
"unread_count": 5,
"suspended_at": null,
"suspend_reason": null,
"do_not_suspend_until": null,
"reward_first_top_up": false,
"reward_referral": false,
"block_storage_limit": 500,
"loadbalancer_limit": 5,
"object_storage_limit": 1000,
"private_ip_limit": 10,
"public_ip_limit": 2,
"vm_limit": 10,
"personal": {
"phone": "081234567890",
"address": "Jl. Sudirman No. 1",
"country_id": "79",
"province_id": "31",
"city_id": "3171",
"district_id": "317101",
"province_custom": "DKI Jakarta",
"city_custom": "Jakarta Pusat",
"tax_number": "12.345.678.9-012.000"
},
"business": {},
"notification_setting": {
"allow_marketing_email": false,
"allow_billing_reminder": true
}
}
2. Mengelola Profil Pribadi & Bisnis
Di halaman Pengaturan Profil, pelanggan dapat melengkapi data identitas mereka (seperti Alamat atau Nama Perusahaan). Informasi ini kelak akan digunakan sistem saat mencetak dokumen hukum seperti Invoice.
Melihat Profil Saat Ini
GET /api/customer/profile
Respons (200 OK):
{
"id": 123,
"firstname": "Mas",
"lastname": "Bram",
"full_name": "Mas Bram",
"email": "johndoe@example.com",
"account_type": "P",
"is_active": true,
"is_registration_completed": true,
"is_identity_verified": false,
"is_2fa_active": true,
"actual_balance": 150000,
"personal_profile": {
"phone": "081234567890",
"address": "Jl. Sudirman No. 1",
"country_id": "79",
"province_id": "31",
"city_id": "3171",
"district_id": "317101",
"province_custom": "DKI Jakarta",
"city_custom": "Jakarta Pusat",
"tax_number": "12.345.678.9-012.000"
},
"business_profile": {}
}
Menyimpan Perubahan Profil
PATCH /api/customer/profile
Content-Type: application/json
{
"firstname": "Mas",
"lastname": "Bram",
"account_type": "P",
"personal_profile": {
"phone": "081234567890",
"address": "Jl. Sudirman No. 1",
"country_id": "79",
"province_id": "31",
"city_id": "3171",
"district_id": "317101",
"province_custom": "DKI Jakarta",
"city_custom": "Jakarta Pusat",
"tax_number": "12.345.678.9-012.000"
}
}
Catatan Parameter:
firstnamedanlastnameberada di root JSON.account_typediisiPuntuk Personal atauBuntuk Business.- Kirim objek
business_profilealih-alihpersonal_profilejika tipe akun adalah Business. Anda dapat melampirkan isian sepertiname(nama perusahaan) danwebsite_urldi dalamnya.- Untuk wilayah Indonesia, prioritaskan pengisian ID referensi geografis (
country_id,province_id,city_id,district_id). Anda hanya disarankan menggunakan nilai teks bebas padaprovince_customdancity_customapabila pelanggan berada di negara/kota di luar referensi sistem kami.
3. Limit Kuota Resource (Resource Limits)
Setiap Customer memiliki "Jatah" atau batasan maksimal pembuatan layanan Cloud (contoh: maksimal 5 Virtual Machine, atau maksimal 2 IP Publik) untuk mencegah penyalahgunaan (Abuse/Spam).
Frontend dapat menggunakan API ini untuk menampilkan grafik batang (progress bar) yang menunjukkan kuota terpakai vs kuota maksimal di layar Billing atau Dashboard.
GET /api/customer/resource
Respons (200 OK):
{
"data": {
"max_vm": 10,
"current_vm": 2,
"max_ip": 5,
"current_ip": 1
}
}
4. Pengaturan Notifikasi (Notification Settings)
Pelanggan diberikan kontrol privasi untuk mematikan atau menghidupkan notifikasi promosi pemasaran (Marketing), laporan tagihan harian, dll.
PATCH /api/customer/profile/notification-setting
Content-Type: application/json
{
"allow_marketing_email": false,
"allow_billing_reminder": true
}