MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Classes

Get a list of all classes.

requires authentication

This endpoint returns a list of all classes, including their associated grade and staff members.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/classes" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/classes"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Mathematics",
            "grade_id": 1,
            "grade": {
                "id": 1,
                "name": "Elementary"
            },
            "staff": [
                {
                    "id": 1,
                    "name": "John Doe"
                }
            ]
        }
    ]
}
 

Request      

GET api/v1/classes

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a new class.

requires authentication

This endpoint allows you to create a new class by providing its name, grade, and an optional list of staff members.

Example request:
curl --request POST \
    "http://localhost/api/v1/classes" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Class A\",
    \"grade_id\": 1,
    \"staff_ids\": \"[1, 2, 3]\"
}"
const url = new URL(
    "http://localhost/api/v1/classes"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Class A",
    "grade_id": 1,
    "staff_ids": "[1, 2, 3]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "success": true,
    "data": {
        "name": "Class A",
        "grade_id": 1,
        "updated_at": "2025-08-02T01:00:00.000000Z",
        "created_at": "2025-08-02T01:00:00.000000Z",
        "id": 1
    }
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
 

Request      

POST api/v1/classes

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the class. Example: Class A

grade_id   integer   

The ID of the grade the class belongs to. Must exist in the grades table. Example: 1

staff_ids   array|null  optional  

An optional array of staff member IDs to be attached to the class. Each ID must exist in the staff table. Example: [1, 2, 3]

Get details for a specific class.

requires authentication

This endpoint returns the details for a single class, including its associated grade and staff members.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/classes/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/classes/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "name": "Mathematics",
        "grade_id": 1,
        "grade": {
            "id": 1,
            "name": "Elementary"
        },
        "staff": [
            {
                "id": 1,
                "name": "John Doe"
            }
        ]
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\ClassModel] 100"
}
 

Request      

GET api/v1/classes/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the class. Example: 17

class   integer   

The ID of the class. Example: 1

Update an existing class.

requires authentication

This endpoint updates an existing class, including its name, grade, and attached staff members.

Example request:
curl --request PUT \
    "http://localhost/api/v1/classes/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Class B\",
    \"grade_id\": 2,
    \"staff_ids\": \"[4, 5]\"
}"
const url = new URL(
    "http://localhost/api/v1/classes/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Class B",
    "grade_id": 2,
    "staff_ids": "[4, 5]"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "name": "Class B",
        "grade_id": 2,
        "updated_at": "2025-08-02T01:05:00.000000Z",
        "created_at": "2025-08-02T01:00:00.000000Z"
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\ClassModel] 1"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "grade_id": [
            "The selected grade id is invalid."
        ]
    }
}
 

Request      

PUT api/v1/classes/{id}

PATCH api/v1/classes/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the class. Example: consequatur

class   integer   

The ID of the class to update. Example: 1

Body Parameters

name   string   

The new name of the class. Example: Class B

grade_id   integer   

The new grade ID. Must exist in the grades table. Example: 2

staff_ids   array|null  optional  

An optional array of staff member IDs to be attached. All existing staff will be replaced. Example: [4, 5]

Delete a class.

requires authentication

This endpoint deletes a specific class from the database.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/classes/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/classes/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\ClassModel] 100"
}
 

Request      

DELETE api/v1/classes/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the class. Example: 17

class   integer   

The ID of the class to delete. Example: 1

Endpoints

POST api/v1/register

