Dokumentasi API SPP Sekolah
REST API untuk aplikasi SaaS Pembayaran Administrasi Sekolah: registrasi sekolah, data siswa & import Excel, jenis biaya & tarif, tagihan massal, pembayaran & kuitansi, laporan, dan portal wali murid. Semua fitur web tersedia juga lewat API (82 endpoint).
Base URL https://belajar-api.unama.ac.id/api/sppSalin
Autentikasi
1. Dapatkan token Admin sekolah: POST /auth/login (email + kata sandi) atau POST /auth/register. Wali murid: POST /wali/login (kode sekolah + NIS + PIN). Superadmin: POST /auth/login.
curl -X POST "https://belajar-api.unama.ac.id/api/spp/auth/login" \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] ","password":"password"}'
2. Kirim di setiap request Simpan data.token.access_token, lalu kirim sebagai header. Token berlaku 30 hari dan disimpan di server sebagai hash SHA-256. Logout mencabut token.
Authorization: Bearer 12|AbCdEf...
Accept: application/json
Jenis token: admin (semua endpoint sekolah), wali (hanya /wali/*, data anaknya sendiri), super (hanya /super/*). Token sekolah A tidak pernah bisa membaca data sekolah B (404).
Berhasil {
"success": true,
"message": "OK",
"data": [ ... ],
"meta": { "current_page": 1, "per_page": 20, "total": 57, "last_page": 3, "from": 1, "to": 20 }
} Daftar data dipaginasi dengan ?page= & ?per_page= (maks 100) dan mendukung pencarian ?q=. Uang dalam rupiah bulat (integer). Tanggal ISO 8601, zona waktu Asia/Jakarta.
Gagal {
"success": false,
"message": "Data yang dikirim tidak valid. Periksa bagian \"errors\".",
"errors": {
"nis": ["NIS sudah ada sebelumnya."]
}
}
Kode error & batas request
Kode Arti Kapan terjadi
400 Bad Request Permintaan tidak dapat diproses. 401 Unauthorized Token tidak dikirim, salah, atau kedaluwarsa; atau login gagal. 403 Forbidden Token tidak berhak (mis. token wali ke endpoint admin) atau sekolah/akun nonaktif. 404 Not Found Endpoint atau data tidak ditemukan (termasuk data milik sekolah lain). 405 Method Not Allowed Method HTTP salah. 409 Conflict Aksi bertentangan dengan data, mis. menghapus kelas yang masih ada siswanya. 413 Payload Too Large File/data terlalu besar. 422 Unprocessable Entity Validasi gagal (lihat errors) atau aturan bisnis dilanggar (mis. bayar melebihi sisa). 429 Too Many Requests Melebihi 120 request/menit (login: 10/menit). 500 Server Error Kesalahan server.
Alur lengkap (dari daftar sampai laporan)
POST /auth/register → simpan token
POST /academic-years (2026/2027, 1 Jul – 30 Jun, is_active: true)
POST /classes atau langsung impor siswa (kelas dibuat otomatis)
GET /students/import/template → isi → POST /students/import (pratinjau) → POST /students/import/{id}/commit
POST /fee-types {name: "SPP", frequency: "bulanan", rates: [{amount: 150000}]}
POST /invoices/generate {fee_type_id, academic_year_id} → 12 tagihan per siswa
GET /students?q=nama → GET /students/{id}/invoices?status=terbuka → POST /payments → GET /payments/{id}/receipt
GET /reports/dashboard, /reports/income, /reports/arrears (tambahkan format=xlsx untuk Excel)
Wali: POST /wali/login → GET /wali/invoices → GET /wali/payments
Akun demo
Peran Login Kata sandi / PIN Endpoint login
Admin SMP Negeri 1 (Demo) [email protected] passwordPOST /auth/login
Admin SD IT Cahaya (Demo) [email protected] passwordPOST /auth/login
Wali murid school_slug smp-negeri-1-demo, nis 2024001 123456POST /wali/login
Wali murid sekolah 2 school_slug sd-it-cahaya-demo, nis 24001 123456POST /wali/login
Superadmin platform [email protected] passwordPOST /auth/login
Data demo dapat di-reset sewaktu-waktu. Untuk mencoba tanpa merusak data demo, daftarkan sekolah Anda sendiri lewat POST /auth/register.
Umum
Endpoint publik tanpa token.
GET / Info API & daftar endpoint
▶
Cocok untuk cek koneksi. Mengembalikan versi, URL dokumentasi, dan daftar endpoint.
Request
URL https://belajar-api.unama.ac.id/api/spp/
Header Accept: application/json
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/" \
-H "Accept: application/json" Salin
Contoh respons 200
{
"success": true,
"message": "Selamat datang di API SPP Sekolah",
"data": {
"name": "SPP Sekolah API",
"version": "1.0.0",
"base_url": "https://belajar-api.unama.ac.id/api/spp",
"documentation": "https://belajar-api.unama.ac.id/spp/docs",
"openapi": "https://belajar-api.unama.ac.id/api/spp/openapi",
"postman": "https://belajar-api.unama.ac.id/spp/docs/postman",
"auth": "Bearer token. Admin: POST /auth/login. Wali: POST /wali/login.",
"response_format": {
"success": "bool",
"message": "string",
"data": "mixed",
"meta": "object (paginasi)"
},
"endpoints": [
{
"group": "Umum",
"method": "GET",
"path": "/api/spp/",
"title": "Info API & daftar endpoint",
"auth": "none"
},
{
"group": "Umum",
"method": "GET",
"path": "/api/spp/openapi",
"title": "Spesifikasi OpenAPI 3 (JSON)",
"auth": "none"
},
"…"
]
}
}
GET /openapi Spesifikasi OpenAPI 3 (JSON)
▶
Impor ke Swagger UI, Insomnia, atau Postman. (Alias /openapi.json tersedia bila server meneruskan *.json ke aplikasi.)
Request
URL https://belajar-api.unama.ac.id/api/spp/openapi
Header Accept: application/json
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/openapi" \
-H "Accept: application/json" Salin
Respons File/HTML (bukan JSON).
GET /postman Koleksi Postman v2.1
▶
Sama dengan tombol unduh di halaman dokumentasi.
Request
URL https://belajar-api.unama.ac.id/api/spp/postman
Header Accept: application/json
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/postman" \
-H "Accept: application/json" Salin
Respons File/HTML (bukan JSON).
GET /schools/{slug} Info publik sekolah
▶
Nama, logo, dan cara bayar sekolah berdasarkan kode sekolah (slug). Berguna untuk layar login wali.
Request
URL https://belajar-api.unama.ac.id/api/spp/schools/{slug}
Header Accept: application/json
Parameter path
Nama Tipe Keterangan Contoh
slug wajib string Kode sekolah smp-negeri-1-demo
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/schools/smp-negeri-1-demo" \
-H "Accept: application/json" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 4,
"name": "SMP Negeri 1 (Demo)",
"slug": "smp-negeri-1-demo",
"npsn": "10500001",
"level": "SMP",
"address": "Jl. Kapten Pattimura No. 1, Kenali Besar",
"city": "Jambi",
"phone": "0741-123456",
"email": "[email protected] ",
"logo_url": "https://belajar-api.unama.ac.id/spp/logo/smp-negeri-1-demo?v=1794529086",
"payment_instructions": "1. Tunai di ruang Tata Usaha, Senin–Jumat pukul 07.30–14.00.\n2. Transfer ke salah satu rekening sekolah, lalu kirim foto bukti transfer ke WA bendahara 0812-3456-7890 dengan format: NAMA – KELAS – BULAN.\n3. SPP dibayar paling lambat tanggal 10 setiap bulan.",
"bank_accounts": "Bank Jambi 1234567890 a.n. SMP Negeri 1 Demo\nBRI 0021-01-000123-30-5 a.n. SMP Negeri 1 Demo"
}
}
Autentikasi Admin
Daftar sekolah baru atau login admin untuk mendapatkan token. Kirim token di setiap request sebagai header Authorization: Bearer {token}. Token berlaku 30 hari.
POST /auth/register Daftar sekolah + admin
▶
Membuat sekolah baru beserta akun admin pertamanya, lalu langsung mengembalikan token.
Request
URL https://belajar-api.unama.ac.id/api/spp/auth/register
Header Accept: application/json Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
school_name wajib string Nama sekolah SMP Harapan Bangsa
level string TK/SD/MI/SMP/MTs/SMA/MA/SMK/Lainnya SMP
npsn string NPSN 10501234
city string Kota Jambi
school_phone string Telepon sekolah 0741-123456
name wajib string Nama admin Rina Bendahara
email wajib string Email login (unik) [email protected]
phone string No HP admin 081234567890
password wajib string Min. 8 karakter rahasia123
password_confirmation wajib string Ulangi password rahasia123
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/auth/register" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"school_name":"SMP Harapan Bangsa","level":"SMP","npsn":"10501234","city":"Jambi","school_phone":"0741-123456","name":"Rina Bendahara","email":"[email protected] ","phone":"081234567890","password":"rahasia123","password_confirmation":"rahasia123"}' Salin
Contoh respons 201
{
"success": true,
"message": "Sekolah berhasil didaftarkan. Lanjutkan dengan membuat tahun ajaran, kelas, siswa, jenis biaya, lalu tagihan.",
"data": {
"user": {
"id": 14,
"name": "Admin API",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Bendahara",
"is_active": true,
"school_id": 9,
"last_login_at": null,
"created_at": "2026-11-13T06:21:02+07:00"
},
"school": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": null,
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": null,
"principal_name": null,
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "KW",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00"
},
"token": {
"access_token": "14|Xk3vN0pQ...contoh-token...9aZ",
"token_type": "Bearer",
"expires_at": "2026-12-13T06:21:02+07:00"
}
}
}
POST /auth/login Login admin
▶
Tukar email & kata sandi dengan token. Superadmin juga login di sini (tokennya hanya untuk /super/*).
Request
URL https://belajar-api.unama.ac.id/api/spp/auth/login
Header Accept: application/json Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
email wajib string Email [email protected]
password wajib string Kata sandi password
device_name string Nama perangkat postman
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/auth/login" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] ","password":"password","device_name":"postman"}' Salin
Contoh respons 200
{
"success": true,
"message": "Login berhasil",
"data": {
"user": {
"id": 14,
"name": "Admin API",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Bendahara",
"is_active": true,
"school_id": 9,
"last_login_at": "2026-11-13T06:21:03+07:00",
"created_at": "2026-11-13T06:21:02+07:00"
},
"school": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": null,
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": null,
"principal_name": null,
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "KW",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00"
},
"token": {
"access_token": "14|Xk3vN0pQ...contoh-token...9aZ",
"token_type": "Bearer",
"expires_at": "2026-12-13T06:21:03+07:00"
}
}
}
GET /auth/me Profil admin & sekolah
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/auth/me
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/auth/me" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"user": {
"id": 14,
"name": "Admin API",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Bendahara",
"is_active": true,
"school_id": 9,
"last_login_at": "2026-11-13T06:21:03+07:00",
"created_at": "2026-11-13T06:21:02+07:00"
},
"school": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": null,
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": null,
"principal_name": null,
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "KW",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00"
}
}
}
PUT /auth/me Ubah profil
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/auth/me
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
name string Nama Rina S.
phone string No HP 0812000000
position string Jabatan Bendahara
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/auth/me" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Rina S.","phone":"0812000000","position":"Bendahara"}' Salin
Contoh respons 200
{
"success": true,
"message": "Profil diperbarui",
"data": {
"id": 14,
"name": "Admin API",
"email": "[email protected] ",
"phone": "081200000000",
"role": "admin",
"position": "Bendahara",
"is_active": true,
"school_id": 9,
"last_login_at": "2026-11-13T06:21:03+07:00",
"created_at": "2026-11-13T06:21:02+07:00"
}
}
PUT /auth/password Ganti kata sandi
🔒 Token admin ▶
Token lain milik user dicabut otomatis.
Request
URL https://belajar-api.unama.ac.id/api/spp/auth/password
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
current_password wajib string Kata sandi saat ini password
password wajib string Kata sandi baru (min. 8) passwordbaru
password_confirmation wajib string Ulangi passwordbaru
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/auth/password" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"current_password":"password","password":"passwordbaru","password_confirmation":"passwordbaru"}' Salin
Contoh respons 200
{
"success": true,
"message": "Kata sandi diganti. Token di perangkat lain telah dicabut.",
"data": null
}
POST /auth/logout Logout (cabut token)
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/auth/logout
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/auth/logout" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Logout berhasil. Token tidak berlaku lagi.",
"data": null
}
Sekolah & Pengguna
Pengaturan profil sekolah (tampil di kuitansi & portal wali) dan pengelolaan user admin sekolah.
GET /school Profil sekolah + status wizard
🔒 Token admin ▶
setup berisi 5 langkah wizard awal dan status selesai/belum.
Request
URL https://belajar-api.unama.ac.id/api/spp/school
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/school" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": null,
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": null,
"principal_name": null,
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "KW",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00",
"setup": [
{
"key": "tahun",
"title": "Tahun ajaran",
"desc": "Tentukan tahun ajaran yang sedang berjalan.",
"done": false,
"icon": "calendar3"
},
{
"key": "kelas",
"title": "Kelas",
"desc": "Buat daftar kelas/rombel beserta tingkatnya.",
"done": false,
"icon": "diagram-3"
},
"…"
],
"wali_login_url": "https://belajar-api.unama.ac.id/spp/wali/masuk?sekolah=sma-api-test-7001"
}
}
PUT /school Ubah pengaturan sekolah
🔒 Token admin ▶
Kirim hanya field yang diubah. Untuk upload logo gunakan POST /school dengan multipart field logo.
Request
URL https://belajar-api.unama.ac.id/api/spp/school
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
name string Nama sekolah
address string Alamat Jl. Merdeka No. 1
principal_name string Kepala sekolah Drs. Ahmad
treasurer_name string Bendahara Rina
bank_accounts string Rekening Bank Jambi 123 a.n. Sekolah
payment_instructions string Instruksi bayar Bayar di TU
receipt_prefix string Awalan no kuitansi (huruf/angka) KW
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/school" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"address":"Jl. Merdeka No. 1","principal_name":"Drs. Ahmad","treasurer_name":"Rina","bank_accounts":"Bank Jambi 123 a.n. Sekolah","payment_instructions":"Bayar di TU","receipt_prefix":"KW"}' Salin
Contoh respons 200
{
"success": true,
"message": "Pengaturan sekolah disimpan",
"data": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": "Jl. Uji API No. 1",
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": "Bank Jambi 999",
"principal_name": "Dr. Kepala",
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "API",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00"
}
}
GET /users Daftar admin sekolah
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/users
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
q string Cari nama/email
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/users?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 14,
"name": "Admin API",
"email": "[email protected] ",
"phone": "081200000000",
"role": "admin",
"position": "Bendahara",
"is_active": true,
"school_id": 9,
"last_login_at": "2026-11-13T06:21:03+07:00",
"created_at": "2026-11-13T06:21:02+07:00"
},
{
"id": 15,
"name": "Operator Satu",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Operator",
"is_active": true,
"school_id": 9,
"last_login_at": null,
"created_at": "2026-11-13T06:21:03+07:00"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"from": 1,
"to": 2
}
}
POST /users Tambah admin
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/users
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
name wajib string Nama Operator TU
email wajib string Email unik [email protected]
password wajib string Min. 8 operator123
position string Jabatan Operator
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/users" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Operator TU","email":"[email protected] ","password":"operator123","position":"Operator"}' Salin
Contoh respons 201
{
"success": true,
"message": "Pengguna ditambahkan",
"data": {
"id": 15,
"name": "Operator Satu",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Operator",
"is_active": true,
"school_id": 9,
"last_login_at": null,
"created_at": "2026-11-13T06:21:03+07:00"
}
}
GET /users/{id} Detail admin
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/users/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID user 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/users/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 15,
"name": "Operator Satu",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Operator",
"is_active": true,
"school_id": 9,
"last_login_at": null,
"created_at": "2026-11-13T06:21:03+07:00"
}
}
PUT /users/{id} Ubah admin
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/users/{id}
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID user 1
Body
Nama Tipe Keterangan Contoh
name string Nama
password string Kata sandi baru
is_active boolean false = nonaktif (token dicabut) true
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/users/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"is_active":true}' Salin
Contoh respons 200
{
"success": true,
"message": "Pengguna diperbarui",
"data": {
"id": 15,
"name": "Operator Satu",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Operator TU",
"is_active": true,
"school_id": 9,
"last_login_at": null,
"created_at": "2026-11-13T06:21:03+07:00"
}
}
DELETE /users/{id} Hapus admin
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/users/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID user 1
Contoh curl
curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/users/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Pengguna dihapus",
"data": null
}
Tahun Ajaran
Hanya satu tahun ajaran yang aktif. Bulan tagihan SPP diambil dari rentang tanggal tahun ajaran.
GET /academic-years Daftar tahun ajaran
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/academic-years
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/academic-years?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 13,
"name": "2027/2028",
"start_date": "2027-07-01",
"end_date": "2028-06-30",
"is_active": false,
"periods": [
"2027-07",
"2027-08",
"…"
]
},
{
"id": 12,
"name": "2026/2027",
"start_date": "2026-07-01",
"end_date": "2027-06-30",
"is_active": true,
"periods": [
"2026-07",
"2026-08",
"…"
]
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"from": 1,
"to": 2
}
}
POST /academic-years Tambah tahun ajaran
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/academic-years
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
name wajib string Format YYYY/YYYY 2026/2027
start_date wajib date Tanggal mulai 2026-07-01
end_date wajib date Tanggal selesai 2027-06-30
is_active boolean Langsung aktifkan false
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/academic-years" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"2026/2027","start_date":"2026-07-01","end_date":"2027-06-30","is_active":false}' Salin
Contoh respons 201
{
"success": true,
"message": "Tahun ajaran ditambahkan",
"data": {
"id": 12,
"name": "2026/2027",
"start_date": "2026-07-01",
"end_date": "2027-06-30",
"is_active": true,
"periods": [
"2026-07",
"2026-08",
"…"
]
}
}
GET /academic-years/{id} Detail
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/academic-years/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID tahun ajaran 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/academic-years/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 12,
"name": "2026/2027",
"start_date": "2026-07-01",
"end_date": "2027-06-30",
"is_active": true,
"periods": [
"2026-07",
"2026-08",
"…"
]
}
}
PUT /academic-years/{id} Ubah
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/academic-years/{id}
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID tahun ajaran 1
Body
Nama Tipe Keterangan Contoh
end_date date Tanggal selesai 2027-06-30
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/academic-years/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"end_date":"2027-06-30"}' Salin
Contoh respons 200
{
"success": true,
"message": "Tahun ajaran diperbarui",
"data": {
"id": 13,
"name": "2027/2028",
"start_date": "2027-07-01",
"end_date": "2028-06-29",
"is_active": false,
"periods": [
"2027-07",
"2027-08",
"…"
]
}
}
POST /academic-years/{id}/activate Jadikan aktif
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/academic-years/{id}/activate
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID tahun ajaran 1
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/academic-years/1/activate" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Tahun ajaran 2027/2028 sekarang aktif",
"data": {
"id": 13,
"name": "2027/2028",
"start_date": "2027-07-01",
"end_date": "2028-06-29",
"is_active": true,
"periods": [
"2027-07",
"2027-08",
"…"
]
}
}
DELETE /academic-years/{id} Hapus (jika belum ada tagihan)
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/academic-years/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID tahun ajaran 1
Contoh curl
curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/academic-years/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Tahun ajaran dihapus",
"data": null
}
Kelas
Kelas/rombel beserta tingkat (grade, 1–13) yang dipakai untuk tarif per tingkat.
GET /classes Daftar kelas
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/classes
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
grade integer Filter tingkat
q string Cari nama
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/classes?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 48,
"name": "Kosong",
"grade": 1,
"homeroom_teacher": null,
"students_count": 0
},
{
"id": 45,
"name": "X-1",
"grade": 10,
"homeroom_teacher": "Bu Sari",
"students_count": 0
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 4,
"last_page": 1,
"from": 1,
"to": 4
}
}
POST /classes Tambah kelas
🔒 Token admin ▶
Jika grade tidak dikirim, tingkat ditebak dari nama (VII A → 7, X IPA → 10).
Request
URL https://belajar-api.unama.ac.id/api/spp/classes
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
name wajib string Nama kelas (unik) VII C
grade integer Tingkat 7
homeroom_teacher string Wali kelas Bu Sari
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/classes" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"VII C","grade":7,"homeroom_teacher":"Bu Sari"}' Salin
Contoh respons 201
{
"success": true,
"message": "Kelas ditambahkan",
"data": {
"id": 45,
"name": "X-1",
"grade": 10,
"homeroom_teacher": "Bu Sari",
"students_count": null
}
}
GET /classes/{id} Detail kelas
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/classes/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID kelas 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/classes/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 45,
"name": "X-1",
"grade": 10,
"homeroom_teacher": "Bu Sari",
"students_count": 0
}
}
PUT /classes/{id} Ubah kelas
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/classes/{id}
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID kelas 1
Body
Nama Tipe Keterangan Contoh
homeroom_teacher string Wali kelas Pak Budi
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/classes/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"homeroom_teacher":"Pak Budi"}' Salin
Contoh respons 200
{
"success": true,
"message": "Kelas diperbarui",
"data": {
"id": 45,
"name": "X-1",
"grade": 10,
"homeroom_teacher": "Pak Budi",
"students_count": null
}
}
DELETE /classes/{id} Hapus kelas kosong
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/classes/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID kelas 1
Contoh curl
curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/classes/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Kelas dihapus",
"data": null
}
POST /classes/promote Proses kenaikan kelas massal
🔒 Token admin ▶
Siswa aktif di kelas asal dipindah ke kelas tujuan, atau status menjadi lulus. Diproses serentak sehingga tidak ada siswa yang "naik dua kali".
Request
URL https://belajar-api.unama.ac.id/api/spp/classes/promote
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
map wajib object Pemetaan {id_asal: id_tujuan|"lulus"|"tetap"} {"1":3,"3":"lulus"}
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/classes/promote" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"map":{"1":3,"3":"lulus"}}' Salin
Contoh respons 200
{
"success": true,
"message": "Kenaikan kelas selesai",
"data": {
"moved": 2,
"graduated": 0,
"stayed": 0
}
}
Siswa & Import Excel
NIS unik per sekolah. Status: aktif, lulus, pindah, keluar. Import Excel 2 langkah: unggah → pratinjau (validasi per baris) → commit.
GET /students Daftar & cari siswa
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
q string Cari nama/NIS/NISN/nama wali ahmad
class_id integer Filter kelas
status string aktif (bawaan) / lulus / pindah / keluar / semua aktif
gender string L / P
with_outstanding boolean Sertakan total tunggakan per siswa true
sort string name (bawaan) / nis
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students?q=ahmad&status=aktif&with_outstanding=true&page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 392,
"nis": "2026112",
"nisn": "0112340444",
"name": "Aisyah Ramadhan",
"gender": "P",
"class": {
"id": 51,
"name": "VII A",
"grade": 7
},
"entry_year": 2026,
"guardian_name": "Ibu Mariani Ramadhan",
"guardian_phone": "081255501356",
"email": "[email protected] ",
"address": "Jl. Sultan Thaha No. 22, Jambi",
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:21:05+07:00",
"outstanding": 0
},
{
"id": 391,
"nis": "2026111",
"nisn": "0112340407",
"name": "Aldi Saputra",
"gender": "L",
"class": {
"id": 50,
"name": "VII C",
"grade": 7
},
"entry_year": 2026,
"guardian_name": "Ibu Sri Saputra",
"guardian_phone": "081255501243",
"email": null,
"address": "Jl. Hayam Wuruk No. 21, Jambi",
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:21:05+07:00",
"outstanding": 0
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 3,
"total": 31,
"last_page": 11,
"from": 1,
"to": 3
}
}
POST /students Tambah siswa
🔒 Token admin ▶
Respons berisi portal_pin untuk login wali (dibuat acak bila tidak dikirim).
Request
URL https://belajar-api.unama.ac.id/api/spp/students
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
nis wajib string NIS unik 2026999
name wajib string Nama Dewi Lestari
nisn string NISN (angka) 0101010101
gender string L/P P
class_id integer ID kelas 1
entry_year integer Angkatan 2026
guardian_name string Nama wali Ibu Lestari
guardian_phone string HP wali 081311112222
email string Email
address string Alamat Jambi
portal_pin string PIN portal wali (min 4)
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/students" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"nis":"2026999","name":"Dewi Lestari","nisn":"0101010101","gender":"P","class_id":1,"entry_year":2026,"guardian_name":"Ibu Lestari","guardian_phone":"081311112222","address":"Jambi"}' Salin
Contoh respons 201
{
"success": true,
"message": "Siswa ditambahkan",
"data": {
"id": 380,
"nis": "S700101",
"nisn": null,
"name": "Dewi Lestari",
"gender": "P",
"class": {
"id": 45,
"name": "X-1",
"grade": 10
},
"entry_year": 2026,
"guardian_name": "Ibu Lestari",
"guardian_phone": "081311112222",
"email": null,
"address": null,
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:21:05+07:00",
"portal_pin": "364832"
}
}
GET /students/{id} Detail siswa
🔒 Token admin ▶
Termasuk outstanding, PIN awal (jika wali belum mengganti), dan potongan.
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 380,
"nis": "S700101",
"nisn": null,
"name": "Dewi Lestari",
"gender": "P",
"class": {
"id": 45,
"name": "X-1",
"grade": 10
},
"entry_year": 2026,
"guardian_name": "Ibu Lestari",
"guardian_phone": "081311112222",
"email": null,
"address": null,
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:21:05+07:00",
"outstanding": 0,
"portal_pin": "364832",
"adjustments": []
}
}
PUT /students/{id} Ubah siswa
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Body
Nama Tipe Keterangan Contoh
class_id integer Pindah kelas 2
status string aktif/lulus/pindah/keluar aktif
guardian_phone string HP wali 081299998888
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/students/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"class_id":2,"status":"aktif","guardian_phone":"081299998888"}' Salin
Contoh respons 200
{
"success": true,
"message": "Data siswa diperbarui",
"data": {
"id": 380,
"nis": "S700101",
"nisn": null,
"name": "Dewi Lestari",
"gender": "P",
"class": {
"id": 45,
"name": "X-1",
"grade": 10
},
"entry_year": 2026,
"guardian_name": "Ibu Lestari",
"guardian_phone": "081299998888",
"email": null,
"address": null,
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:21:05+07:00"
}
}
DELETE /students/{id} Hapus siswa (tanpa riwayat bayar)
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Contoh curl
curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/students/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
POST /students/{id}/reset-pin Buat PIN portal wali baru
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}/reset-pin
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Body
Nama Tipe Keterangan Contoh
pin string PIN tertentu (kosong = acak 6 digit)
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/students/1/reset-pin" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '[]' Salin
Contoh respons 200
{
"success": true,
"message": "PIN baru dibuat",
"data": {
"student_id": 380,
"nis": "S700101",
"school_slug": "sma-api-test-7001",
"portal_pin": "654321"
}
}
GET /students/{id}/invoices Tagihan siswa
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}/invoices
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Query string
Nama Tipe Keterangan Contoh
status string terbuka / belum / sebagian / lunas / batal terbuka
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/1/invoices?status=terbuka&page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 4983,
"title": "SPP Juli 2026",
"fee_type": {
"id": 24,
"name": "SPP",
"frequency": "bulanan"
},
"academic_year_id": 12,
"period": "2026-07",
"amount": 200000,
"discount": 100000,
"total": 100000,
"paid_amount": 0,
"remaining": 100000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2026-07-10",
"is_overdue": true,
"note": "Beasiswa prestasi",
"cancel_reason": null,
"created_at": "2026-11-13T06:21:08+07:00"
},
{
"id": 4984,
"title": "SPP Agustus 2026",
"fee_type": {
"id": 24,
"name": "SPP",
"frequency": "bulanan"
},
"academic_year_id": 12,
"period": "2026-08",
"amount": 200000,
"discount": 100000,
"total": 100000,
"paid_amount": 0,
"remaining": 100000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2026-08-10",
"is_overdue": true,
"note": "Beasiswa prestasi",
"cancel_reason": null,
"created_at": "2026-11-13T06:21:08+07:00"
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 50,
"total": 14,
"last_page": 1,
"from": 1,
"to": 14,
"outstanding": 1525000
}
}
GET /students/{id}/payments Riwayat pembayaran siswa
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}/payments
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Query string
Nama Tipe Keterangan Contoh
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/1/payments?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 1221,
"receipt_no": "API-2026-00001",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "tunai",
"amount": 140000,
"reference": null,
"payer_name": "Ibu Lestari",
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4983,
"title": "SPP Juli 2026",
"amount": 100000
},
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 40000
}
]
},
{
"id": 1222,
"receipt_no": "API-2026-00002",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "transfer",
"amount": 160000,
"reference": "BRI 12/11",
"payer_name": null,
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 60000
},
{
"invoice_id": 4985,
"title": "SPP September 2026",
"amount": 100000
}
]
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"from": 1,
"to": 2
}
}
GET /students/{id}/card Kartu SPP (matriks bulan)
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/{id}/card
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID siswa 1
Query string
Nama Tipe Keterangan Contoh
academic_year_id integer Bawaan: tahun aktif
format string json (bawaan) / xlsx
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/1/card" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"student": {
"id": 380,
"nis": "S700101",
"nisn": null,
"name": "Dewi Lestari",
"gender": "P",
"class": {
"id": 45,
"name": "X-1",
"grade": 10
},
"entry_year": 2026,
"guardian_name": "Ibu Lestari",
"guardian_phone": "081299998888",
"email": null,
"address": null,
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:21:05+07:00"
},
"year": {
"id": 12,
"name": "2026/2027",
"start_date": "2026-07-01",
"end_date": "2027-06-30",
"is_active": true,
"periods": [
"2026-07",
"2026-08",
"…"
]
},
"periods": [
"2026-07",
"2026-08",
"…"
],
"period_labels": [
"Juli 2026",
"Agustus 2026",
"…"
],
"monthly": [
{
"fee_type": "SPP",
"months": {
"2026-07": {
"invoice_id": 4983,
"total": 100000,
"paid": 100000,
"status": "lunas",
"paid_at": "2026-11-13",
"receipt_no": "API-2026-00001"
},
"2026-08": {
"invoice_id": 4984,
"total": 100000,
"paid": 100000,
"status": "lunas",
"paid_at": "2026-11-13",
"receipt_no": "API-2026-00001"
},
"2026-09": {
"invoice_id": 4985,
"total": 100000,
"paid": 100000,
"status": "lunas",
"paid_at": "2026-11-13",
"receipt_no": "API-2026-00002"
},
"2026-10": {
"invoice_id": 4986,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2026-11": {
"invoice_id": 4987,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2026-12": {
"invoice_id": 4988,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2027-01": {
"invoice_id": 4989,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2027-02": {
"invoice_id": 4990,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2027-03": {
"invoice_id": 4991,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2027-04": {
"invoice_id": 4992,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2027-05": {
"invoice_id": 4993,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
},
"2027-06": {
"invoice_id": 4994,
"total": 100000,
"paid": 0,
"status": "belum",
"paid_at": null,
"receipt_no": null
}
}
}
],
"others": [
{
"invoice_id": 5355,
"title": "Uang Kegiatan 2026/2027",
"total": 300000,
"paid": 0,
"remaining": 300000,
"status": "belum",
"due_date": "2027-03-31"
}
],
"total": 1500000,
"paid": 300000,
"remaining": 1200000
}
}
GET /students/export Export siswa ke Excel
🔒 Token admin ▶
Mengembalikan file .xlsx (bukan JSON).
Request
URL https://belajar-api.unama.ac.id/api/spp/students/export
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
class_id integer Filter kelas
status string Filter status
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/export" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Respons File/HTML (bukan JSON).
GET /students/import/template Unduh template import
🔒 Token admin ▶
File .xlsx dengan kolom: nis, nisn, nama, jenis_kelamin (L/P), kelas, angkatan, nama_wali, no_hp_wali, email, alamat + sheet Petunjuk. Template juga tersedia publik di /spp/template-import-siswa.xlsx.
Request
URL https://belajar-api.unama.ac.id/api/spp/students/import/template
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/import/template" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Respons File/HTML (bukan JSON).
POST /students/import Import (langkah 1: pratinjau)
🔒 Token admin ▶
Unggah file .xlsx/.xls/.csv. Setiap baris divalidasi: action = baru | perbarui | lewati | error beserta errors & warnings. Data BELUM disimpan, kecuali commit=1.
Request
URL https://belajar-api.unama.ac.id/api/spp/students/import
Header Accept: application/json Authorization: Bearer {token} Content-Type: multipart/form-data
Body
Nama Tipe Keterangan Contoh
file wajib file File Excel/CSV maks 5 MB
mode string tambah (NIS ada → lewati) / perbarui (NIS ada → timpa) tambah
create_classes boolean Buat kelas otomatis bila belum ada (bawaan 1) 1
commit boolean 1 = langsung simpan tanpa pratinjau 0
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/students/import" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-F "[email protected] " \
-F "mode=tambah" \
-F "create_classes=1" \
-F "commit=0" Salin
Contoh respons 201
{
"success": true,
"message": "Pratinjau import siap. Periksa baris error, lalu panggil POST /students/import/7/commit untuk menyimpan.",
"data": {
"import_id": 7,
"filename": "contoh-import-siswa.xlsx",
"mode": "tambah",
"create_classes": true,
"status": "pratinjau",
"summary": {
"total": 30,
"baru": 30,
"perbarui": 0,
"lewati": 0,
"error": 0,
"kelas_baru": [
"VII B",
"VII C",
"…"
]
},
"result": null,
"commit_url": "https://belajar-api.unama.ac.id/api/spp/students/import/7/commit",
"rows": [
{
"row": 2,
"data": {
"nis": "2026101",
"nisn": "0112340037",
"nama": "Fajar Setiawan",
"jenis_kelamin": "L",
"kelas": "VII B",
"angkatan": "2026",
"nama_wali": "Bapak Hasan Setiawan",
"no_hp_wali": "081255500113",
"email": "",
"alamat": "Jl. Gatot Subroto No. 11, Jambi"
},
"action": "baru",
"errors": [],
"warnings": [
"Kelas \"VII B\" belum ada, akan dibuat otomatis"
]
},
{
"row": 3,
"data": {
"nis": "2026102",
"nisn": "0112340074",
"nama": "Zahra Hidayat",
"jenis_kelamin": "P",
"kelas": "VII C",
"angkatan": "2026",
"nama_wali": "Bapak Darmawan Hidayat",
"no_hp_wali": "081255500226",
"email": "",
"alamat": "Jl. Hayam Wuruk No. 12, Jambi"
},
"action": "baru",
"errors": [],
"warnings": [
"Kelas \"VII C\" belum ada, akan dibuat otomatis"
]
},
"…"
]
}
}
GET /students/import/{id} Lihat hasil pratinjau
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/students/import/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID import 1
Query string
Nama Tipe Keterangan Contoh
only string Filter baris: baru / perbarui / lewati / error error
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/import/1?only=error" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"import_id": 7,
"filename": "contoh-import-siswa.xlsx",
"mode": "tambah",
"create_classes": true,
"status": "pratinjau",
"summary": {
"baru": 30,
"error": 0,
"total": 30,
"lewati": 0,
"perbarui": 0,
"kelas_baru": [
"VII B",
"VII C",
"…"
]
},
"result": null,
"commit_url": "https://belajar-api.unama.ac.id/api/spp/students/import/7/commit",
"rows": [
{
"row": 2,
"data": {
"nis": "2026101",
"nisn": "0112340037",
"nama": "Fajar Setiawan",
"jenis_kelamin": "L",
"kelas": "VII B",
"angkatan": "2026",
"nama_wali": "Bapak Hasan Setiawan",
"no_hp_wali": "081255500113",
"email": "",
"alamat": "Jl. Gatot Subroto No. 11, Jambi"
},
"action": "baru",
"errors": [],
"warnings": [
"Kelas \"VII B\" belum ada, akan dibuat otomatis"
]
},
{
"row": 3,
"data": {
"nis": "2026102",
"nisn": "0112340074",
"nama": "Zahra Hidayat",
"jenis_kelamin": "P",
"kelas": "VII C",
"angkatan": "2026",
"nama_wali": "Bapak Darmawan Hidayat",
"no_hp_wali": "081255500226",
"email": "",
"alamat": "Jl. Hayam Wuruk No. 12, Jambi"
},
"action": "baru",
"errors": [],
"warnings": [
"Kelas \"VII C\" belum ada, akan dibuat otomatis"
]
},
"…"
]
}
}
POST /students/import/{id}/commit Import (langkah 2: simpan)
🔒 Token admin ▶
Menyimpan semua baris yang valid dalam satu transaksi. Baris error dilewati.
Request
URL https://belajar-api.unama.ac.id/api/spp/students/import/{id}/commit
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID import 1
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/students/import/1/commit" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Import disimpan: 30 baru, 0 diperbarui, 0 dilewati, 0 gagal",
"data": {
"import_id": 7,
"result": {
"created": 30,
"updated": 0,
"skipped": 0,
"failed": 0,
"new_classes": [
"VII B",
"VII C",
"…"
]
}
}
}
Jenis Biaya, Tarif & Potongan
frequency: bulanan (ditagih tiap bulan, mis. SPP) atau sekali (sekali per tahun ajaran, boleh dicicil). Tarif diatur per tahun ajaran: umum, per tingkat, atau per kelas. Prioritas: tarif khusus siswa → kelas → tingkat → umum, lalu potongan.
GET /fee-types Daftar jenis biaya + tarif
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
academic_year_id integer Tarif tahun ini (bawaan aktif)
frequency string bulanan / sekali
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/fee-types?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 26,
"name": "Hapus Saya",
"code": null,
"frequency": "sekali",
"description": null,
"is_active": true,
"rates": []
},
{
"id": 24,
"name": "SPP",
"code": "SPP",
"frequency": "bulanan",
"description": null,
"is_active": true,
"rates": [
{
"id": 26,
"academic_year_id": 12,
"grade": null,
"class_id": null,
"amount": 200000,
"applies_to": "all"
},
{
"id": 27,
"academic_year_id": 12,
"grade": 12,
"class_id": null,
"amount": 225000,
"applies_to": "grade"
}
]
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 3,
"last_page": 1,
"from": 1,
"to": 3,
"academic_year_id": 12
}
}
POST /fee-types Tambah jenis biaya
🔒 Token admin ▶
rates opsional, langsung mengatur tarif tahun ajaran aktif.
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
name wajib string Nama unik Uang Kegiatan
frequency wajib string bulanan / sekali sekali
code string Kode KEG
rates array Daftar tarif [{amount, grade?, class_id?}] [{"amount":300000},{"grade":9,"amount":450000}]
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/fee-types" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Uang Kegiatan","frequency":"sekali","code":"KEG","rates":[{"amount":300000},{"grade":9,"amount":450000}]}' Salin
Contoh respons 201
{
"success": true,
"message": "Jenis biaya ditambahkan",
"data": {
"id": 24,
"name": "SPP",
"code": "SPP",
"frequency": "bulanan",
"description": null,
"is_active": true,
"rates": [
{
"id": 26,
"academic_year_id": 12,
"grade": null,
"class_id": null,
"amount": 200000,
"applies_to": "all"
},
{
"id": 27,
"academic_year_id": 12,
"grade": 12,
"class_id": null,
"amount": 225000,
"applies_to": "grade"
}
]
}
}
GET /fee-types/{id} Detail jenis biaya
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID jenis biaya 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/fee-types/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 24,
"name": "SPP",
"code": "SPP",
"frequency": "bulanan",
"description": null,
"is_active": true,
"rates": [
{
"id": 26,
"academic_year_id": 12,
"grade": null,
"class_id": null,
"amount": 200000,
"applies_to": "all"
},
{
"id": 27,
"academic_year_id": 12,
"grade": 12,
"class_id": null,
"amount": 225000,
"applies_to": "grade"
}
]
}
}
PUT /fee-types/{id} Ubah jenis biaya
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types/{id}
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID jenis biaya 1
Body
Nama Tipe Keterangan Contoh
is_active boolean false = tidak bisa ditagihkan true
description string Keterangan
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/fee-types/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"is_active":true}' Salin
Contoh respons 200
{
"success": true,
"message": "Jenis biaya diperbarui",
"data": {
"id": 25,
"name": "Uang Kegiatan",
"code": null,
"frequency": "sekali",
"description": "Kegiatan OSIS",
"is_active": true,
"rates": [
{
"id": 28,
"academic_year_id": 12,
"grade": null,
"class_id": null,
"amount": 300000,
"applies_to": "all"
},
{
"id": 29,
"academic_year_id": 12,
"grade": null,
"class_id": 47,
"amount": 500000,
"applies_to": "class"
}
]
}
}
DELETE /fee-types/{id} Hapus (jika belum ada tagihan)
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID jenis biaya 1
Contoh curl
curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/fee-types/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Jenis biaya dihapus",
"data": null
}
GET /fee-types/{id}/rates Lihat tarif
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types/{id}/rates
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID jenis biaya 1
Query string
Nama Tipe Keterangan Contoh
academic_year_id integer Bawaan aktif
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/fee-types/1/rates" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"fee_type": {
"id": 25,
"name": "Uang Kegiatan",
"code": null,
"frequency": "sekali",
"description": null,
"is_active": true
},
"academic_year_id": 12,
"rates": [
{
"id": 28,
"academic_year_id": 12,
"grade": null,
"class_id": null,
"amount": 300000,
"applies_to": "all",
"label": "Semua tingkat"
},
{
"id": 29,
"academic_year_id": 12,
"grade": null,
"class_id": 47,
"amount": 500000,
"applies_to": "class",
"label": "Kelas XII-1"
}
]
}
}
PUT /fee-types/{id}/rates Ganti seluruh tarif satu tahun ajaran
🔒 Token admin ▶
Tarif lama tahun ajaran tsb dihapus lalu diganti isi rates. Item tanpa grade & class_id = tarif umum.
Request
URL https://belajar-api.unama.ac.id/api/spp/fee-types/{id}/rates
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID jenis biaya 1
Body
Nama Tipe Keterangan Contoh
academic_year_id wajib integer ID tahun ajaran 1
rates wajib array Daftar tarif [{"amount":150000},{"grade":9,"amount":175000}]
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/fee-types/1/rates" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"academic_year_id":1,"rates":[{"amount":150000},{"grade":9,"amount":175000}]}' Salin
Contoh respons 200
{
"success": true,
"message": "Tarif disimpan",
"data": {
"fee_type_id": 25,
"academic_year_id": 12,
"saved": 2,
"rates": [
{
"id": 28,
"academic_year_id": 12,
"grade": null,
"class_id": null,
"amount": 300000,
"applies_to": "all"
},
{
"id": 29,
"academic_year_id": 12,
"grade": null,
"class_id": 47,
"amount": 500000,
"applies_to": "class"
}
]
}
}
GET /adjustments Daftar potongan/beasiswa
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/adjustments
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
student_id integer Filter siswa
fee_type_id integer Filter biaya
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/adjustments?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 20,
"student_id": 380,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari"
},
"fee_type_id": 24,
"fee_type": "SPP",
"academic_year_id": null,
"custom_amount": null,
"discount_type": "persen",
"discount_value": 50,
"note": "Beasiswa prestasi",
"summary": "Potongan 50%"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 1,
"last_page": 1,
"from": 1,
"to": 1
}
}
POST /adjustments Simpan potongan / tarif khusus siswa
🔒 Token admin ▶
Isi discount_type+discount_value (potongan) dan/atau custom_amount (tarif khusus). Berlaku untuk tagihan yang dibuat setelahnya; jalankan generate dengan update_unpaid=true untuk memperbarui tagihan yang belum dibayar.
Request
URL https://belajar-api.unama.ac.id/api/spp/adjustments
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
student_id wajib integer ID siswa 1
fee_type_id wajib integer ID jenis biaya 1
academic_year_id integer Kosong = semua tahun
discount_type string nominal / persen persen
discount_value integer Nilai potongan 50
custom_amount integer Tarif khusus (Rp)
note string Keterangan Beasiswa prestasi
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/adjustments" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"student_id":1,"fee_type_id":1,"discount_type":"persen","discount_value":50,"note":"Beasiswa prestasi"}' Salin
Contoh respons 201
{
"success": true,
"message": "Potongan/tarif khusus disimpan. Berlaku untuk tagihan berikutnya (atau generate ulang dengan update_unpaid=true).",
"data": {
"id": 20,
"student_id": 380,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari"
},
"fee_type_id": 24,
"fee_type": "SPP",
"academic_year_id": null,
"custom_amount": null,
"discount_type": "persen",
"discount_value": 50,
"note": "Beasiswa prestasi",
"summary": "Potongan 50%"
}
}
DELETE /adjustments/{id} Hapus potongan
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/adjustments/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID potongan 1
Contoh curl
curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/adjustments/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Potongan dihapus",
"data": null
}
Tagihan
Status tagihan: belum, sebagian (dicicil), lunas, batal. Generate massal bersifat idempotent — memanggil ulang tidak membuat tagihan dobel.
GET /invoices Daftar tagihan
🔒 Token admin ▶
meta berisi sum_total, sum_paid, sum_remaining sesuai filter.
Request
URL https://belajar-api.unama.ac.id/api/spp/invoices
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
q string Cari nama/NIS
status string terbuka / belum / sebagian / lunas / batal terbuka
student_id integer Filter siswa
class_id integer Filter kelas
fee_type_id integer Filter biaya
academic_year_id integer Filter TA
period string YYYY-MM
overdue boolean 1 = hanya lewat jatuh tempo
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/invoices?status=terbuka&page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 5386,
"title": "Denda buku perpustakaan",
"fee_type": {
"id": 25,
"name": "Uang Kegiatan",
"frequency": "sekali"
},
"academic_year_id": 12,
"period": null,
"amount": 25000,
"discount": 0,
"total": 25000,
"paid_amount": 0,
"remaining": 25000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2026-12-31",
"is_overdue": false,
"note": null,
"cancel_reason": null,
"created_at": "2026-11-13T06:21:08+07:00",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
}
},
{
"id": 5355,
"title": "Uang Kegiatan 2026/2027",
"fee_type": {
"id": 25,
"name": "Uang Kegiatan",
"frequency": "sekali"
},
"academic_year_id": 12,
"period": null,
"amount": 300000,
"discount": 0,
"total": 300000,
"paid_amount": 0,
"remaining": 300000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2027-03-31",
"is_overdue": false,
"note": null,
"cancel_reason": null,
"created_at": "2026-11-13T06:21:08+07:00",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
}
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 3,
"total": 14,
"last_page": 5,
"from": 1,
"to": 3,
"sum_total": 1525000,
"sum_paid": 0,
"sum_remaining": 1525000
}
}
POST /invoices/generate Generate tagihan massal
🔒 Token admin ▶
Membuat tagihan untuk semua siswa aktif (atau kelas/siswa tertentu). Untuk biaya bulanan dibuat satu tagihan per bulan dalam periods (bawaan: semua bulan tahun ajaran).
Request
URL https://belajar-api.unama.ac.id/api/spp/invoices/generate
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
fee_type_id wajib integer ID jenis biaya 1
academic_year_id wajib integer ID tahun ajaran 1
class_ids array ID kelas (kosong = semua) [1,2]
student_ids array ID siswa tertentu
periods array Bulan YYYY-MM (khusus bulanan) ["2026-07","2026-08"]
due_day integer Tgl jatuh tempo bulanan (1-28, bawaan 10) 10
due_date date Jatuh tempo biaya sekali bayar 2027-05-31
update_unpaid boolean Perbarui nominal tagihan yang belum dibayar sama sekali false
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/invoices/generate" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"fee_type_id":1,"academic_year_id":1,"class_ids":[1,2],"periods":["2026-07","2026-08"],"due_day":10,"due_date":"2027-05-31","update_unpaid":false}' Salin
Contoh respons 201
{
"success": true,
"message": "372 tagihan dibuat, 0 dilewati (sudah ada), 0 diperbarui",
"data": {
"created": 372,
"skipped": 0,
"updated": 0,
"students": 31,
"total_amount": 73200000,
"classes_without_rate": []
}
}
POST /invoices Tagihan manual satu siswa
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/invoices
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
student_id wajib integer ID siswa 1
fee_type_id wajib integer ID jenis biaya 2
title string Judul Denda keterlambatan buku
amount wajib integer Nominal 25000
discount integer Potongan 0
due_date date Jatuh tempo 2026-12-31
note string Catatan
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/invoices" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"student_id":1,"fee_type_id":2,"title":"Denda keterlambatan buku","amount":25000,"discount":0,"due_date":"2026-12-31"}' Salin
Contoh respons 201
{
"success": true,
"message": "Tagihan dibuat",
"data": {
"id": 5386,
"title": "Denda buku perpustakaan",
"fee_type": {
"id": 25,
"name": "Uang Kegiatan",
"frequency": "sekali"
},
"academic_year_id": 12,
"period": null,
"amount": 25000,
"discount": 0,
"total": 25000,
"paid_amount": 0,
"remaining": 25000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2026-12-31",
"is_overdue": false,
"note": null,
"cancel_reason": null,
"created_at": "2026-11-13T06:21:08+07:00",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
}
}
}
GET /invoices/{id} Detail tagihan + pembayarannya
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/invoices/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID tagihan 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/invoices/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 4983,
"title": "SPP Juli 2026",
"fee_type": {
"id": 24,
"name": "SPP",
"frequency": "bulanan"
},
"academic_year_id": 12,
"period": "2026-07",
"amount": 200000,
"discount": 100000,
"total": 100000,
"paid_amount": 0,
"remaining": 100000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2026-07-10",
"is_overdue": true,
"note": "Beasiswa prestasi",
"cancel_reason": null,
"created_at": "2026-11-13T06:21:08+07:00",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"payments": []
}
}
POST /invoices/{id}/cancel Batalkan tagihan
🔒 Token admin ▶
Hanya untuk tagihan yang belum ada pembayaran.
Request
URL https://belajar-api.unama.ac.id/api/spp/invoices/{id}/cancel
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID tagihan 1
Body
Nama Tipe Keterangan Contoh
reason wajib string Alasan (min 3) Siswa mendapat pembebasan
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/invoices/1/cancel" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason":"Siswa mendapat pembebasan"}' Salin
Contoh respons 200
{
"success": true,
"message": "Tagihan dibatalkan",
"data": {
"id": 5386,
"title": "Denda buku perpustakaan",
"fee_type": {
"id": 25,
"name": "Uang Kegiatan",
"frequency": "sekali"
},
"academic_year_id": 12,
"period": null,
"amount": 25000,
"discount": 0,
"total": 25000,
"paid_amount": 0,
"remaining": 0,
"status": "batal",
"status_label": "Dibatalkan",
"due_date": "2026-12-31",
"is_overdue": false,
"note": null,
"cancel_reason": "Buku sudah dikembalikan",
"created_at": "2026-11-13T06:21:08+07:00",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
}
}
}
Pembayaran & Kuitansi
Satu pembayaran bisa melunasi beberapa tagihan sekaligus; nominal per tagihan boleh lebih kecil dari sisa (cicilan). Nomor kuitansi otomatis per sekolah per tahun: {PREFIX}-{TAHUN}-{00001}. Semua diproses dalam transaksi database.
GET /payments Riwayat pembayaran
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/payments
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
q string No kuitansi / nama / NIS
from date Dari tanggal
to date Sampai tanggal
method string tunai / transfer
status string sah / batal
student_id integer Filter siswa
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/payments?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 1222,
"receipt_no": "API-2026-00002",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "transfer",
"amount": 160000,
"reference": "BRI 12/11",
"payer_name": null,
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 60000
},
{
"invoice_id": 4985,
"title": "SPP September 2026",
"amount": 100000
}
]
},
{
"id": 1221,
"receipt_no": "API-2026-00001",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "tunai",
"amount": 140000,
"reference": null,
"payer_name": "Ibu Lestari",
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4983,
"title": "SPP Juli 2026",
"amount": 100000
},
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 40000
}
]
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"from": 1,
"to": 2,
"sum_amount": 300000
}
}
POST /payments Terima pembayaran
🔒 Token admin ▶
Kosongkan amount pada item untuk melunasi sisa tagihan. Error 422 jika nominal melebihi sisa atau tagihan bukan milik siswa.
Request
URL https://belajar-api.unama.ac.id/api/spp/payments
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
student_id wajib integer ID siswa 1
method wajib string tunai / transfer tunai
items wajib array Tagihan yang dibayar [{invoice_id, amount?}] [{"invoice_id":1},{"invoice_id":2,"amount":50000}]
paid_at date Tanggal bayar (bawaan sekarang)
reference string No ref transfer
payer_name string Nama penyetor Bapak Budi
note string Catatan
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/payments" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"student_id":1,"method":"tunai","items":[{"invoice_id":1},{"invoice_id":2,"amount":50000}],"payer_name":"Bapak Budi"}' Salin
Contoh respons 201
{
"success": true,
"message": "Pembayaran disimpan. No. kuitansi API-2026-00001",
"data": {
"id": 1221,
"receipt_no": "API-2026-00001",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "tunai",
"amount": 140000,
"reference": null,
"payer_name": "Ibu Lestari",
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4983,
"title": "SPP Juli 2026",
"amount": 100000
},
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 40000
}
],
"amount_in_words": "seratus empat puluh ribu rupiah",
"receipt_html_url": "https://belajar-api.unama.ac.id/api/spp/payments/1221/receipt"
}
}
GET /payments/{id} Detail pembayaran
🔒 Token admin ▶
Termasuk amount_in_words (terbilang).
Request
URL https://belajar-api.unama.ac.id/api/spp/payments/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID pembayaran 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/payments/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 1221,
"receipt_no": "API-2026-00001",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "tunai",
"amount": 140000,
"reference": null,
"payer_name": "Ibu Lestari",
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4983,
"title": "SPP Juli 2026",
"amount": 100000
},
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 40000
}
],
"amount_in_words": "seratus empat puluh ribu rupiah",
"receipt_html_url": "https://belajar-api.unama.ac.id/api/spp/payments/1221/receipt"
}
}
GET /payments/{id}/receipt Kuitansi HTML siap cetak
🔒 Token admin ▶
Mengembalikan halaman HTML (bukan JSON) yang bisa langsung dicetak / dijadikan PDF.
Request
URL https://belajar-api.unama.ac.id/api/spp/payments/{id}/receipt
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID pembayaran 1
Query string
Nama Tipe Keterangan Contoh
format string a5 (bawaan) / thermal a5
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/payments/1/receipt?format=a5" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Respons File/HTML (bukan JSON).
POST /payments/{id}/cancel Batalkan pembayaran
🔒 Token admin ▶
Tagihan terkait dikembalikan (paid_amount dikurangi). Tercatat di log aktivitas.
Request
URL https://belajar-api.unama.ac.id/api/spp/payments/{id}/cancel
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID pembayaran 1
Body
Nama Tipe Keterangan Contoh
reason wajib string Alasan (min 3) Salah input nominal
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/payments/1/cancel" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason":"Salah input nominal"}' Salin
Contoh respons 200
{
"success": true,
"message": "Pembayaran dibatalkan, tagihan terkait dikembalikan",
"data": {
"id": 1222,
"receipt_no": "API-2026-00002",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "transfer",
"amount": 160000,
"reference": "BRI 12/11",
"payer_name": null,
"note": null,
"received_by": "Admin API",
"status": "batal",
"cancelled_at": "2026-11-13T06:21:09+07:00",
"cancel_reason": "Salah input metode",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
},
"items": [
{
"invoice_id": 4984,
"title": "SPP Agustus 2026",
"amount": 60000
},
{
"invoice_id": 4985,
"title": "SPP September 2026",
"amount": 100000
}
],
"amount_in_words": "seratus enam puluh ribu rupiah",
"receipt_html_url": "https://belajar-api.unama.ac.id/api/spp/payments/1222/receipt"
}
}
Laporan
Semua laporan mendukung format=xlsx untuk mengunduh Excel.
GET /reports/dashboard Ringkasan dasbor
🔒 Token admin ▶
Penerimaan hari ini/bulan ini/TA, total tunggakan, grafik 12 bulan, % lunas per kelas, 8 pembayaran terakhir.
Request
URL https://belajar-api.unama.ac.id/api/spp/reports/dashboard
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/reports/dashboard" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"today_income": 140000,
"today_count": 1,
"month_income": 140000,
"year_income": 140000,
"outstanding_total": 82360000,
"outstanding_invoices": 402,
"overdue_total": 30360000,
"overdue_students": 31,
"active_students": 31,
"academic_year": "2026/2027",
"monthly": [
{
"period": "2025-12",
"label": "Desember 2025",
"amount": 0
},
{
"period": "2026-01",
"label": "Januari 2026",
"amount": 0
},
"…"
],
"class_progress": [
{
"class_id": 51,
"class": "VII A",
"total": 10000000,
"paid": 0,
"outstanding": 10000000,
"invoices": 50,
"paid_invoices": 0,
"percent": 0
},
{
"class_id": 49,
"class": "VII B",
"total": 9000000,
"paid": 0,
"outstanding": 9000000,
"invoices": 45,
"paid_invoices": 0,
"percent": 0
},
"…"
],
"recent_payments": [
{
"id": 1222,
"receipt_no": "API-2026-00002",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "transfer",
"amount": 160000,
"reference": "BRI 12/11",
"payer_name": null,
"note": null,
"received_by": "Admin API",
"status": "batal",
"cancelled_at": "2026-11-13T06:21:09+07:00",
"cancel_reason": "Salah input metode",
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
}
},
{
"id": 1221,
"receipt_no": "API-2026-00001",
"paid_at": "2026-11-13T06:21:09+07:00",
"method": "tunai",
"amount": 140000,
"reference": null,
"payer_name": "Ibu Lestari",
"note": null,
"received_by": "Admin API",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 380,
"nis": "S700101",
"name": "Dewi Lestari",
"class": "X-1"
}
}
]
}
}
GET /reports/income Laporan penerimaan
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/reports/income
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
from date Bawaan awal bulan
to date Bawaan hari ini
fee_type_id integer Filter biaya
class_id integer Filter kelas
method string tunai / transfer
format string json / xlsx
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/reports/income" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"from": "2026-11-01",
"to": "2026-11-13",
"total": 140000,
"transactions": 1,
"by_fee_type": [
{
"label": "SPP",
"count": 2,
"amount": 140000
}
],
"by_method": [
{
"label": "tunai",
"count": 2,
"amount": 140000
}
],
"by_class": [
{
"label": "X-1",
"count": 2,
"amount": 140000
}
],
"by_day": [
{
"label": "2026-11-13",
"count": 2,
"amount": 140000
}
],
"rows": [
{
"paid_at": "2026-11-13 06:21",
"receipt_no": "API-2026-00001",
"payment_id": 1221,
"nis": "S700101",
"student": "Dewi Lestari",
"class": "X-1",
"fee_type": "SPP",
"title": "SPP Juli 2026",
"method": "tunai",
"received_by": "Admin API",
"amount": 100000
},
{
"paid_at": "2026-11-13 06:21",
"receipt_no": "API-2026-00001",
"payment_id": 1221,
"nis": "S700101",
"student": "Dewi Lestari",
"class": "X-1",
"fee_type": "SPP",
"title": "SPP Agustus 2026",
"method": "tunai",
"received_by": "Admin API",
"amount": 40000
}
]
}
}
GET /reports/arrears Rekap tunggakan per siswa & kelas
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/reports/arrears
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
until date Jatuh tempo s.d. (bawaan hari ini)
class_id integer Filter kelas
fee_type_id integer Filter biaya
academic_year_id integer Filter TA
format string json / xlsx
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/reports/arrears" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"until": "2027-06-30",
"total": 82360000,
"students_count": 31,
"by_class": [
{
"class": "VII A",
"students": 10,
"invoices": 130,
"amount": 27000000
},
{
"class": "VII B",
"students": 9,
"invoices": 117,
"amount": 24300000
},
"…"
],
"students": [
{
"student_id": 392,
"nis": "2026112",
"name": "Aisyah Ramadhan",
"class": "VII A",
"guardian_name": "Ibu Mariani Ramadhan",
"guardian_phone": "081255501356",
"invoices": 13,
"items": [
"SPP Juli 2026",
"SPP Agustus 2026",
"…"
],
"amount": 2700000,
"oldest_due": "2026-07-10"
},
{
"student_id": 410,
"nis": "2026130",
"name": "Anisa Maharani",
"class": "VII A",
"guardian_name": "Bapak Darmawan Maharani",
"guardian_phone": "081255503390",
"invoices": 13,
"items": [
"SPP Juli 2026",
"SPP Agustus 2026",
"…"
],
"amount": 2700000,
"oldest_due": "2026-07-10"
},
"…"
]
}
}
GET /reports/class-progress % lunas per kelas
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/reports/class-progress
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
academic_year_id integer Bawaan aktif
all boolean 1 = termasuk yang belum jatuh tempo
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/reports/class-progress" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"class_id": 51,
"class": "VII A",
"total": 27000000,
"paid": 0,
"outstanding": 27000000,
"invoices": 130,
"paid_invoices": 0,
"percent": 0
},
{
"class_id": 49,
"class": "VII B",
"total": 24300000,
"paid": 0,
"outstanding": 24300000,
"invoices": 117,
"paid_invoices": 0,
"percent": 0
},
"…"
]
}
GET /activity-logs Log aktivitas
🔒 Token admin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/activity-logs
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
action string Awalan aksi, mis. pembayaran
q string Cari keterangan
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/activity-logs?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 1303,
"action": "pembayaran.batal",
"description": "Batalkan pembayaran API-2026-00002 Rp 160.000. Alasan: Salah input metode",
"actor": "Admin API",
"actor_type": "admin",
"subject_type": "Payment",
"subject_id": 1222,
"properties": {
"reason": "Salah input metode"
},
"channel": "api",
"ip": "192.168.36.201",
"created_at": "2026-11-13T06:21:09+07:00"
},
{
"id": 1302,
"action": "pembayaran.terima",
"description": "Terima pembayaran API-2026-00002 Rp 160.000 dari Dewi Lestari (S700101)",
"actor": "Admin API",
"actor_type": "admin",
"subject_type": "Payment",
"subject_id": 1222,
"properties": {
"amount": 160000,
"method": "transfer",
"invoices": [
4984,
4985
]
},
"channel": "api",
"ip": "192.168.36.201",
"created_at": "2026-11-13T06:21:09+07:00"
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 3,
"total": 26,
"last_page": 9,
"from": 1,
"to": 3
}
}
Portal Wali Murid
Wali login dengan kode sekolah + NIS + PIN dari sekolah. Token wali hanya bisa membaca data siswa itu sendiri.
POST /wali/login Login wali
▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/login
Header Accept: application/json Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
school_slug wajib string Kode sekolah smp-negeri-1-demo
nis wajib string NIS 2024001
password wajib string PIN / kata sandi 123456
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/wali/login" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"school_slug":"smp-negeri-1-demo","nis":"2024001","password":"123456"}' Salin
Contoh respons 200
{
"success": true,
"message": "Login wali berhasil",
"data": {
"student": {
"id": 181,
"nis": "2024001",
"nisn": "0064058227",
"name": "Ahmad Fauzi",
"gender": "L",
"class": {
"id": 19,
"name": "VII A",
"grade": 7
},
"entry_year": 2026,
"guardian_name": "Bapak Budi Santoso",
"guardian_phone": "081234567890",
"email": null,
"address": "Jl. Kenali Asam No. 111, Jambi",
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:16:37+07:00"
},
"school": {
"id": 4,
"name": "SMP Negeri 1 (Demo)",
"slug": "smp-negeri-1-demo",
"npsn": "10500001",
"level": "SMP",
"address": "Jl. Kapten Pattimura No. 1, Kenali Besar",
"city": "Jambi",
"phone": "0741-123456",
"email": "[email protected] ",
"logo_url": "https://belajar-api.unama.ac.id/spp/logo/smp-negeri-1-demo?v=1794529086",
"payment_instructions": "1. Tunai di ruang Tata Usaha, Senin–Jumat pukul 07.30–14.00.\n2. Transfer ke salah satu rekening sekolah, lalu kirim foto bukti transfer ke WA bendahara 0812-3456-7890 dengan format: NAMA – KELAS – BULAN.\n3. SPP dibayar paling lambat tanggal 10 setiap bulan.",
"bank_accounts": "Bank Jambi 1234567890 a.n. SMP Negeri 1 Demo\nBRI 0021-01-000123-30-5 a.n. SMP Negeri 1 Demo"
},
"must_change_password": true,
"token": {
"access_token": "14|Xk3vN0pQ...contoh-token...9aZ",
"token_type": "Bearer",
"expires_at": "2026-12-13T06:21:11+07:00"
}
}
}
GET /wali/me Data siswa & total tagihan
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/me
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/wali/me" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"student": {
"id": 181,
"nis": "2024001",
"nisn": "0064058227",
"name": "Ahmad Fauzi",
"gender": "L",
"class": {
"id": 19,
"name": "VII A",
"grade": 7
},
"entry_year": 2026,
"guardian_name": "Bapak Budi Santoso",
"guardian_phone": "081234567890",
"email": null,
"address": "Jl. Kenali Asam No. 111, Jambi",
"status": "aktif",
"has_portal_access": true,
"pin_changed_by_guardian": false,
"created_at": "2026-11-13T06:16:37+07:00"
},
"school": {
"id": 4,
"name": "SMP Negeri 1 (Demo)",
"slug": "smp-negeri-1-demo",
"npsn": "10500001",
"level": "SMP",
"address": "Jl. Kapten Pattimura No. 1, Kenali Besar",
"city": "Jambi",
"phone": "0741-123456",
"email": "[email protected] ",
"logo_url": "https://belajar-api.unama.ac.id/spp/logo/smp-negeri-1-demo?v=1794529086",
"payment_instructions": "1. Tunai di ruang Tata Usaha, Senin–Jumat pukul 07.30–14.00.\n2. Transfer ke salah satu rekening sekolah, lalu kirim foto bukti transfer ke WA bendahara 0812-3456-7890 dengan format: NAMA – KELAS – BULAN.\n3. SPP dibayar paling lambat tanggal 10 setiap bulan.",
"bank_accounts": "Bank Jambi 1234567890 a.n. SMP Negeri 1 Demo\nBRI 0021-01-000123-30-5 a.n. SMP Negeri 1 Demo"
},
"outstanding": 1050000
}
}
GET /wali/invoices Tagihan siswa
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/invoices
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
status string terbuka / lunas
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/wali/invoices?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 2580,
"title": "SPP Desember 2026",
"fee_type": {
"id": 12,
"name": "SPP",
"frequency": "bulanan"
},
"academic_year_id": 7,
"period": "2026-12",
"amount": 150000,
"discount": 0,
"total": 150000,
"paid_amount": 0,
"remaining": 150000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2026-12-10",
"is_overdue": false,
"note": null,
"cancel_reason": null,
"created_at": "2026-11-13T06:16:37+07:00"
},
{
"id": 2581,
"title": "SPP Januari 2027",
"fee_type": {
"id": 12,
"name": "SPP",
"frequency": "bulanan"
},
"academic_year_id": 7,
"period": "2027-01",
"amount": 150000,
"discount": 0,
"total": 150000,
"paid_amount": 0,
"remaining": 150000,
"status": "belum",
"status_label": "Belum bayar",
"due_date": "2027-01-10",
"is_overdue": false,
"note": null,
"cancel_reason": null,
"created_at": "2026-11-13T06:16:37+07:00"
},
"…"
],
"meta": {
"current_page": 1,
"per_page": 3,
"total": 7,
"last_page": 3,
"from": 1,
"to": 3,
"outstanding": 1050000
}
}
GET /wali/payments Riwayat pembayaran
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/payments
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/wali/payments?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 635,
"receipt_no": "KW-2026-00003",
"paid_at": "2026-11-13T03:02:39+07:00",
"method": "tunai",
"amount": 150000,
"reference": null,
"payer_name": "Ibu Mariani Syahputra",
"note": null,
"received_by": "Joko Operator",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 181,
"nis": "2024001",
"name": "Ahmad Fauzi",
"class": "VII A"
},
"items": [
{
"invoice_id": 2579,
"title": "SPP November 2026",
"amount": 150000
}
]
},
{
"id": 636,
"receipt_no": "KW-2026-00004",
"paid_at": "2026-09-29T09:33:00+07:00",
"method": "transfer",
"amount": 450000,
"reference": "TRF-921165",
"payer_name": "Ibu Mariani Syahputra",
"note": null,
"received_by": "Joko Operator",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 181,
"nis": "2024001",
"name": "Ahmad Fauzi",
"class": "VII A"
},
"items": [
{
"invoice_id": 3511,
"title": "Seragam 2026/2027",
"amount": 450000
}
]
}
],
"meta": {
"current_page": 1,
"per_page": 2,
"total": 5,
"last_page": 3,
"from": 1,
"to": 2
}
}
GET /wali/payments/{id} Detail kuitansi
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/payments/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID pembayaran 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/wali/payments/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 635,
"receipt_no": "KW-2026-00003",
"paid_at": "2026-11-13T03:02:39+07:00",
"method": "tunai",
"amount": 150000,
"reference": null,
"payer_name": "Ibu Mariani Syahputra",
"note": null,
"received_by": "Joko Operator",
"status": "sah",
"cancelled_at": null,
"cancel_reason": null,
"student": {
"id": 181,
"nis": "2024001",
"name": "Ahmad Fauzi",
"class": "VII A"
},
"items": [
{
"invoice_id": 2579,
"title": "SPP November 2026",
"amount": 150000
}
],
"amount_in_words": "seratus lima puluh ribu rupiah",
"receipt_html_url": "https://belajar-api.unama.ac.id/api/spp/wali/payments/635/receipt"
}
}
GET /wali/payments/{id}/receipt Kuitansi HTML
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/payments/{id}/receipt
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID pembayaran 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/wali/payments/1/receipt" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Respons File/HTML (bukan JSON).
GET /wali/payment-info Cara bayar sekolah
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/payment-info
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/wali/payment-info" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"school": "SMP Negeri 1 (Demo)",
"bank_accounts": "Bank Jambi 1234567890 a.n. SMP Negeri 1 Demo\nBRI 0021-01-000123-30-5 a.n. SMP Negeri 1 Demo",
"payment_instructions": "1. Tunai di ruang Tata Usaha, Senin–Jumat pukul 07.30–14.00.\n2. Transfer ke salah satu rekening sekolah, lalu kirim foto bukti transfer ke WA bendahara 0812-3456-7890 dengan format: NAMA – KELAS – BULAN.\n3. SPP dibayar paling lambat tanggal 10 setiap bulan.",
"phone": "0741-123456",
"email": "[email protected] ",
"treasurer_name": "Rina Marlina, S.E."
}
}
PUT /wali/password Ganti PIN/kata sandi
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/password
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Body
Nama Tipe Keterangan Contoh
current_password wajib string PIN saat ini 123456
password wajib string Baru (min 6) rahasiaku
password_confirmation wajib string Ulangi rahasiaku
Contoh curl
curl -X PUT "https://belajar-api.unama.ac.id/api/spp/wali/password" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" \
-H "Content-Type: application/json" \
-d '{"current_password":"123456","password":"rahasiaku","password_confirmation":"rahasiaku"}' Salin
Contoh respons 200
{
"success": true,
"message": "Kata sandi diganti",
"data": null
}
POST /wali/logout Logout wali
🔒 Token wali ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/wali/logout
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X POST "https://belajar-api.unama.ac.id/api/spp/wali/logout" \
-H "Accept: application/json" \
-H "Authorization: Bearer $WALI_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "Logout berhasil",
"data": null
}
Superadmin Platform
Hanya untuk token superadmin (login via /auth/login).
GET /super/summary Ringkasan platform
🔒 Token superadmin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/super/summary
Header Accept: application/json Authorization: Bearer {token}
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/super/summary" \
-H "Accept: application/json" \
-H "Authorization: Bearer $SUPER_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"schools": 6,
"active_schools": 6,
"admins": 9,
"students": 230,
"invoices": 2812,
"payments": 586,
"payments_amount": 145248750,
"month_amount": 18155000,
"new_schools_month": 6
}
}
GET /super/schools Daftar sekolah
🔒 Token superadmin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/super/schools
Header Accept: application/json Authorization: Bearer {token}
Query string
Nama Tipe Keterangan Contoh
q string Cari
status string active / inactive
page integer Nomor halaman 1
per_page integer Jumlah data per halaman (1-100, bawaan 20) 20
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/super/schools?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer $SUPER_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": [
{
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": "Jl. Uji API No. 1",
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": "Bank Jambi 999",
"principal_name": "Dr. Kepala",
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "API",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00",
"students_count": 31,
"admins_count": 2,
"payments_amount": 140000
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 1,
"last_page": 1,
"from": 1,
"to": 1
}
}
GET /super/schools/{id} Detail sekolah + statistik
🔒 Token superadmin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/super/schools/{id}
Header Accept: application/json Authorization: Bearer {token}
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID sekolah 1
Contoh curl
curl -X GET "https://belajar-api.unama.ac.id/api/spp/super/schools/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $SUPER_TOKEN" Salin
Contoh respons 200
{
"success": true,
"message": "OK",
"data": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": "Jl. Uji API No. 1",
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": "Bank Jambi 999",
"principal_name": "Dr. Kepala",
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "API",
"receipt_footer": null,
"status": "active",
"created_at": "2026-11-13T06:21:02+07:00",
"stats": {
"students": 31,
"classes": 5,
"invoices": 404,
"outstanding": 82360000,
"payments": 1,
"payments_amount": 140000,
"last_payment": "2026-11-12T23:21:09.000000Z"
},
"admins": [
{
"id": 14,
"name": "Admin API",
"email": "[email protected] ",
"phone": "081200000000",
"role": "admin",
"position": "Bendahara",
"is_active": true,
"school_id": 9,
"last_login_at": "2026-11-13T06:21:03+07:00",
"created_at": "2026-11-13T06:21:02+07:00"
},
{
"id": 15,
"name": "Operator Satu",
"email": "[email protected] ",
"phone": null,
"role": "admin",
"position": "Operator TU",
"is_active": true,
"school_id": 9,
"last_login_at": null,
"created_at": "2026-11-13T06:21:03+07:00"
}
]
}
}
PATCH /super/schools/{id}/status Aktif/nonaktifkan sekolah
🔒 Token superadmin ▶
Request
URL https://belajar-api.unama.ac.id/api/spp/super/schools/{id}/status
Header Accept: application/json Authorization: Bearer {token} Content-Type: application/json
Parameter path
Nama Tipe Keterangan Contoh
id wajib integer ID sekolah 1
Body
Nama Tipe Keterangan Contoh
status wajib string active / inactive inactive
Contoh curl
curl -X PATCH "https://belajar-api.unama.ac.id/api/spp/super/schools/1/status" \
-H "Accept: application/json" \
-H "Authorization: Bearer $SUPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"inactive"}' Salin
Contoh respons 200
{
"success": true,
"message": "Status sekolah diperbarui",
"data": {
"id": 9,
"name": "SMA API Test 7001",
"slug": "sma-api-test-7001",
"npsn": null,
"level": "SMA",
"address": "Jl. Uji API No. 1",
"city": "Jambi",
"phone": null,
"email": "[email protected] ",
"logo_url": null,
"payment_instructions": "Pembayaran dapat dilakukan:\n1. Tunai di ruang Tata Usaha (Senin–Jumat, 07.30–14.00).\n2. Transfer ke rekening sekolah, lalu kirim bukti transfer ke bendahara.",
"bank_accounts": "Bank Jambi 999",
"principal_name": "Dr. Kepala",
"principal_nip": null,
"treasurer_name": "Admin API",
"treasurer_nip": null,
"receipt_prefix": "API",
"receipt_footer": null,
"status": "inactive",
"created_at": "2026-11-13T06:21:02+07:00"
}
}
SPP Sekolah API v1.0 · Belajar API UNAMA