SPP Sekolah API

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 URLhttps://belajar-api.unama.ac.id/api/spp

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).

Format respons

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

KodeArtiKapan terjadi
400Bad RequestPermintaan tidak dapat diproses.
401UnauthorizedToken tidak dikirim, salah, atau kedaluwarsa; atau login gagal.
403ForbiddenToken tidak berhak (mis. token wali ke endpoint admin) atau sekolah/akun nonaktif.
404Not FoundEndpoint atau data tidak ditemukan (termasuk data milik sekolah lain).
405Method Not AllowedMethod HTTP salah.
409ConflictAksi bertentangan dengan data, mis. menghapus kelas yang masih ada siswanya.
413Payload Too LargeFile/data terlalu besar.
422Unprocessable EntityValidasi gagal (lihat errors) atau aturan bisnis dilanggar (mis. bayar melebihi sisa).
429Too Many RequestsMelebihi 120 request/menit (login: 10/menit).
500Server ErrorKesalahan server.

Alur lengkap (dari daftar sampai laporan)

  1. POST /auth/register → simpan token
  2. POST /academic-years (2026/2027, 1 Jul – 30 Jun, is_active: true)
  3. POST /classes atau langsung impor siswa (kelas dibuat otomatis)
  4. GET /students/import/template → isi → POST /students/import (pratinjau) → POST /students/import/{id}/commit
  5. POST /fee-types {name: "SPP", frequency: "bulanan", rates: [{amount: 150000}]}
  6. POST /invoices/generate {fee_type_id, academic_year_id} → 12 tagihan per siswa
  7. GET /students?q=nama → GET /students/{id}/invoices?status=terbuka → POST /payments → GET /payments/{id}/receipt
  8. GET /reports/dashboard, /reports/income, /reports/arrears (tambahkan format=xlsx untuk Excel)
  9. Wali: POST /wali/login → GET /wali/invoices → GET /wali/payments

Akun demo

PeranLoginKata sandi / PINEndpoint login
Admin SMP Negeri 1 (Demo)[email protected]passwordPOST /auth/login
Admin SD IT Cahaya (Demo)[email protected]passwordPOST /auth/login
Wali muridschool_slug smp-negeri-1-demo, nis 2024001123456POST /wali/login
Wali murid sekolah 2school_slug sd-it-cahaya-demo, nis 24001123456POST /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

URLhttps://belajar-api.unama.ac.id/api/spp/
HeaderAccept: application/json

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/" \
  -H "Accept: application/json"

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
GET/openapiSpesifikasi OpenAPI 3 (JSON) ▶

Impor ke Swagger UI, Insomnia, atau Postman. (Alias /openapi.json tersedia bila server meneruskan *.json ke aplikasi.)

Request

URLhttps://belajar-api.unama.ac.id/api/spp/openapi
HeaderAccept: application/json

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/openapi" \
  -H "Accept: application/json"

Respons

File/HTML (bukan JSON).

GET
GET/postmanKoleksi Postman v2.1 ▶

Sama dengan tombol unduh di halaman dokumentasi.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/postman
HeaderAccept: application/json

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/postman" \
  -H "Accept: application/json"

Respons

File/HTML (bukan JSON).

GET
GET/schools/{slug}Info publik sekolah ▶

Nama, logo, dan cara bayar sekolah berdasarkan kode sekolah (slug). Berguna untuk layar login wali.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/schools/{slug}
HeaderAccept: application/json

Parameter path

NamaTipeKeteranganContoh
slug wajibstringKode sekolahsmp-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"

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"
    }
}
GET

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/registerDaftar sekolah + admin ▶

Membuat sekolah baru beserta akun admin pertamanya, lalu langsung mengembalikan token.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/auth/register
HeaderAccept: application/json Content-Type: application/json

Body