Example request:
curl --request POST \
    "http://localhost/api/v1/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"email\": \"kunde.eloisa@example.com\",
    \"password\": \"4[*UyPJ\\\"}6\",
    \"role\": \"admin\"
}"
const url = new URL(
    "http://localhost/api/v1/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "email": "kunde.eloisa@example.com",
    "password": "4[*UyPJ\"}6",
    "role": "admin"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: kunde.eloisa@example.com

password   string   

Must be at least 8 characters. Example: 4[*UyPJ"}6

role   string  optional  

Example: admin

Must be one of:
  • user
  • admin

POST api/v1/login

Example request:
curl --request POST \
    "http://localhost/api/v1/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\",
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\"
}"
const url = new URL(
    "http://localhost/api/v1/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "qkunze@example.com",
    "password": "O[2UZ5ij-e\/dl4m{o,"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Example: qkunze@example.com

password   string   

Example: O[2UZ5ij-e/dl4m{o,

POST api/v1/logout

Example request:
curl --request POST \
    "http://localhost/api/v1/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/v1/user

Example request:
curl --request GET \
    --get "http://localhost/api/v1/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/v1/attendances

Example request:
curl --request POST \
    "http://localhost/api/v1/attendances" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"staff_id\": 17
}"
const url = new URL(
    "http://localhost/api/v1/attendances"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "staff_id": 17
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/attendances

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

staff_id   integer   

The id of an existing record in the staff table. Example: 17

GET api/v1/attendances

Example request:
curl --request GET \
    --get "http://localhost/api/v1/attendances" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/attendances"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/attendances

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/v1/dashboard

Example request:
curl --request GET \
    --get "http://localhost/api/v1/dashboard" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/dashboard"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/dashboard

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/v1/earnings-summary

Example request:
curl --request GET \
    --get "http://localhost/api/v1/earnings-summary" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/earnings-summary"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/earnings-summary

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/v1/confirm-password

Example request:
curl --request POST \
    "http://localhost/api/v1/confirm-password" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\"
}"
const url = new URL(
    "http://localhost/api/v1/confirm-password"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "password": "O[2UZ5ij-e\/dl4m{o,"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/confirm-password

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

password   string   

Example: O[2UZ5ij-e/dl4m{o,

GET api/v1/profile

Example request:
curl --request GET \
    --get "http://localhost/api/v1/profile" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/profile"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/profile

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

PUT api/v1/profile

Example request:
curl --request PUT \
    "http://localhost/api/v1/profile" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\"
}"
const url = new URL(
    "http://localhost/api/v1/profile"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/profile

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

email   string  optional  

POST api/v1/profile/update

Example request:
curl --request POST \
    "http://localhost/api/v1/profile/update" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name=vmqeopfuudtdsufvyvddq"\
    --form "email=kunde.eloisa@example.com"\
    --form "avatar=@C:\Users\pc\AppData\Local\Temp\php9DE5.tmp" 
const url = new URL(
    "http://localhost/api/v1/profile/update"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', 'vmqeopfuudtdsufvyvddq');
body.append('email', 'kunde.eloisa@example.com');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/profile/update

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

email   string   

Must be a valid email address. Example: kunde.eloisa@example.com

avatar   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: C:\Users\pc\AppData\Local\Temp\php9DE5.tmp

GET api/v1/payments/class/{class_id}

Example request:
curl --request GET \
    --get "http://localhost/api/v1/payments/class/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/payments/class/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/payments/class/{class_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

class_id   string   

The ID of the class. Example: consequatur

GET api/v1/payments/suspended/{studentId}

Example request:
curl --request GET \
    --get "http://localhost/api/v1/payments/suspended/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/payments/suspended/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/payments/suspended/{studentId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

studentId   string   

Example: consequatur

GET api/v1/payments/statuses

Example request:
curl --request GET \
    --get "http://localhost/api/v1/payments/statuses" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/payments/statuses"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/payments/statuses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/v1/transactions

Example request:
curl --request GET \
    --get "http://localhost/api/v1/transactions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/transactions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/v1/transactions

Example request:
curl --request POST \
    "http://localhost/api/v1/transactions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"student_id\": 11613.31890586,
    \"total_amount\": 11613.31890586,
    \"status\": \"consequatur\",
    \"payment_method\": \"consequatur\",
    \"payments\": [
        {
            \"id\": \"consequatur\",
            \"amountToPay\": 45,
            \"remise\": 56
        }
    ]
}"
const url = new URL(
    "http://localhost/api/v1/transactions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "student_id": 11613.31890586,
    "total_amount": 11613.31890586,
    "status": "consequatur",
    "payment_method": "consequatur",
    "payments": [
        {
            "id": "consequatur",
            "amountToPay": 45,
            "remise": 56
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

student_id   number   

Example: 11613.31890586

total_amount   number   

Example: 11613.31890586

status   string   

Example: consequatur

payment_method   string   

Example: consequatur

payments   object[]   
id   string   

The id of an existing record in the payments table. Example: consequatur

amountToPay   number   

Must be at least 0. Example: 45

remise   number  optional  

Must be at least 0. Example: 56

GET api/v1/transactions/{id}

Example request:
curl --request GET \
    --get "http://localhost/api/v1/transactions/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/transactions/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/transactions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the transaction. Example: consequatur

Get payments for a specific transaction.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/transactions/consequatur/payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/transactions/consequatur/payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/transactions/{id}/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the transaction. Example: consequatur

GET api/v1/school-settings

Example request:
curl --request GET \
    --get "http://localhost/api/v1/school-settings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/school-settings"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/school-settings

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/v1/school-settings

Example request:
curl --request POST \
    "http://localhost/api/v1/school-settings" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name=vmqeopfuudtdsufvyvddq"\
    --form "address=consequatur"\
    --form "phone=mqeopfuudtdsufvyv"\
    --form "email=buckridge.adell@example.org"\
    --form "website=niihfqcoynlazghdtqtqx"\
    --form "logo=@C:\Users\pc\AppData\Local\Temp\php9E9A.tmp" 
const url = new URL(
    "http://localhost/api/v1/school-settings"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', 'vmqeopfuudtdsufvyvddq');
body.append('address', 'consequatur');
body.append('phone', 'mqeopfuudtdsufvyv');
body.append('email', 'buckridge.adell@example.org');
body.append('website', 'niihfqcoynlazghdtqtqx');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/school-settings

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

address   string  optional  

Example: consequatur

phone   string  optional  

Must not be greater than 20 characters. Example: mqeopfuudtdsufvyv

email   string  optional  

Must be a valid email address. Must not be greater than 255 characters. Example: buckridge.adell@example.org

website   string  optional  

Must not be greater than 255 characters. Example: niihfqcoynlazghdtqtqx

logo   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: C:\Users\pc\AppData\Local\Temp\php9E9A.tmp

GET api/v1/school-years

Example request:
curl --request GET \
    --get "http://localhost/api/v1/school-years" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/school-years"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/school-years

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/v1/school-years

Example request:
curl --request POST \
    "http://localhost/api/v1/school-years" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"consequatur\",
    \"start_year\": 17,
    \"end_year\": 17,
    \"is_active\": true
}"
const url = new URL(
    "http://localhost/api/v1/school-years"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "consequatur",
    "start_year": 17,
    "end_year": 17,
    "is_active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/school-years

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Example: consequatur

start_year   integer   

Example: 17

end_year   integer   

Example: 17

is_active   boolean   

Example: true

FeeTypes

Display a listing of the resource.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/fee-types" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/fee-types"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Tuition",
        "amount": 500,
        "frequency": "monthly"
    }
]
 

Request      

GET api/v1/fee-types

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created resource in storage.

Example request:
curl --request POST \
    "http://localhost/api/v1/fee-types" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Tuition\",
    \"amount\": \"500\",
    \"frequency\": \"monthly\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/v1/fee-types"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Tuition",
    "amount": "500",
    "frequency": "monthly",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Tuition",
    "amount": 500,
    "frequency": "monthly"
}
 

Request      

POST api/v1/fee-types

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the fee type. Example: Tuition

amount   numeric   

The amount for the fee type. Example: 500

frequency   string   

The frequency of the fee. Example: monthly

description   string  optional  

Example: Dolores dolorum amet iste laborum eius est dolor.

grade_id   string  optional  

The id of an existing record in the grades table.

Display the specified resource.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/fee-types/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/fee-types/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Tuition",
    "amount": 500,
    "frequency": "monthly"
}
 

Request      

GET api/v1/fee-types/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the fee type. Example: 17

feeType   integer   

The ID of the fee type. Example: 1

Update the specified resource in storage.

Example request:
curl --request PUT \
    "http://localhost/api/v1/fee-types/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Updated Tuition\",
    \"amount\": \"600\",
    \"frequency\": \"annual\"
}"
const url = new URL(
    "http://localhost/api/v1/fee-types/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Updated Tuition",
    "amount": "600",
    "frequency": "annual"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Updated Tuition",
    "amount": 600,
    "frequency": "annual"
}
 

Request      

PUT api/v1/fee-types/{id}

PATCH api/v1/fee-types/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the fee type. Example: 17

feeType   integer   

The ID of the fee type. Example: 1

Body Parameters

name   string   

The name of the fee type. Example: Updated Tuition

amount   numeric   

The updated amount for the fee type. Example: 600

frequency   string   

The updated frequency of the fee. Example: annual

Remove the specified resource from storage.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/fee-types/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/fee-types/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/v1/fee-types/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the fee type. Example: 17

feeType   integer   

The ID of the fee type. Example: 1

Grades

Display a listing of the resource.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/grades" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/grades"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Elementary"
}
 

Request      

GET api/v1/grades

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created resource in storage.

Example request:
curl --request POST \
    "http://localhost/api/v1/grades" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Elementary\"
}"
const url = new URL(
    "http://localhost/api/v1/grades"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Elementary"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Elementary"
}
 

Request      

POST api/v1/grades

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the grade. Example: Elementary

Display the specified resource.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/grades/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/grades/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Elementary"
}
 

Request      

GET api/v1/grades/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the grade. Example: 17

grade   integer   

The ID of the grade. Example: 1

Update the specified resource in storage.

Example request:
curl --request PUT \
    "http://localhost/api/v1/grades/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Secondary\"
}"
const url = new URL(
    "http://localhost/api/v1/grades/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Secondary"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Secondary"
}
 

Request      

PUT api/v1/grades/{id}

PATCH api/v1/grades/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the grade. Example: 17

grade   integer   

The ID of the grade. Example: 1

Body Parameters

name   string   

The name of the grade. Example: Secondary

Remove the specified resource from storage.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/grades/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/grades/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/v1/grades/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the grade. Example: 17

grade   integer   

The ID of the grade. Example: 1

Guardians

Example request:
curl --request GET \
    --get "http://localhost/api/v1/guardians/search?search=John" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/guardians/search"
);

const params = {
    "search": "John",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Display a listing of the guardians.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/guardians" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/guardians"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/guardians

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created guardian in storage.

Example request:
curl --request POST \
    "http://localhost/api/v1/guardians" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "first_name=vmqeopfuudtdsufvyvddq"\
    --form "last_name=amniihfqcoynlazghdtqt"\
    --form "phone_number=qxbajwbpilpmufinl"\
    --form "email=john@example.com"\
    --form "address=uydlsmsjuryvojcybzvrb"\
    --form "name=John Doe"\
    --form "phone=123-456-7890"\
    --form "cin_front=@C:\Users\pc\AppData\Local\Temp\php9E38.tmp" \
    --form "cin_back=@C:\Users\pc\AppData\Local\Temp\php9E39.tmp" 
const url = new URL(
    "http://localhost/api/v1/guardians"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('first_name', 'vmqeopfuudtdsufvyvddq');
body.append('last_name', 'amniihfqcoynlazghdtqt');
body.append('phone_number', 'qxbajwbpilpmufinl');
body.append('email', 'john@example.com');
body.append('address', 'uydlsmsjuryvojcybzvrb');
body.append('name', 'John Doe');
body.append('phone', '123-456-7890');
body.append('cin_front', document.querySelector('input[name="cin_front"]').files[0]);
body.append('cin_back', document.querySelector('input[name="cin_back"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/guardians

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

first_name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

last_name   string   

Must not be greater than 255 characters. Example: amniihfqcoynlazghdtqt

phone_number   string   

Must not be greater than 20 characters. Example: qxbajwbpilpmufinl

email   string   

The email of the guardian. Example: john@example.com

address   string  optional  

Must not be greater than 255 characters. Example: uydlsmsjuryvojcybzvrb

cin_front   file  optional  

Must be an image. Must not be greater than 4096 kilobytes. Example: C:\Users\pc\AppData\Local\Temp\php9E38.tmp

cin_back   file  optional  

Must be an image. Must not be greater than 4096 kilobytes. Example: C:\Users\pc\AppData\Local\Temp\php9E39.tmp

name   string   

The name of the guardian. Example: John Doe

phone   string  optional  

The phone number of the guardian. Example: 123-456-7890

Display the specified guardian.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/guardians/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/guardians/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/guardians/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the guardian. Example: 17

guardian   integer   

The ID of the guardian. Example: 1

Update the specified guardian in storage.

Example request:
curl --request PUT \
    "http://localhost/api/v1/guardians/17" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "first_name=vmqeopfuudtdsufvyvddq"\
    --form "last_name=amniihfqcoynlazghdtqt"\
    --form "email=jane@example.com"\
    --form "phone_number=wbpilpmufinllwloa"\
    --form "address=uydlsmsjuryvojcybzvrb"\
    --form "name=Jane Doe"\
    --form "phone=098-765-4321"\
    --form "cin_front=@C:\Users\pc\AppData\Local\Temp\php9E4A.tmp" \
    --form "cin_back=@C:\Users\pc\AppData\Local\Temp\php9E4B.tmp" 
const url = new URL(
    "http://localhost/api/v1/guardians/17"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('first_name', 'vmqeopfuudtdsufvyvddq');
body.append('last_name', 'amniihfqcoynlazghdtqt');
body.append('email', 'jane@example.com');
body.append('phone_number', 'wbpilpmufinllwloa');
body.append('address', 'uydlsmsjuryvojcybzvrb');
body.append('name', 'Jane Doe');
body.append('phone', '098-765-4321');
body.append('cin_front', document.querySelector('input[name="cin_front"]').files[0]);
body.append('cin_back', document.querySelector('input[name="cin_back"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());

Request      

PUT api/v1/guardians/{id}

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the guardian. Example: 17

guardian   integer   

The ID of the guardian. Example: 1

Body Parameters

first_name   string  optional  

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

last_name   string  optional  

Must not be greater than 255 characters. Example: amniihfqcoynlazghdtqt

email   string  optional  

The new email of the guardian. Example: jane@example.com

phone_number   string  optional  

Must not be greater than 20 characters. Example: wbpilpmufinllwloa

address   string  optional  

Must not be greater than 255 characters. Example: uydlsmsjuryvojcybzvrb

cin_front   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: C:\Users\pc\AppData\Local\Temp\php9E4A.tmp

cin_back   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: C:\Users\pc\AppData\Local\Temp\php9E4B.tmp

name   string  optional  

The new name of the guardian. Example: Jane Doe

phone   string  optional  

The new phone number of the guardian. Example: 098-765-4321

Remove the specified guardian from storage.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/guardians/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/guardians/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/guardians/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the guardian. Example: 17

guardian   integer   

The ID of the guardian. Example: 1

Get CIN image of a guardian. Returns the requested CIN image (front or back) of a guardian.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/guardians/1/cin/front" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/guardians/1/cin/front"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/guardians/{id}/cin/{side}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the guardian. Example: 1

side   string   

The side of the CIN image to retrieve. Must be front or back. Example: front

Payments

Get all payments for a specific student.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/students/1/payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/students/1/payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "amount": 100,
        "payment_date": "2024-09-01",
        "status": "pending",
        "student_id": 1,
        "fee_type_id": 1,
        "student": {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe"
        },
        "feeType": {
            "id": 1,
            "name": "Tuition"
        }
    }
]
 

Request      

GET api/v1/students/{student_id}/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

student_id   integer   

The ID of the student. Example: 1

Get payments for the current month.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "amount": 100,
        "payment_date": "2024-09-01",
        "status": "pending",
        "student_id": 1,
        "fee_type_id": 1,
        "student": {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "code_massar": "ABC123"
        },
        "feeType": {
            "id": 1,
            "name": "Tuition"
        }
    }
]
 

Request      

GET api/v1/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new payment.

Example request:
curl --request POST \
    "http://localhost/api/v1/payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 100,
    \"payment_date\": \"2024-09-01\",
    \"status\": \"pending\",
    \"student_id\": 1,
    \"fee_type_id\": 1
}"
const url = new URL(
    "http://localhost/api/v1/payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": 100,
    "payment_date": "2024-09-01",
    "status": "pending",
    "student_id": 1,
    "fee_type_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "amount": 100,
    "payment_date": "2024-09-01",
    "status": "pending",
    "student_id": 1,
    "fee_type_id": 1
}
 

Request      

POST api/v1/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

amount   number   

The amount of the payment. Example: 100

payment_date   date   

The date of the payment. Example: 2024-09-01

status   string   

The status of the payment. Example: pending

student_id   integer   

The ID of the student. Example: 1

fee_type_id   integer   

The ID of the fee type. Example: 1

Update an existing payment.

Example request:
curl --request PUT \
    "http://localhost/api/v1/payments/1562" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount_paid\": 73,
    \"remise\": 45,
    \"amount\": 150,
    \"payment_date\": \"2024-10-01\",
    \"status\": \"completed\",
    \"student_id\": 2,
    \"fee_type_id\": 2
}"
const url = new URL(
    "http://localhost/api/v1/payments/1562"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount_paid": 73,
    "remise": 45,
    "amount": 150,
    "payment_date": "2024-10-01",
    "status": "completed",
    "student_id": 2,
    "fee_type_id": 2
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "amount": 150,
    "payment_date": "2024-10-01",
    "status": "completed",
    "student_id": 2,
    "fee_type_id": 2
}
 

Request      

PUT api/v1/payments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the payment. Example: 1562

payment   integer   

The ID of the payment. Example: 1

Body Parameters

amount_paid   number   

Must be at least 0. Example: 73

remise   number  optional  

Must be at least 0. Example: 45

amount   number  optional  

The new amount of the payment. Example: 150

payment_date   date  optional  

The new date of the payment. Example: 2024-10-01

status   string  optional  

The new status of the payment. Example: completed

student_id   integer  optional  

The new ID of the student. Example: 2

fee_type_id   integer  optional  

The new ID of the fee type. Example: 2

Generate payments for all students based on their fee types.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/payments/generate-payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/payments/generate-payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Payments generated successfully."
}
 