NamaTipeKeteranganContoh
school_name wajibstringNama sekolahSMP Harapan Bangsa
level stringTK/SD/MI/SMP/MTs/SMA/MA/SMK/LainnyaSMP
npsn stringNPSN10501234
city stringKotaJambi
school_phone stringTelepon sekolah0741-123456
name wajibstringNama adminRina Bendahara
email wajibstringEmail login (unik)[email protected]
phone stringNo HP admin081234567890
password wajibstringMin. 8 karakterrahasia123
password_confirmation wajibstringUlangi passwordrahasia123

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"}'

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
POST/auth/loginLogin admin ▶

Tukar email & kata sandi dengan token. Superadmin juga login di sini (tokennya hanya untuk /super/*).

Request

URLhttps://belajar-api.unama.ac.id/api/spp/auth/login
HeaderAccept: application/json Content-Type: application/json

Body

NamaTipeKeteranganContoh
email wajibstringEmail[email protected]
password wajibstringKata sandipassword
device_name stringNama perangkatpostman

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"}'

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"
        }
    }
}
POST
GET/auth/meProfil admin & sekolah 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/auth/me
HeaderAccept: 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"

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"
        }
    }
}
GET
PUT/auth/meUbah profil 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/auth/me
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
name stringNamaRina S.
phone stringNo HP0812000000
position stringJabatanBendahara

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"}'

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
PUT/auth/passwordGanti kata sandi 🔒 Token admin ▶

Token lain milik user dicabut otomatis.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/auth/password
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
current_password wajibstringKata sandi saat inipassword
password wajibstringKata sandi baru (min. 8)passwordbaru
password_confirmation wajibstringUlangipasswordbaru

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"}'

Contoh respons 200

{
    "success": true,
    "message": "Kata sandi diganti. Token di perangkat lain telah dicabut.",
    "data": null
}
PUT
POST/auth/logoutLogout (cabut token) 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/auth/logout
HeaderAccept: 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"

Contoh respons 200

{
    "success": true,
    "message": "Logout berhasil. Token tidak berlaku lagi.",
    "data": null
}
POST

Sekolah & Pengguna

Pengaturan profil sekolah (tampil di kuitansi & portal wali) dan pengelolaan user admin sekolah.

GET/schoolProfil sekolah + status wizard 🔒 Token admin ▶

setup berisi 5 langkah wizard awal dan status selesai/belum.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/school
HeaderAccept: 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"

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"
    }
}
GET
PUT/schoolUbah pengaturan sekolah 🔒 Token admin ▶

Kirim hanya field yang diubah. Untuk upload logo gunakan POST /school dengan multipart field logo.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/school
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
name stringNama sekolah
address stringAlamatJl. Merdeka No. 1
principal_name stringKepala sekolahDrs. Ahmad
treasurer_name stringBendaharaRina
bank_accounts stringRekeningBank Jambi 123 a.n. Sekolah
payment_instructions stringInstruksi bayarBayar di TU
receipt_prefix stringAwalan 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"}'

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"
    }
}
PUT
GET/usersDaftar admin sekolah 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/users
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
q stringCari nama/email
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/usersTambah admin 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/users
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
name wajibstringNamaOperator TU
email wajibstringEmail unik[email protected]
password wajibstringMin. 8operator123
position stringJabatanOperator

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"}'

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"
    }
}
POST
GET/users/{id}Detail admin 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/users/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID user1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/users/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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"
    }
}
GET
PUT/users/{id}Ubah admin 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/users/{id}
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID user1

Body

NamaTipeKeteranganContoh
name stringNama
password stringKata sandi baru
is_active booleanfalse = 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}'

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"
    }
}
PUT
DELETE/users/{id}Hapus admin 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/users/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID user1

Contoh curl

curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/users/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "Pengguna dihapus",
    "data": null
}
DELETE

Tahun Ajaran

Hanya satu tahun ajaran yang aktif. Bulan tagihan SPP diambil dari rentang tanggal tahun ajaran.

GET/academic-yearsDaftar tahun ajaran 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/academic-years
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/academic-yearsTambah tahun ajaran 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/academic-years
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
name wajibstringFormat YYYY/YYYY2026/2027
start_date wajibdateTanggal mulai2026-07-01
end_date wajibdateTanggal selesai2027-06-30
is_active booleanLangsung aktifkanfalse

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}'

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",
            "…"
        ]
    }
}
POST
GET/academic-years/{id}Detail 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/academic-years/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID tahun ajaran1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/academic-years/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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",
            "…"
        ]
    }
}
GET
PUT/academic-years/{id}Ubah 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/academic-years/{id}
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID tahun ajaran1

Body

NamaTipeKeteranganContoh
end_date dateTanggal selesai2027-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"}'

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",
            "…"
        ]
    }
}
PUT
POST/academic-years/{id}/activateJadikan aktif 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/academic-years/{id}/activate
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID tahun ajaran1

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"

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",
            "…"
        ]
    }
}
POST
DELETE/academic-years/{id}Hapus (jika belum ada tagihan) 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/academic-years/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID tahun ajaran1

Contoh curl

curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/academic-years/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "Tahun ajaran dihapus",
    "data": null
}
DELETE

Kelas

Kelas/rombel beserta tingkat (grade, 1–13) yang dipakai untuk tarif per tingkat.

GET/classesDaftar kelas 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/classes
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
grade integerFilter tingkat
q stringCari nama
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/classesTambah kelas 🔒 Token admin ▶

Jika grade tidak dikirim, tingkat ditebak dari nama (VII A → 7, X IPA → 10).

Request

URLhttps://belajar-api.unama.ac.id/api/spp/classes
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
name wajibstringNama kelas (unik)VII C
grade integerTingkat7
homeroom_teacher stringWali kelasBu 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"}'

Contoh respons 201

{
    "success": true,
    "message": "Kelas ditambahkan",
    "data": {
        "id": 45,
        "name": "X-1",
        "grade": 10,
        "homeroom_teacher": "Bu Sari",
        "students_count": null
    }
}
POST
GET/classes/{id}Detail kelas 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/classes/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID kelas1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/classes/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "OK",
    "data": {
        "id": 45,
        "name": "X-1",
        "grade": 10,
        "homeroom_teacher": "Bu Sari",
        "students_count": 0
    }
}
GET
PUT/classes/{id}Ubah kelas 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/classes/{id}
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID kelas1

Body

NamaTipeKeteranganContoh
homeroom_teacher stringWali kelasPak 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"}'

Contoh respons 200

{
    "success": true,
    "message": "Kelas diperbarui",
    "data": {
        "id": 45,
        "name": "X-1",
        "grade": 10,
        "homeroom_teacher": "Pak Budi",
        "students_count": null
    }
}
PUT
DELETE/classes/{id}Hapus kelas kosong 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/classes/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID kelas1

Contoh curl

curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/classes/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "Kelas dihapus",
    "data": null
}
DELETE
GET/classes/promoteSaran kenaikan kelas 🔒 Token admin ▶

Objek {class_id_asal: class_id_tujuan | "lulus" | "tetap"} hasil tebakan otomatis.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/classes/promote
HeaderAccept: application/json Authorization: Bearer {token}

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/classes/promote" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "Saran pemetaan kelas asal -> tujuan",
    "data": {
        "51": "tetap",
        "49": "tetap",
        "50": "tetap",
        "45": 46,
        "46": 47,
        "47": "lulus"
    }
}
GET
POST/classes/promoteProses 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

URLhttps://belajar-api.unama.ac.id/api/spp/classes/promote
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
map wajibobjectPemetaan {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"}}'

Contoh respons 200

{
    "success": true,
    "message": "Kenaikan kelas selesai",
    "data": {
        "moved": 2,
        "graduated": 0,
        "stayed": 0
    }
}
POST

Siswa & Import Excel

NIS unik per sekolah. Status: aktif, lulus, pindah, keluar. Import Excel 2 langkah: unggah → pratinjau (validasi per baris) → commit.

GET/studentsDaftar & cari siswa 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
q stringCari nama/NIS/NISN/nama waliahmad
class_id integerFilter kelas
status stringaktif (bawaan) / lulus / pindah / keluar / semuaaktif
gender stringL / P
with_outstanding booleanSertakan total tunggakan per siswatrue
sort stringname (bawaan) / nis
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/studentsTambah siswa 🔒 Token admin ▶

Respons berisi portal_pin untuk login wali (dibuat acak bila tidak dikirim).

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
nis wajibstringNIS unik2026999
name wajibstringNamaDewi Lestari
nisn stringNISN (angka)0101010101
gender stringL/PP
class_id integerID kelas1
entry_year integerAngkatan2026
guardian_name stringNama waliIbu Lestari
guardian_phone stringHP wali081311112222
email stringEmail
address stringAlamatJambi
portal_pin stringPIN 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"}'

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"
    }
}
POST
GET/students/{id}Detail siswa 🔒 Token admin ▶

Termasuk outstanding, PIN awal (jika wali belum mengganti), dan potongan.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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": []
    }
}
GET
PUT/students/{id}Ubah siswa 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Body

NamaTipeKeteranganContoh
class_id integerPindah kelas2
status stringaktif/lulus/pindah/keluaraktif
guardian_phone stringHP wali081299998888

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"}'

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"
    }
}
PUT
DELETE/students/{id}Hapus siswa (tanpa riwayat bayar) 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Contoh curl

curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/students/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"
DELETE
POST/students/{id}/reset-pinBuat PIN portal wali baru 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}/reset-pin
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Body

NamaTipeKeteranganContoh
pin stringPIN 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 '[]'

Contoh respons 200

{
    "success": true,
    "message": "PIN baru dibuat",
    "data": {
        "student_id": 380,
        "nis": "S700101",
        "school_slug": "sma-api-test-7001",
        "portal_pin": "654321"
    }
}
POST
GET/students/{id}/invoicesTagihan siswa 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}/invoices
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Query string

NamaTipeKeteranganContoh
status stringterbuka / belum / sebagian / lunas / batalterbuka
page integerNomor halaman1
per_page integerJumlah 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"

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
GET/students/{id}/paymentsRiwayat pembayaran siswa 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}/payments
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Query string

NamaTipeKeteranganContoh
page integerNomor halaman1
per_page integerJumlah 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"

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
GET/students/{id}/cardKartu SPP (matriks bulan) 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/{id}/card
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID siswa1

Query string

NamaTipeKeteranganContoh
academic_year_id integerBawaan: tahun aktif
format stringjson (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"

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
GET/students/exportExport siswa ke Excel 🔒 Token admin ▶

Mengembalikan file .xlsx (bukan JSON).

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/export
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
class_id integerFilter kelas
status stringFilter status

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/students/export" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Respons

File/HTML (bukan JSON).

GET
GET/students/import/templateUnduh 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

URLhttps://belajar-api.unama.ac.id/api/spp/students/import/template
HeaderAccept: 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"

Respons

File/HTML (bukan JSON).

GET
POST/students/importImport (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

URLhttps://belajar-api.unama.ac.id/api/spp/students/import
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: multipart/form-data

Body

NamaTipeKeteranganContoh
file wajibfileFile Excel/CSV maks 5 MB
mode stringtambah (NIS ada → lewati) / perbarui (NIS ada → timpa)tambah
create_classes booleanBuat kelas otomatis bila belum ada (bawaan 1)1
commit boolean1 = langsung simpan tanpa pratinjau0

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"

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

URLhttps://belajar-api.unama.ac.id/api/spp/students/import/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID import1

Query string

NamaTipeKeteranganContoh
only stringFilter baris: baru / perbarui / lewati / errorerror

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"

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"
                ]
            },
            "…"
        ]
    }
}
GET
POST/students/import/{id}/commitImport (langkah 2: simpan) 🔒 Token admin ▶

Menyimpan semua baris yang valid dalam satu transaksi. Baris error dilewati.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/students/import/{id}/commit
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID import1

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"

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",
                "…"
            ]
        }
    }
}
POST

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-typesDaftar jenis biaya + tarif 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
academic_year_id integerTarif tahun ini (bawaan aktif)
frequency stringbulanan / sekali
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/fee-typesTambah jenis biaya 🔒 Token admin ▶

rates opsional, langsung mengatur tarif tahun ajaran aktif.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
name wajibstringNama unikUang Kegiatan
frequency wajibstringbulanan / sekalisekali
code stringKodeKEG
rates arrayDaftar 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}]}'

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"
            }
        ]
    }
}
POST
GET/fee-types/{id}Detail jenis biaya 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID jenis biaya1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/fee-types/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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"
            }
        ]
    }
}
GET
PUT/fee-types/{id}Ubah jenis biaya 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types/{id}
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID jenis biaya1

Body

NamaTipeKeteranganContoh
is_active booleanfalse = tidak bisa ditagihkantrue
description stringKeterangan

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}'

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"
            }
        ]
    }
}
PUT
DELETE/fee-types/{id}Hapus (jika belum ada tagihan) 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID jenis biaya1

Contoh curl

curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/fee-types/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "Jenis biaya dihapus",
    "data": null
}
DELETE
GET/fee-types/{id}/ratesLihat tarif 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types/{id}/rates
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID jenis biaya1

Query string

NamaTipeKeteranganContoh
academic_year_id integerBawaan 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"

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"
            }
        ]
    }
}
GET
PUT/fee-types/{id}/ratesGanti 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

URLhttps://belajar-api.unama.ac.id/api/spp/fee-types/{id}/rates
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID jenis biaya1

Body

NamaTipeKeteranganContoh
academic_year_id wajibintegerID tahun ajaran1
rates wajibarrayDaftar 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}]}'

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"
            }
        ]
    }
}
PUT
GET/adjustmentsDaftar potongan/beasiswa 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/adjustments
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
student_id integerFilter siswa
fee_type_id integerFilter biaya
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/adjustmentsSimpan 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

URLhttps://belajar-api.unama.ac.id/api/spp/adjustments
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
student_id wajibintegerID siswa1
fee_type_id wajibintegerID jenis biaya1
academic_year_id integerKosong = semua tahun
discount_type stringnominal / persenpersen
discount_value integerNilai potongan50
custom_amount integerTarif khusus (Rp)
note stringKeteranganBeasiswa 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"}'

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%"
    }
}
POST
DELETE/adjustments/{id}Hapus potongan 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/adjustments/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID potongan1

Contoh curl

curl -X DELETE "https://belajar-api.unama.ac.id/api/spp/adjustments/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

Contoh respons 200

{
    "success": true,
    "message": "Potongan dihapus",
    "data": null
}
DELETE

Tagihan

Status tagihan: belum, sebagian (dicicil), lunas, batal. Generate massal bersifat idempotent — memanggil ulang tidak membuat tagihan dobel.

GET/invoicesDaftar tagihan 🔒 Token admin ▶

meta berisi sum_total, sum_paid, sum_remaining sesuai filter.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/invoices
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
q stringCari nama/NIS
status stringterbuka / belum / sebagian / lunas / batalterbuka
student_id integerFilter siswa
class_id integerFilter kelas
fee_type_id integerFilter biaya
academic_year_id integerFilter TA
period stringYYYY-MM
overdue boolean1 = hanya lewat jatuh tempo
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/invoices/generateGenerate 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

URLhttps://belajar-api.unama.ac.id/api/spp/invoices/generate
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
fee_type_id wajibintegerID jenis biaya1
academic_year_id wajibintegerID tahun ajaran1
class_ids arrayID kelas (kosong = semua)[1,2]
student_ids arrayID siswa tertentu
periods arrayBulan YYYY-MM (khusus bulanan)["2026-07","2026-08"]
due_day integerTgl jatuh tempo bulanan (1-28, bawaan 10)10
due_date dateJatuh tempo biaya sekali bayar2027-05-31
update_unpaid booleanPerbarui nominal tagihan yang belum dibayar sama sekalifalse

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}'

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
POST/invoicesTagihan manual satu siswa 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/invoices
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
student_id wajibintegerID siswa1
fee_type_id wajibintegerID jenis biaya2
title stringJudulDenda keterlambatan buku
amount wajibintegerNominal25000
discount integerPotongan0
due_date dateJatuh tempo2026-12-31
note stringCatatan

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"}'

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"
        }
    }
}
POST
GET/invoices/{id}Detail tagihan + pembayarannya 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/invoices/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID tagihan1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/invoices/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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": []
    }
}
GET
POST/invoices/{id}/cancelBatalkan tagihan 🔒 Token admin ▶

Hanya untuk tagihan yang belum ada pembayaran.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/invoices/{id}/cancel
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID tagihan1

Body

NamaTipeKeteranganContoh
reason wajibstringAlasan (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"}'

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"
        }
    }
}
POST

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/paymentsRiwayat pembayaran 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/payments
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
q stringNo kuitansi / nama / NIS
from dateDari tanggal
to dateSampai tanggal
method stringtunai / transfer
status stringsah / batal
student_id integerFilter siswa
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET
POST/paymentsTerima pembayaran 🔒 Token admin ▶

Kosongkan amount pada item untuk melunasi sisa tagihan. Error 422 jika nominal melebihi sisa atau tagihan bukan milik siswa.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/payments
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
student_id wajibintegerID siswa1
method wajibstringtunai / transfertunai
items wajibarrayTagihan yang dibayar [{invoice_id, amount?}][{"invoice_id":1},{"invoice_id":2,"amount":50000}]
paid_at dateTanggal bayar (bawaan sekarang)
reference stringNo ref transfer
payer_name stringNama penyetorBapak Budi
note stringCatatan

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"}'

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"
    }
}
POST
GET/payments/{id}Detail pembayaran 🔒 Token admin ▶

Termasuk amount_in_words (terbilang).

Request

URLhttps://belajar-api.unama.ac.id/api/spp/payments/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID pembayaran1

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/payments/1" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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
GET/payments/{id}/receiptKuitansi HTML siap cetak 🔒 Token admin ▶

Mengembalikan halaman HTML (bukan JSON) yang bisa langsung dicetak / dijadikan PDF.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/payments/{id}/receipt
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID pembayaran1

Query string

NamaTipeKeteranganContoh
format stringa5 (bawaan) / thermala5

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"

Respons

File/HTML (bukan JSON).

GET
POST/payments/{id}/cancelBatalkan pembayaran 🔒 Token admin ▶

Tagihan terkait dikembalikan (paid_amount dikurangi). Tercatat di log aktivitas.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/payments/{id}/cancel
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID pembayaran1

Body

NamaTipeKeteranganContoh
reason wajibstringAlasan (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"}'

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"
    }
}
POST

Laporan

Semua laporan mendukung format=xlsx untuk mengunduh Excel.

GET/reports/dashboardRingkasan dasbor 🔒 Token admin ▶

Penerimaan hari ini/bulan ini/TA, total tunggakan, grafik 12 bulan, % lunas per kelas, 8 pembayaran terakhir.

Request

URLhttps://belajar-api.unama.ac.id/api/spp/reports/dashboard
HeaderAccept: 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"

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
GET/reports/incomeLaporan penerimaan 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/reports/income
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
from dateBawaan awal bulan
to dateBawaan hari ini
fee_type_id integerFilter biaya
class_id integerFilter kelas
method stringtunai / transfer
format stringjson / xlsx

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/reports/income" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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
GET/reports/arrearsRekap tunggakan per siswa & kelas 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/reports/arrears
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
until dateJatuh tempo s.d. (bawaan hari ini)
class_id integerFilter kelas
fee_type_id integerFilter biaya
academic_year_id integerFilter TA
format stringjson / xlsx

Contoh curl

curl -X GET "https://belajar-api.unama.ac.id/api/spp/reports/arrears" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $TOKEN"

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
GET/reports/class-progress% lunas per kelas 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/reports/class-progress
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
academic_year_id integerBawaan aktif
all boolean1 = 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"

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
GET/activity-logsLog aktivitas 🔒 Token admin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/activity-logs
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
action stringAwalan aksi, mis. pembayaran
q stringCari keterangan
page integerNomor halaman1
per_page integerJumlah 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"

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
    }
}
GET

Portal Wali Murid

Wali login dengan kode sekolah + NIS + PIN dari sekolah. Token wali hanya bisa membaca data siswa itu sendiri.

POST/wali/loginLogin wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/login
HeaderAccept: application/json Content-Type: application/json

Body

NamaTipeKeteranganContoh
school_slug wajibstringKode sekolahsmp-negeri-1-demo
nis wajibstringNIS2024001
password wajibstringPIN / kata sandi123456

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"}'

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"
        }
    }
}
POST
GET/wali/meData siswa & total tagihan 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/me
HeaderAccept: 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"

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
GET/wali/invoicesTagihan siswa 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/invoices
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
status stringterbuka / lunas
page integerNomor halaman1
per_page integerJumlah 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"

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
GET/wali/paymentsRiwayat pembayaran 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/payments
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
page integerNomor halaman1
per_page integerJumlah 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"

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
GET/wali/payments/{id}Detail kuitansi 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/payments/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID pembayaran1

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"

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
GET/wali/payments/{id}/receiptKuitansi HTML 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/payments/{id}/receipt
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID pembayaran1

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"

Respons

File/HTML (bukan JSON).

GET
GET/wali/payment-infoCara bayar sekolah 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/payment-info
HeaderAccept: 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"

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."
    }
}
GET
PUT/wali/passwordGanti PIN/kata sandi 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/password
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Body

NamaTipeKeteranganContoh
current_password wajibstringPIN saat ini123456
password wajibstringBaru (min 6)rahasiaku
password_confirmation wajibstringUlangirahasiaku

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"}'

Contoh respons 200

{
    "success": true,
    "message": "Kata sandi diganti",
    "data": null
}
PUT
POST/wali/logoutLogout wali 🔒 Token wali ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/wali/logout
HeaderAccept: 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"

Contoh respons 200

{
    "success": true,
    "message": "Logout berhasil",
    "data": null
}
POST

Superadmin Platform

Hanya untuk token superadmin (login via /auth/login).

GET/super/summaryRingkasan platform 🔒 Token superadmin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/super/summary
HeaderAccept: 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"

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
GET/super/schoolsDaftar sekolah 🔒 Token superadmin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/super/schools
HeaderAccept: application/json Authorization: Bearer {token}

Query string

NamaTipeKeteranganContoh
q stringCari
status stringactive / inactive
page integerNomor halaman1
per_page integerJumlah 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"

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
GET/super/schools/{id}Detail sekolah + statistik 🔒 Token superadmin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/super/schools/{id}
HeaderAccept: application/json Authorization: Bearer {token}

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID sekolah1

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"

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"
            }
        ]
    }
}
GET
PATCH/super/schools/{id}/statusAktif/nonaktifkan sekolah 🔒 Token superadmin ▶

Request

URLhttps://belajar-api.unama.ac.id/api/spp/super/schools/{id}/status
HeaderAccept: application/json Authorization: Bearer {token} Content-Type: application/json

Parameter path

NamaTipeKeteranganContoh
id wajibintegerID sekolah1

Body

NamaTipeKeteranganContoh
status wajibstringactive / inactiveinactive

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"}'

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"
    }
}
PATCH

SPP Sekolah API v1.0 · Belajar API UNAMA