Request      

GET api/v1/payments/generate-payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get a student's payments by their Massar code.

requires authentication

This endpoint retrieves all payments for a specific student using their unique code_massar. You can optionally filter the results by a specific school year.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/payments/massar/&quot;S123456789&quot;?school_year_id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/payments/massar/&quot;S123456789&quot;"
);

const params = {
    "school_year_id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "data": [
        {
            "id": 1,
            "student_id": 1,
            "fee_type_id": 1,
            "school_year_id": 1,
            "amount": 500,
            "remaining": 100,
            "payment_date": "2025-08-01",
            "status": "incomplete",
            "year": 2025,
            "month": 8,
            "student": {
                "id": 1,
                "first_name": "Jane",
                "last_name": "Doe",
                "code_massar": "S123456789"
            },
            "fee_type": {
                "id": 1,
                "name": "Tuition Fee"
            }
        },
        {
            "id": 2,
            "student_id": 1,
            "fee_type_id": 2,
            "school_year_id": 1,
            "amount": 200,
            "remaining": 0,
            "payment_date": "2025-07-25",
            "status": "completed",
            "year": 2025,
            "month": 7,
            "student": {
                "id": 1,
                "first_name": "Jane",
                "last_name": "Doe",
                "code_massar": "S123456789"
            },
            "fee_type": {
                "id": 2,
                "name": "Books"
            }
        }
    ]
}
 

Example response (404):


{
    "message": "Student not found"
}
 

Request      

GET api/v1/payments/massar/{code_massar}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

code_massar   string   

The unique Massar code of the student. Example: "S123456789"

Query Parameters

school_year_id   integer  optional  

The ID of the school year to filter by. Example: 1

Staff

Display a listing of the staff members.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/staff" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/staff"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "address": "123 Main St",
    "phone_number": "123-456-7890",
    "email": "john.doe@example.com",
    "affectation_date": "2021-06-15",
    "contrat_type": "CDI",
    "function": "teacher",
    "n_cnss": "1234567890",
    "base_salary": 3000,
    "bank_acount_num": "123456789"
}
 

Request      

GET api/v1/staff

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created staff member in storage.

Example request:
curl --request POST \
    "http://localhost/api/v1/staff" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"phone_number\": \"123-456-7890\",
    \"email\": \"john.doe@example.com\",
    \"date_of_birth\": \"1990-01-01\",
    \"gender\": \"male\",
    \"address\": \"123 Main St\",
    \"affectation_date\": \"2021-06-15\",
    \"contrat_type\": \"CDI\",
    \"function\": \"teacher\",
    \"n_cnss\": \"1234567890\",
    \"base_salary\": 3000,
    \"bank_acount_num\": \"123456789\"
}"
const url = new URL(
    "http://localhost/api/v1/staff"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "John",
    "last_name": "Doe",
    "phone_number": "123-456-7890",
    "email": "john.doe@example.com",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "address": "123 Main St",
    "affectation_date": "2021-06-15",
    "contrat_type": "CDI",
    "function": "teacher",
    "n_cnss": "1234567890",
    "base_salary": 3000,
    "bank_acount_num": "123456789"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "address": "123 Main St",
    "phone_number": "123-456-7890",
    "email": "john.doe@example.com",
    "affectation_date": "2021-06-15",
    "contrat_type": "CDI",
    "function": "teacher",
    "n_cnss": "1234567890",
    "base_salary": 3000,
    "bank_acount_num": "123456789"
}
 

Request      

POST api/v1/staff

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

first_name   string   

The first name of the staff. Example: John

last_name   string   

The last name of the staff. Example: Doe

phone_number   string   

The phone number of the staff. Example: 123-456-7890

email   string   

The email of the staff. Example: john.doe@example.com

date_of_birth   date   

The date of birth of the staff. Example: 1990-01-01

gender   string   

The gender of the staff. Example: male

address   string   

The address of the staff. Example: 123 Main St

affectation_date   date   

The date when the staff was assigned. Example: 2021-06-15

contrat_type   string  optional  

The type of contract for the staff. Example: CDI

function   string   

The function of the staff. Example: teacher

n_cnss   string   

The CNSS number of the staff. Example: 1234567890

base_salary   number   

The base salary of the staff. Example: 3000

bank_acount_num   string   

The bank account number of the staff. Example: 123456789

Display the specified staff member.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/staff/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/staff/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "address": "123 Main St",
    "phone_number": "123-456-7890",
    "email": "john.doe@example.com",
    "affectation_date": "2021-06-15",
    "contrat_type": "CDI",
    "function": "teacher",
    "n_cnss": "1234567890",
    "base_salary": 3000,
    "bank_acount_num": "123456789"
}
 

Request      

GET api/v1/staff/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the staff. Example: 1

Update the specified staff member in storage.

Example request:
curl --request PUT \
    "http://localhost/api/v1/staff/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"date_of_birth\": \"1990-01-01\",
    \"gender\": \"male\",
    \"address\": \"123 Main St\",
    \"phone_number\": \"123-456-7890\",
    \"email\": \"john.doe@example.com\",
    \"affectation_date\": \"2021-06-15\",
    \"contrat_type\": \"CDI\",
    \"function\": \"teacher\",
    \"n_cnss\": \"1234567890\",
    \"base_salary\": 3000,
    \"bank_acount_num\": \"123456789\"
}"
const url = new URL(
    "http://localhost/api/v1/staff/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "John",
    "last_name": "Doe",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "address": "123 Main St",
    "phone_number": "123-456-7890",
    "email": "john.doe@example.com",
    "affectation_date": "2021-06-15",
    "contrat_type": "CDI",
    "function": "teacher",
    "n_cnss": "1234567890",
    "base_salary": 3000,
    "bank_acount_num": "123456789"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "address": "123 Main St",
    "phone_number": "123-456-7890",
    "email": "john.doe@example.com",
    "affectation_date": "2021-06-15",
    "contrat_type": "CDI",
    "function": "teacher",
    "n_cnss": "1234567890",
    "base_salary": 3000,
    "bank_acount_num": "123456789"
}
 

Request      

PUT api/v1/staff/{id}

PATCH api/v1/staff/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the staff. Example: 1

Body Parameters

first_name   string  optional  

The new first name of the staff. Example: John

last_name   string  optional  

The new last name of the staff. Example: Doe

date_of_birth   date  optional  

The new date of birth of the staff. Example: 1990-01-01

gender   string  optional  

The new gender of the staff. Example: male

address   string  optional  

The new address of the staff. Example: 123 Main St

phone_number   string  optional  

The new phone number of the staff. Example: 123-456-7890

email   string  optional  

The new email of the staff. Example: john.doe@example.com

affectation_date   date  optional  

The new affectation date of the staff. Example: 2021-06-15

contrat_type   string  optional  

The new type of contract for the staff. Example: CDI

function   string  optional  

The new function of the staff. Example: teacher

n_cnss   string  optional  

The new CNSS number of the staff. Example: 1234567890

base_salary   number  optional  

The new base salary of the staff. Example: 3000

bank_acount_num   string  optional  

The new bank account number of the staff. Example: 123456789

Remove the specified staff member from storage.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/staff/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/staff/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Staff deleted successfully"
}
 

Request      

DELETE api/v1/staff/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the staff. Example: 1

Retrieve staff members where the function is 'teacher'.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/teachers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/teachers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "first_name": "Jane",
        "last_name": "Smith",
        "function": "teacher"
    }
]
 

Request      

GET api/v1/teachers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Students

Assign fee types to a student.

Example request:
curl --request POST \
    "http://localhost/api/v1/students/consequatur/fee-types" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fee_type_ids\": [
        1,
        2
    ]
}"
const url = new URL(
    "http://localhost/api/v1/students/consequatur/fee-types"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fee_type_ids": [
        1,
        2
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "FeeTypes assigned successfully."
}
 

Request      

POST api/v1/students/{student_id}/fee-types

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

student_id   string   

The ID of the student. Example: consequatur

student   integer   

The ID of the student. Example: 1

Body Parameters

fee_type_ids   string[]   

Array of fee type IDs.

List all students with their guardians and class.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/students" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/students"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


array<Student>
 

Request      

GET api/v1/students

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new student.

Example request:
curl --request POST \
    "http://localhost/api/v1/students" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "first_name=John"\
    --form "last_name=Doe"\
    --form "first_name_arab=Ψ¬ΩˆΩ†"\
    --form "last_name_arab=دو"\
    --form "gender=male"\
    --form "date_of_birth=2005-06-15"\
    --form "address=123 Main St"\
    --form "phone_number=0612345678"\
    --form "code_massar=123456"\
    --form "class_id=1"\
    --form "image=@C:\Users\pc\AppData\Local\Temp\php9E16.tmp" 
const url = new URL(
    "http://localhost/api/v1/students"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('first_name', 'John');
body.append('last_name', 'Doe');
body.append('first_name_arab', 'Ψ¬ΩˆΩ†');
body.append('last_name_arab', 'دو');
body.append('gender', 'male');
body.append('date_of_birth', '2005-06-15');
body.append('address', '123 Main St');
body.append('phone_number', '0612345678');
body.append('code_massar', '123456');
body.append('class_id', '1');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (201):


{
  "message": "Student created successfully.",
  "student": Student
}
 

Request      

POST api/v1/students

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

first_name   string   

The first name of the student. Example: John

last_name   string   

The last name of the student. Example: Doe

first_name_arab   string   

The student's first name in Arabic. Example: Ψ¬ΩˆΩ†

last_name_arab   string   

The student's last name in Arabic. Example: دو

gender   string   

The student's gender. Example: male

date_of_birth   date   

The student's date of birth. Example: 2005-06-15

address   string  optional  

The student's address. Example: 123 Main St

phone_number   string  optional  

The student's phone number. Example: 0612345678

code_massar   string  optional  

The student's Massar code. Example: 123456

class_id   integer   

The class ID the student belongs to. Example: 1

image   file  optional  

The student’s image. Must be jpg, jpeg, or png. Example: C:\Users\pc\AppData\Local\Temp\php9E16.tmp

Get a specific student with guardians.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/students/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/students/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


Student
 

Request      

GET api/v1/students/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the student. Example: 17

student   integer   

The ID of the student. Example: 1

Update a student.

Example request:
curl --request PUT \
    "http://localhost/api/v1/students/17" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "first_name=John"\
    --form "last_name=Doe"\
    --form "first_name_arab=qxbajwbpilpmufinllwlo"\
    --form "last_name_arab=auydlsmsjuryvojcybzvr"\
    --form "date_of_birth=2025-08-02T01:17:32"\
    --form "gender=male"\
    --form "address=byickznkygloigmkwxphl"\
    --form "phone_number=vazjrcnfbaqywuxhg"\
    --form "code_massar=jjmzuxjubqouzswiwxtrk"\
    --form "class_id=17"\
    --form "guardians[]=consequatur"\
    --form "image=@C:\Users\pc\AppData\Local\Temp\php9E27.tmp" 
const url = new URL(
    "http://localhost/api/v1/students/17"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('first_name', 'John');
body.append('last_name', 'Doe');
body.append('first_name_arab', 'qxbajwbpilpmufinllwlo');
body.append('last_name_arab', 'auydlsmsjuryvojcybzvr');
body.append('date_of_birth', '2025-08-02T01:17:32');
body.append('gender', 'male');
body.append('address', 'byickznkygloigmkwxphl');
body.append('phone_number', 'vazjrcnfbaqywuxhg');
body.append('code_massar', 'jjmzuxjubqouzswiwxtrk');
body.append('class_id', '17');
body.append('guardians[]', 'consequatur');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());

Example response (200):


Student
 

Request      

PUT api/v1/students/{id}

PATCH api/v1/students/{id}

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the student. Example: 17

student   integer   

The ID of the student. Example: 1

Body Parameters

first_name   string   

The first name. Example: John

last_name   string   

The last name. Example: Doe

first_name_arab   string  optional  

Must not be greater than 255 characters. Example: qxbajwbpilpmufinllwlo

last_name_arab   string  optional  

Must not be greater than 255 characters. Example: auydlsmsjuryvojcybzvr

date_of_birth   string  optional  

Must be a valid date. Example: 2025-08-02T01:17:32

gender   string  optional  

Example: male

Must be one of:
  • male
  • female
  • other
address   string  optional  

Must not be greater than 255 characters. Example: byickznkygloigmkwxphl

phone_number   string  optional  

Must not be greater than 20 characters. Example: vazjrcnfbaqywuxhg

code_massar   string  optional  

Must not be greater than 191 characters. Example: jjmzuxjubqouzswiwxtrk

class_id   integer  optional  

The id of an existing record in the classes table. Example: 17

image   file  optional  

Optional image (jpg, jpeg, png, gif). Example: C:\Users\pc\AppData\Local\Temp\php9E27.tmp

guardians   string[]  optional  

List of guardian IDs.

Delete a student.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/students/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/students/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/v1/students/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the student. Example: 17

student   integer   

The ID of the student. Example: 1

Get a student's profile image.

Example request:
curl --request GET \
    --get "http://localhost/api/v1/students/profile-image/avatar.jpg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/students/profile-image/avatar.jpg"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


file Returns the student image file.
 

Example response (404):


{
    "message": "Image not found."
}
 

Request      

GET api/v1/students/profile-image/{filename}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

filename   string   

The name of the image file. Example: avatar.jpg