MENU navbar-image

Introduction

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

Authenticating requests

This API is not authenticated.

Appointment management

APIs to manage appointment resources

Show all appointments.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
 

{
    "data": [
        {
            "id": 1,
            "doctor_id": 8,
            "service_id": 5,
            "date": "2024-12-06",
            "start_time": "12:30",
            "end_time": "13:30",
            "is_reserved": null
        },
        {
            "id": 2,
            "doctor_id": 8,
            "service_id": 5,
            "date": "2024-12-06",
            "start_time": "12:30",
            "end_time": "13:30",
            "is_reserved": null
        }
    ]
}
 

Request      

GET api/appointment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create an appointment

Example request:
curl --request POST \
    "http://localhost:8000/api/appointment/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"doctor_id\": null,
    \"service_id\": null,
    \"date\": \"2024-10-01\",
    \"start_time\": \"09:00\",
    \"end_time\": \"10:30\"
}"
const url = new URL(
    "http://localhost:8000/api/appointment/create"
);

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

let body = {
    "doctor_id": null,
    "service_id": null,
    "date": "2024-10-01",
    "start_time": "09:00",
    "end_time": "10:30"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'doctor_id' => null,
            'service_id' => null,
            'date' => '2024-10-01',
            'start_time' => '09:00',
            'end_time' => '10:30',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "success",
    "message": "Appointment created successfully.",
    "appointment": {
        "doctor_id": 8,
        "service_id": 5,
        "date": "2024-12-02",
        "start_time": "12:30",
        "end_time": "13:00",
        "tag": "reserved"
    },
    "intervals": {
        "headers": {},
        "original": {
            "intervals": [
                {
                    "start_time": "12:15",
                    "end_time": "12:30",
                    "tag": "not reserved"
                },
                {
                    "start_time": "12:30",
                    "end_time": "13:00",
                    "tag": "reserved"
                },
                {
                    "start_time": "13:00",
                    "end_time": "13:15",
                    "tag": "not reserved"
                }
            ]
        },
        "exception": null
    }
}
 

Example response (404, the end time of the appointment should be after the start time):


{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "end_time": [
            "The end time must be after the start time."
        ]
    }
}
 

Example response (404, the date parameter should be today or a future date):


{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "date": [
            "The appointment date must be today or a future date."
        ]
    }
}
 

Request      

POST api/appointment/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

doctor_id   integer   

The id of the doctor associated with the appointment.

service_id   integer   

The id of the service for the appointment.

date   string   

The date of the appointment in 'Y-m-d' format. Example: 2024-10-01

start_time   string   

The start time of the appointment in 'H:i' format. Must be within the doctor's available working hours. Example: 09:00

end_time   string   

The end time of the appointment in 'H:i' format. Must be after the start time and within the doctor's available working hours. Example: 10:30

Get all appointments by doctor

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

const params = {
    "doctor_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());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/getAppointmentsByDoctor';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'doctor_id' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": [
        {
            "id": 1,
            "doctor_id": 8,
            "service_id": 5,
            "date": "2024-12-02",
            "start_time": "12:30",
            "end_time": "13:00",
            "tag": "reserved",
            "created_at": "2024-10-11T22:02:41.000000Z",
            "updated_at": "2024-10-11T22:02:41.000000Z"
        }
    ]
}
 

Example response (200, request was successful but no appointments):


{
    "status": "Request was successful",
    "message": "success",
    "data": []
}
 

Example response (404, there is no doctor associated with the specifiedid):


{
    "status": "error",
    "message": "There is no doctor with this id",
    "data": ""
}
 

Request      

GET api/appointment/getAppointmentsByDoctor

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

doctor_id   integer   

The id of the doctor whose appointments should be retrieved. Example: 1

Get all appointments by doctor and date

Example request:
curl --request GET \
    --get "http://localhost:8000/api/appointment/getAppointmentsByDoctorAndDate?doctor_id=0&date=%222024-10-15%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/appointment/getAppointmentsByDoctorAndDate"
);

const params = {
    "doctor_id": "0",
    "date": ""2024-10-15"",
};
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());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/getAppointmentsByDoctorAndDate';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'doctor_id' => '0',
            'date' => '"2024-10-15"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "success",
    "message": "Appointments retrieved successfully.",
    "appointments": [
        {
            "doctor_name": "mahmoud mohamed",
            "service_name": "teeth removal",
            "date": "2024-12-2",
            "start_time": "12:30",
            "end_time": "13:00"
        }
    ],
    "intervals": {
        "headers": {},
        "original": {
            "intervals": [
                {
                    "start_time": "12:15",
                    "end_time": "12:30",
                    "tag": "not reserved"
                },
                {
                    "start_time": "12:30",
                    "end_time": "13:00",
                    "tag": "reserved"
                },
                {
                    "start_time": "13:00",
                    "end_time": "13:15",
                    "tag": "not reserved"
                }
            ]
        },
        "exception": null
    }
}
 

Example response (404, there is no doctor associated with the specifiedid):


{
    "status": "error",
    "message": "There is no doctor with this id",
    "data": ""
}
 

Request      

GET api/appointment/getAppointmentsByDoctorAndDate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

doctor_id   integer   

The id of the doctor whose appointments should be retrieved. Example: 0

date   string   

date The date for which to retrieve appointments. Example: "2024-10-15"

update appointment

Example request:
curl --request PUT \
    "http://localhost:8000/api/appointment/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"doctor_id\": null,
    \"service_id\": null,
    \"date\": \"2024-10-01\",
    \"start_time\": \"09:00\",
    \"end_time\": \"10:30\"
}"
const url = new URL(
    "http://localhost:8000/api/appointment/1"
);

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

let body = {
    "doctor_id": null,
    "service_id": null,
    "date": "2024-10-01",
    "start_time": "09:00",
    "end_time": "10:30"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'doctor_id' => null,
            'service_id' => null,
            'date' => '2024-10-01',
            'start_time' => '09:00',
            'end_time' => '10:30',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request has been successful):


{
    "status": "Request was successful",
    "message": "appointment has been updated successfully",
    "data": {
        "id": 1,
        "doctor_id": 8,
        "service_id": 5,
        "date": "2024-12-06",
        "start_time": "12:30",
        "end_time": "13:30",
        "tag": "reserved",
        "created_at": "2024-10-11T22:02:41.000000Z",
        "updated_at": "2024-10-12T00:33:44.000000Z"
    }
}
 

Example response (404, there is no appointment with the specified id):


{
    "status": "error",
    "message": "there is no appointment with the specified id",
    "data": ""
}
 

Example response (404, the date parameter should be a future date):


{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "date": [
            "The appointment date must be today or a future date."
        ]
    }
}
 

Example response (404, the end time of the appointment should be after the start time):


{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "end_time": [
            "The end time must be after the start time."
        ]
    }
}
 

Example response (404, there is no doctor with the specified id):


{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "doctor_id": [
            "The specified doctor does not exist in our records."
        ]
    }
}
 

Example response (404, there is no service with the specified id):


{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "service_id": [
            "The specified service does not exist in our records."
        ]
    }
}
 

Request      

PUT api/appointment/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the appointment. Example: 1

Body Parameters

doctor_id   integer   

The id of the doctor associated with the appointment.

service_id   integer   

The id of the service for the appointment.

date   string   

The date of the appointment in 'Y-m-d' format. Example: 2024-10-01

start_time   string   

The start time of the appointment in 'H:i' format. Must be within the doctor's available working hours. Example: 09:00

end_time   string   

The end time of the appointment in 'H:i' format. Must be after the start time and within the doctor's available working hours. Example: 10:30

DELETE api/appointment/{id}

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

DELETE api/appointment/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the appointment. Example: 1

Auth management

APIs to manage Auth resources

login

Example request:
curl --request POST \
    "http://localhost:8000/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"voluptatem\",
    \"password\": \"-lQ]pn]2D5WfZ\"
}"
const url = new URL(
    "http://localhost:8000/api/login"
);

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

let body = {
    "name": "voluptatem",
    "password": "-lQ]pn]2D5WfZ"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'voluptatem',
            'password' => '-lQ]pn]2D5WfZ',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, user logged in successfully):


{
    "status": "Request was successful",
    "message": "user logged in successfully",
    "data": {
        "user": {
            "id": 1,
            "name": "ahmed ismail",
            "created_at": "2024-10-12T22:04:34.000000Z",
            "updated_at": "2024-10-12T22:04:34.000000Z"
        },
        "token": "5|xK7B7IWh0cEdrEwTJCQJwGWUnsEvMTc6QxkAFFVz59a8a498"
    }
}
 

Example response (404, the specified user doesn't exist):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name": [
            "This user doesn't exist."
        ]
    }
}
 

Example response (404, wrong password):


{
    "status": "error",
    "message": "the password isn't correct",
    "data": null
}
 

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Example: voluptatem

password   string   

Must be at least 6 characters. Example: -lQ]pn]2D5WfZ

create a user

Example request:
curl --request POST \
    "http://localhost:8000/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"unqfddctubculjijoy\",
    \"password\": \"y!^W1tH]fsl8Qz^Rm\"
}"
const url = new URL(
    "http://localhost:8000/api/register"
);

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

let body = {
    "name": "unqfddctubculjijoy",
    "password": "y!^W1tH]fsl8Qz^Rm"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/register';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'unqfddctubculjijoy',
            'password' => 'y!^W1tH]fsl8Qz^Rm',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, user has been created successfully):


{
    "status": "Request was successful",
    "message": "user has been created successfully",
    "data": {
        "user": {
            "name": "ahmed",
            "updated_at": "2024-10-12T22:07:57.000000Z",
            "created_at": "2024-10-12T22:07:57.000000Z",
            "id": 3
        },
        "token": "3|vUhBeVm8bRTlKl8UsgInOL7p6RGvHiqeuxZYpngJ5e93c06e"
    }
}
 

Example response (404, username has already been taken):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name": [
            "This username has already been taken."
        ]
    }
}
 

Request      

POST api/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: unqfddctubculjijoy

password   string   

Must be at least 8 characters. Example: y!^W1tH]fsl8Qz^Rm

0   string  optional  

reset password

Example request:
curl --request POST \
    "http://localhost:8000/api/reset" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"velit\",
    \"old_password\": \"wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz\",
    \"new_password\": \"sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx\"
}"
const url = new URL(
    "http://localhost:8000/api/reset"
);

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

let body = {
    "name": "velit",
    "old_password": "wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz",
    "new_password": "sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/reset';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'velit',
            'old_password' => 'wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz',
            'new_password' => 'sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, password reset successfully):


{
"status": "Request was successful",
"message": "Password has been successfully updated.",
"data": null
}
}
 

Example response (404, incorrect old password):


{
    "status": "error",
    "message": "The old password isn't correct.",
    "data": null
}
 

Example response (404, new password confirmation does not match):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "new_password": [
            "The new password confirmation does not match."
        ]
    }
}
 

Request      

POST api/reset

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Example: velit

old_password   string   

Must be at least 6 characters. Example: wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz

new_password   string   

Must be at least 6 characters. Example: sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx

POST api/logout

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

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

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, logged out successfully):


{
    "status": "Request was successful",
    "message": "logged out successfully",
    "data": null
}
 

Example response (404, unauthenticated):


{
    "message": "Unauthenticated."
}
 

Request      

POST api/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Cashier management

APIs to manage Cashier resources

show all cashiers

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


"success"
{
"status": "Request was successful",
"message": "cashier returned successfully",
"data": {
"data": [
{
"id": 3,
"group": "surgery",
"code": "548",
"service_id": 5,
"doctor_id": 8,
"QTY": 50,
"price": 260,
"total": 13000,
"discount": 85,
"value": 11050,
"net_price": 1950
},
{
"id": 4,
"group": "surgery",
"code": "54217",
"service_id": 5,
"doctor_id": 8,
"QTY": 2,
"price": 260,
"total": 520,
"discount": 10,
"value": 52,
"net_price": 468
}
],
"meta": {
"total_cashiers": 2
}
}
}
 

Request      

GET api/cashier

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store cashier

Example request:
curl --request POST \
    "http://localhost:8000/api/cashier/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"group\": \"General\",
    \"code\": \"1234\",
    \"service_id\": \"suscipit\",
    \"doctor_id\": \"ut\",
    \"QTY\": 3,
    \"discount\": 10,
    \"service\": null,
    \"doctor\": null
}"
const url = new URL(
    "http://localhost:8000/api/cashier/create"
);

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

let body = {
    "group": "General",
    "code": "1234",
    "service_id": "suscipit",
    "doctor_id": "ut",
    "QTY": 3,
    "discount": 10,
    "service": null,
    "doctor": null
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'group' => 'General',
            'code' => '1234',
            'service_id' => 'suscipit',
            'doctor_id' => 'ut',
            'QTY' => 3,
            'discount' => 10,
            'service' => null,
            'doctor' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, The request was successful):


{
    "status": "Request was successful",
    "message": "Cashier created successfully",
    "data": {
        "id": 82,
        "group": "surgery",
        "code": "5473",
        "service": "teeth removal",
        "doctor": "mahmoud ali",
        "QTY": "2",
        "price": 100,
        "total": 200,
        "discount": "10",
        "value": 20,
        "net_price": 180
    }
}
 

Example response (404, The code has already been taken):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "code": [
            "The code has already been taken."
        ]
    }
}
 

Example response (422, missing parameters):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "group": [
            "The service group is required."
        ],
        "code": [
            "The code is required."
        ],
        "service": [
            "The service name is required."
        ],
        "doctor": [
            "The doctor's name is required."
        ],
        "QTY": [
            "The QTY is required."
        ],
        "discount": [
            "The discount is required."
        ]
    }
}
 

Request      

POST api/cashier/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

group   string   

The name of the service group. Must refer to an existing service group. Example: General

code   string   

A unique code for the cashier entry. Example: 1234

service_id   string   

Example: suscipit

doctor_id   string   

Example: ut

QTY   integer   

The quantity of the service provided. Example: 3

discount   integer  optional  

optional The discount applied to the service. Example: 10

service   integer   

The id of the service, must exist in the database.

doctor   integer   

The id of a doctor, must exist in the database.

GET api/cashier/{id}

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/80';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, The request was successful):


{
    "status": "Request was successful",
    "message": "cashier deleted successfully",
    "data": {
        "id": 3,
        "group": "surgery",
        "code": "548",
        "service_id": 5,
        "doctor_id": 8,
        "QTY": 50,
        "price": 260,
        "total": 13000,
        "discount": 85,
        "value": 11050,
        "net_price": 1950
    }
}
 

Example response (404, There is no cashier with the specified ID):


{
    "status": "error",
    "message": "There is no cashier with this ID",
    "data": ""
}
 

Request      

GET api/cashier/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cashier. Example: 80

update cashier

Example request:
curl --request PUT \
    "http://localhost:8000/api/cashier/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"group\": \"General\",
    \"code\": \"1234\",
    \"service_id\": \"ullam\",
    \"doctor_id\": \"quis\",
    \"QTY\": 3,
    \"discount\": 10,
    \"service\": null,
    \"doctor\": null
}"
const url = new URL(
    "http://localhost:8000/api/cashier/3"
);

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

let body = {
    "group": "General",
    "code": "1234",
    "service_id": "ullam",
    "doctor_id": "quis",
    "QTY": 3,
    "discount": 10,
    "service": null,
    "doctor": null
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/3';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'group' => 'General',
            'code' => '1234',
            'service_id' => 'ullam',
            'doctor_id' => 'quis',
            'QTY' => 3,
            'discount' => 10,
            'service' => null,
            'doctor' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, the cashier has been created successfully):


{
    "status": "Request was successful",
    "message": "Cashier has been created successfully",
    "data": {
        "id": 3,
        "group": "surgery",
        "code": "548",
        "service_id": "5",
        "doctor_id": "8",
        "QTY": "50",
        "price": 260,
        "total": 13000,
        "discount": "85",
        "value": 11050,
        "net_price": 1950
    }
}
 

Example response (404, The code has already been taken):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "code": [
            "The code has already been taken."
        ]
    }
}
 

Example response (404, This id doesn't exit in our database):


{
    "status": "error",
    "message": "There is no cashier with this ID",
    "data": ""
}
 

Example response (404, The selected service or doctor aren't in database):


{
{
"status": "error",
"message": "Validation failed",
"data": {
"service": [
"there is no service with the provided name"
],
"doctor": [
"there is no doctor with the provided name"
]
}
}
 

Example response (422, missing parameters):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "group": [
            "The service group is required."
        ],
        "code": [
            "The code is required."
        ],
        "service": [
            "The service name is required."
        ],
        "doctor": [
            "The doctor's name is required."
        ],
        "QTY": [
            "The QTY is required."
        ],
        "discount": [
            "The discount is required."
        ]
    }
}
 

Request      

PUT api/cashier/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cashier. Example: 3

Body Parameters

group   string   

The name of the service group. Must refer to an existing service group. Example: General

code   string   

A unique code for the cashier entry. Example: 1234

service_id   string   

Example: ullam

doctor_id   string   

Example: quis

QTY   integer   

The quantity of the service provided. Example: 3

discount   integer  optional  

optional The discount applied to the service. Example: 10

service   string   

The name of the service, must exist in the database.

doctor   string   

The doctor's name, must exist in the database.

Remove the specified resource from storage.

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/723';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (404, This id doesn't exit in our database):


{
    "status": "error",
    "message": "There is no cashier with this ID",
    "data": ""
}
 

Request      

DELETE api/cashier/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cashier. Example: 723

Doctor management

APIs to manage Doctor resources

Display Doctors

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": [
        {
            "id": 8,
            "name": "mahmoud mohamed",
            "code": "215615651235",
            "type": "advisor",
            "specialization": "surgeon",
            "work_days": "[\"sunday\",\"monday\",\"friday\"]",
            "start_time": "12:15:00",
            "end_time": "13:15:00",
            "created_at": "2024-10-11T08:07:43.000000Z",
            "updated_at": "2024-10-11T08:07:43.000000Z"
        }
    ]
}
 

Request      

GET api/doctor

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

create doctor

Example request:
curl --request POST \
    "http://localhost:8000/api/doctor/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Dr. John Doe\",
    \"code\": \"DOC123\",
    \"type\": \"General\",
    \"specialization\": \"Cardiologist\",
    \"work_days\": [
        \"Monday\",
        \"Wednesday\",
        \"Friday\"
    ],
    \"start_time\": \"09:00\",
    \"end_time\": \"17:00\"
}"
const url = new URL(
    "http://localhost:8000/api/doctor/create"
);

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

let body = {
    "name": "Dr. John Doe",
    "code": "DOC123",
    "type": "General",
    "specialization": "Cardiologist",
    "work_days": [
        "Monday",
        "Wednesday",
        "Friday"
    ],
    "start_time": "09:00",
    "end_time": "17:00"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Dr. John Doe',
            'code' => 'DOC123',
            'type' => 'General',
            'specialization' => 'Cardiologist',
            'work_days' => [
                'Monday',
                'Wednesday',
                'Friday',
            ],
            'start_time' => '09:00',
            'end_time' => '17:00',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": {
        "name": "mahmoud mohamed",
        "code": "215615651235",
        "type": "advisor",
        "specialization": "surgeon",
        "start_time": "12:15",
        "end_time": "13:15",
        "work_days": "[\"sunday\",\"monday\",\"friday\"]",
        "updated_at": "2024-10-11T08:07:43.000000Z",
        "created_at": "2024-10-11T08:07:43.000000Z",
        "id": 8
    }
}
 

Example response (404, name or code already exists):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name": [
            "This doctor name already exists."
        ],
        "code": [
            "This doctor code already exists."
        ]
    }
}
 

Example response (422, missing parameters):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name": [
            "The name field is required."
        ],
        "code": [
            "The code field is required."
        ],
        "type": [
            "The type field is required."
        ],
        "specialization": [
            "The specialization field is required."
        ],
        "work_days": [
            "The work_days field is required."
        ],
        "start_time": [
            "The start time field is required."
        ],
        "end_time": [
            "The end time field is required."
        ]
    }
}
 

Request      

POST api/doctor/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The doctor's full name. Example: Dr. John Doe

code   string   

A unique doctor code. Example: DOC123

type   string   

The type of the doctor. Can be 'General' or 'Specialist'. Example: General

specialization   string   

The doctor's specialization. Example: Cardiologist

work_days   string[]   

The working days for the doctor. You can enter between 1 and 7 values. Valid values are 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'.

start_time   string   

The doctor's start time in 'HH:MM' format. Must be earlier than the end time. Example: 09:00

end_time   string   

The doctor's end time in 'HH:MM' format. Must be later than the start time. Example: 17:00

Display doctor by id

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/6';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": {
        "id": 1,
        "name": "mahmoud ali",
        "code": "215615651231",
        "type": "advisor",
        "specialization": "surgeon",
        "work_days": "[\"sunday\",\"monday\",\"friday\"]",
        "start_time": "12:15:00",
        "end_time": "13:15:00",
        "created_at": "2024-09-30T05:22:36.000000Z",
        "updated_at": "2024-09-30T05:22:36.000000Z"
    }
}
 

Example response (404, There is no doctor with this ID):


"{
"status": "error",
"message": "There is no doctor with this ID",
"data": ""
}
 

Request      

GET api/doctor/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the doctor. Example: 6

PUT api/doctor/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/doctor/6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Dr. John Doe\",
    \"code\": \"DOC123\",
    \"type\": \"General\",
    \"specialization\": \"Cardiologist\",
    \"work_days\": [
        \"Monday\",
        \"Wednesday\",
        \"Friday\"
    ],
    \"start_time\": \"09:00\",
    \"end_time\": \"17:00\"
}"
const url = new URL(
    "http://localhost:8000/api/doctor/6"
);

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

let body = {
    "name": "Dr. John Doe",
    "code": "DOC123",
    "type": "General",
    "specialization": "Cardiologist",
    "work_days": [
        "Monday",
        "Wednesday",
        "Friday"
    ],
    "start_time": "09:00",
    "end_time": "17:00"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/6';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Dr. John Doe',
            'code' => 'DOC123',
            'type' => 'General',
            'specialization' => 'Cardiologist',
            'work_days' => [
                'Monday',
                'Wednesday',
                'Friday',
            ],
            'start_time' => '09:00',
            'end_time' => '17:00',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": [
        {
            "id": 70,
            "name": "Mrs. Chelsea Lind",
            "code": "DOC735",
            "type": "General",
            "specialization": "sed",
            "work_days": [
                "Wednesday",
                "Friday",
                "Monday",
                "Sunday",
                "Saturday"
            ],
            "start_time": "10:42:00",
            "end_time": "11:42:00"
        },
        {
            "id": 71,
            "name": "Caden Shanahan",
            "code": "DOC979",
            "type": "Specialist",
            "specialization": "veniam",
            "work_days": [
                "Thursday",
                "Tuesday",
                "Saturday",
                "Sunday",
                "Monday",
                "Friday",
                "Wednesday"
            ],
            "start_time": "05:20:00",
            "end_time": "07:17:00"
        }
    ]
}
 

Request      

PUT api/doctor/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the doctor. Example: 6

Body Parameters

name   string   

The doctor's full name. Example: Dr. John Doe

code   string   

A unique doctor code. Example: DOC123

type   string   

The type of the doctor. Can be 'General' or 'Specialist'. Example: General

specialization   string   

The doctor's specialization. Example: Cardiologist

work_days   string[]   

The working days for the doctor. You can enter between 1 and 7 values. Valid values are 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'.

start_time   string   

The doctor's start time in 'HH:MM' format. Must be earlier than the end time. Example: 09:00

end_time   string   

The doctor's end time in 'HH:MM' format. Must be later than the start time. Example: 17:00

Remove doctor from

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/8';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, the doctor has been deleted successfully):


{
    "status": "Request was successful",
    "message": "the doctor has been deleted successfully",
    "data": ""
}
 

Example response (404, there is no doctor with the specified id):


{
    "status": "error",
    "message": "There is no Doctor with this ID",
    "data": ""
}
 

Request      

DELETE api/doctor/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the doctor. Example: 8

Endpoints

GET api/user

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/user';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/myFatoorah/error

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/myFatoorah/error';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
content-type: text/html; charset=UTF-8
cache-control: no-cache, private
x-ratelimit-limit: 60
x-ratelimit-remaining: 53
access-control-allow-origin: *
 

errror
 

Request      

GET api/myFatoorah/error

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Hesabe payment gateway management

APIs to manage Hesabe payment gateway resources

POST api/hesabe/create

Example request:
curl --request POST \
    "http://localhost:8000/api/hesabe/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 1
}"
const url = new URL(
    "http://localhost:8000/api/hesabe/create"
);

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

let body = {
    "amount": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'amount' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/hesabe/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

amount   number   

Must match the regex /^\d+(.\d{1,3})?$/. Must be between 0.200 and 100000. Example: 1

POST api/hesabe/webhook

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

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

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/webhook';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/hesabe/webhook

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/hesabe/response

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/response';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (400):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 56
access-control-allow-origin: *
 

{
    "message": "Invalid payment response"
}
 

Request      

GET api/hesabe/response

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/hesabe/failure

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/failure';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (400):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 55
access-control-allow-origin: *
 

{
    "message": "Payment failed",
    "data": false
}
 

Request      

GET api/hesabe/failure

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

MyFotoorah payment gateway management

APIs to manage MyFatoorah resources

POST api/myFatoorah/pay

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

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

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/myFatoorah/pay';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/myFatoorah/pay

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/myFatoorah/callback

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/myFatoorah/callback';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 54
access-control-allow-origin: *
 

{
    "message": "Server Error"
}
 

Request      

GET api/myFatoorah/callback

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Patient attachment management

APIs to manage Patient attachment resources

Display all patients attachments

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "Patient attachments retrieved successfully",
    "data": [
        {
            "id": 1,
            "patient_id": 4,
            "civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
            "patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
            "report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
            "report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
            "other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
        },
        {
            "id": 2,
            "patient_id": 5,
            "civil_id_doc": "ali_saeed/ali_saeed_civil_id_doc.jpeg",
            "patient_status_doc": "ali_saeed/ali_saeed_patient_status_doc.jpg",
            "report_1_doc": "ali_saeed/ali_saeed_report_1_doc.jpeg",
            "report_2_doc": "ali_saeed/ali_saeed_report_2_doc.jpg",
            "other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
        }
    ]
}
 

Request      

GET api/patientAttachment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create new patient attachment

Example request:
curl --request POST \
    "http://localhost:8000/api/patientAttachment/create" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "patient_id=id"\
    --form "civil_id_doc=@/tmp/phpBee9BT" \
    --form "patient_status_doc=@/tmp/phpqBwrPx" \
    --form "report_1_doc=@/tmp/php3942nL" \
    --form "report_2_doc=@/tmp/phpUH15iK" \
    --form "other_document_doc=@/tmp/phpL6AWRl" 
const url = new URL(
    "http://localhost:8000/api/patientAttachment/create"
);

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

const body = new FormData();
body.append('patient_id', 'id');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'patient_id',
                'contents' => 'id'
            ],
            [
                'name' => 'civil_id_doc',
                'contents' => fopen('/tmp/phpBee9BT', 'r')
            ],
            [
                'name' => 'patient_status_doc',
                'contents' => fopen('/tmp/phpqBwrPx', 'r')
            ],
            [
                'name' => 'report_1_doc',
                'contents' => fopen('/tmp/php3942nL', 'r')
            ],
            [
                'name' => 'report_2_doc',
                'contents' => fopen('/tmp/phpUH15iK', 'r')
            ],
            [
                'name' => 'other_document_doc',
                'contents' => fopen('/tmp/phpL6AWRl', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, patient attachment has been created successflly):


{
    "status": "success",
    "data": {
        "patient_id": "4",
        "civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
        "patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
        "report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
        "report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
        "other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg",
        "updated_at": "2024-10-12T15:17:23.000000Z",
        "created_at": "2024-10-12T15:17:23.000000Z",
        "id": 1
    }
}
 

Example response (404, there is no patient for this id to add attachment to):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "patient_id": [
            "The selected patient id is invalid."
        ]
    }
}
 

Example response (404, the patient already has attachments assigned to):


{
    "status": "error",
    "message": "this patient already has attachment assigned to it",
    "data": {}
}
 

Request      

POST api/patientAttachment/create

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

patient_id   string   

Example: id

civil_id_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpBee9BT

patient_status_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpqBwrPx

report_1_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/php3942nL

report_2_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpUH15iK

other_document_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpL6AWRl

Display Patient attachments by id

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/283';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, success):


{
    "status": "Request was successful",
    "message": "patient attachments returned successfully",
    "data": {
        "id": 2,
        "patient_id": 4,
        "civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
        "patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
        "report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
        "report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
        "other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
    }
}
 

Example response (404, no patient attachments found with this id):


{
    "status": "error",
    "message": "There is no patient attachment with this ID",
    "data": ""
}
 

Request      

GET api/patientAttachment/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the patientAttachment. Example: 283

Update patient attachments

Example request:
curl --request PUT \
    "http://localhost:8000/api/patientAttachment/64" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "patient_id=veritatis"\
    --form "civil_id_doc=@/tmp/phpcbVd1v" \
    --form "patient_status_doc=@/tmp/phpPWkhpv" \
    --form "report_1_doc=@/tmp/phpU8GiBb" \
    --form "report_2_doc=@/tmp/phpjHr1sr" \
    --form "other_document_doc=@/tmp/phpxrwtHI" 
const url = new URL(
    "http://localhost:8000/api/patientAttachment/64"
);

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

const body = new FormData();
body.append('patient_id', 'veritatis');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/64';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'patient_id',
                'contents' => 'veritatis'
            ],
            [
                'name' => 'civil_id_doc',
                'contents' => fopen('/tmp/phpcbVd1v', 'r')
            ],
            [
                'name' => 'patient_status_doc',
                'contents' => fopen('/tmp/phpPWkhpv', 'r')
            ],
            [
                'name' => 'report_1_doc',
                'contents' => fopen('/tmp/phpU8GiBb', 'r')
            ],
            [
                'name' => 'report_2_doc',
                'contents' => fopen('/tmp/phpjHr1sr', 'r')
            ],
            [
                'name' => 'other_document_doc',
                'contents' => fopen('/tmp/phpxrwtHI', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, patient attachment has been updated successfully):


{
    "status": "Request was successful",
    "message": "patient attachment has been updated successfully",
    "data": {
        "id": 1,
        "patient_id": "4",
        "civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
        "patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
        "report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
        "report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
        "other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
    }
}
 

Example response (404, no patient attachments found with this id):


{
    "status": "error",
    "message": "There is no patient attachment with this ID",
    "data": ""
}
 

Request      

PUT api/patientAttachment/{id}

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the patientAttachment. Example: 64

Body Parameters

patient_id   string   

Example: veritatis

civil_id_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpcbVd1v

patient_status_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpPWkhpv

report_1_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpU8GiBb

report_2_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpjHr1sr

other_document_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpxrwtHI

Delete patient attachment

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/3721';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, patient attachments deleted successfully):


{
    "status": "Request was successful",
    "message": "the patient attachments  has been deleted successfully",
    "data": null
}
 

Example response (404, is no patient attachment with the specified ID):


{
    "status": "error",
    "message": "There is no patient attachment with this ID",
    "data": ""
}
 

Request      

DELETE api/patientAttachment/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the patientAttachment. Example: 3721

Patient management

APIs to manage Patient resources

Display all patients

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, success):


{
    "status": "Request was successful",
    "message": "success",
    "data": [
        {
            "id": 2,
            "name_english": "ali mohamed",
            "name_arabic": "أحمد علي",
            "email": "ahmed@gmail.com",
            "civil_id": "30201078908135",
            "phone_number": "01145684288",
            "nationality": "egyption",
            "city": "menofia",
            "gender": "male",
            "birth_date": "2002-08-08",
            "address": "64 altowheed stread",
            "insurance_company": "bank masr for life ensurance",
            "policy_holder": "mohomed hatem",
            "policy_number": "2262509",
            "policy_start_date": "2006-08-08",
            "policy_end_date": "2025-08-09",
            "notice": "i noticed",
            "how_did_you_know_about_us": "internet",
            "patient_status": null,
            "report_1": null,
            "report_2": null,
            "other_document": null,
            "transactions": []
        }
    ]
}
 

Request      

GET api/patient

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create patient

Example request:
curl --request POST \
    "http://localhost:8000/api/patient/create" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name_english=<faker>name</faker>"\
    --form "name_arabic=<faker>name</faker>"\
    --form "civil_id=<faker>numerify('##############')</faker>"\
    --form "phone_number=<faker>e164PhoneNumber</faker>"\
    --form "nationality=<faker>country</faker>"\
    --form "city=<faker>city</faker>"\
    --form "gender=<faker>randomElement(['male', 'female'])</faker>"\
    --form "birth_date=<faker>date('Y-m-d')</faker>"\
    --form "address=<faker>address</faker>"\
    --form "notice=mhbkttuzubhiartwjbehaj"\
    --form "insurance_company=<faker>company</faker>"\
    --form "policy_holder=<faker>name</faker>"\
    --form "policy_number=<faker>uuid</faker>"\
    --form "policy_start_date=<faker>date('Y-m-d')</faker>"\
    --form "policy_end_date=<faker>date('Y-m-d')</faker>"\
    --form "how_did_you_know_about_us=pldnqjnhdoqikncsegzjh"\
    --form "email=flesch@example.com"\
    --form "civil_id_doc=@/tmp/phpsHIWMF" \
    --form "patient_status_doc=@/tmp/phpwZqTDo" \
    --form "report_1_doc=@/tmp/phpXcufjM" \
    --form "report_2_doc=@/tmp/phpxANsdA" \
    --form "other_document_doc=@/tmp/php36eQQO" 
const url = new URL(
    "http://localhost:8000/api/patient/create"
);

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

const body = new FormData();
body.append('name_english', '<faker>name</faker>');
body.append('name_arabic', '<faker>name</faker>');
body.append('civil_id', '<faker>numerify('##############')</faker>');
body.append('phone_number', '<faker>e164PhoneNumber</faker>');
body.append('nationality', '<faker>country</faker>');
body.append('city', '<faker>city</faker>');
body.append('gender', '<faker>randomElement(['male', 'female'])</faker>');
body.append('birth_date', '<faker>date('Y-m-d')</faker>');
body.append('address', '<faker>address</faker>');
body.append('notice', 'mhbkttuzubhiartwjbehaj');
body.append('insurance_company', '<faker>company</faker>');
body.append('policy_holder', '<faker>name</faker>');
body.append('policy_number', '<faker>uuid</faker>');
body.append('policy_start_date', '<faker>date('Y-m-d')</faker>');
body.append('policy_end_date', '<faker>date('Y-m-d')</faker>');
body.append('how_did_you_know_about_us', 'pldnqjnhdoqikncsegzjh');
body.append('email', 'flesch@example.com');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name_english',
                'contents' => '<faker>name</faker>'
            ],
            [
                'name' => 'name_arabic',
                'contents' => '<faker>name</faker>'
            ],
            [
                'name' => 'civil_id',
                'contents' => '<faker>numerify('##############')</faker>'
            ],
            [
                'name' => 'phone_number',
                'contents' => '<faker>e164PhoneNumber</faker>'
            ],
            [
                'name' => 'nationality',
                'contents' => '<faker>country</faker>'
            ],
            [
                'name' => 'city',
                'contents' => '<faker>city</faker>'
            ],
            [
                'name' => 'gender',
                'contents' => '<faker>randomElement(['male', 'female'])</faker>'
            ],
            [
                'name' => 'birth_date',
                'contents' => '<faker>date('Y-m-d')</faker>'
            ],
            [
                'name' => 'address',
                'contents' => '<faker>address</faker>'
            ],
            [
                'name' => 'notice',
                'contents' => 'mhbkttuzubhiartwjbehaj'
            ],
            [
                'name' => 'insurance_company',
                'contents' => '<faker>company</faker>'
            ],
            [
                'name' => 'policy_holder',
                'contents' => '<faker>name</faker>'
            ],
            [
                'name' => 'policy_number',
                'contents' => '<faker>uuid</faker>'
            ],
            [
                'name' => 'policy_start_date',
                'contents' => '<faker>date('Y-m-d')</faker>'
            ],
            [
                'name' => 'policy_end_date',
                'contents' => '<faker>date('Y-m-d')</faker>'
            ],
            [
                'name' => 'how_did_you_know_about_us',
                'contents' => 'pldnqjnhdoqikncsegzjh'
            ],
            [
                'name' => 'email',
                'contents' => 'flesch@example.com'
            ],
            [
                'name' => 'civil_id_doc',
                'contents' => fopen('/tmp/phpsHIWMF', 'r')
            ],
            [
                'name' => 'patient_status_doc',
                'contents' => fopen('/tmp/phpwZqTDo', 'r')
            ],
            [
                'name' => 'report_1_doc',
                'contents' => fopen('/tmp/phpXcufjM', 'r')
            ],
            [
                'name' => 'report_2_doc',
                'contents' => fopen('/tmp/phpxANsdA', 'r')
            ],
            [
                'name' => 'other_document_doc',
                'contents' => fopen('/tmp/php36eQQO', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, patient has been created successfully):


{
    "status": "Request was successful",
    "message": "patient has been created successfully",
    "data": {
        "id": 2,
        "name_english": "ali mohamed",
        "name_arabic": "أحمد علي",
        "email": "ahmed@gmail.com",
        "civil_id": "30201078908135",
        "phone_number": "01145684288",
        "nationality": "egyption",
        "city": "menofia",
        "gender": "male",
        "birth_date": "2002-8-8",
        "address": "64 altowheed stread",
        "insurance_company": "bank masr for life ensurance",
        "policy_holder": "mohomed hatem",
        "policy_number": "2262509",
        "policy_start_date": "2006-8-8",
        "policy_end_date": "2025-8-9",
        "notice": "i noticed",
        "how_did_you_know_about_us": "internet",
        "patient_status": null,
        "report_1": null,
        "report_2": null,
        "other_document": null,
        "transactions": []
    }
}
 

Example response (404, civil id or email already exist):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "civil_id": [
            "This civil id already exists."
        ],
        "email": [
            "The email has already been taken."
        ]
    }
}
 

Request      

POST api/patient/create

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name_english   string   

The patient's name in English. Example: <faker>name</faker>

name_arabic   string   

The patient's name in Arabic. Example: <faker>name</faker>

civil_id   string   

The patient's 14-digit civil ID. Example: <faker>numerify('##############')</faker>

phone_number   string   

The patient's phone number. Example: <faker>e164PhoneNumber</faker>

nationality   string   

The patient's nationality. Example: <faker>country</faker>

city   string   

The city where the patient lives. Example: <faker>city</faker>

gender   string   

The patient's gender. Must be 'male' or 'female'. Example: <faker>randomElement(['male', 'female'])</faker>

birth_date   date   

The patient's birth date in 'YYYY-MM-DD' format. Example: <faker>date('Y-m-d')</faker>

address   string  optional  

optional The patient's address. Example: <faker>address</faker>

notice   string  optional  

Must not be greater than 255 characters. Example: mhbkttuzubhiartwjbehaj

insurance_company   string  optional  

optional The insurance company name. Example: <faker>company</faker>

policy_holder   string  optional  

optional The policy holder's name. Example: <faker>name</faker>

policy_number   string  optional  

optional The policy number. Example: <faker>uuid</faker>

policy_start_date   date  optional  

optional The policy start date in 'YYYY-MM-DD' format. Example: <faker>date('Y-m-d')</faker>

policy_end_date   date  optional  

optional The policy end date in 'YYYY-MM-DD' format. Example: <faker>date('Y-m-d')</faker>

how_did_you_know_about_us   string  optional  

Must not be greater than 255 characters. Example: pldnqjnhdoqikncsegzjh

civil_id_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpsHIWMF

patient_status_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpwZqTDo

report_1_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpXcufjM

report_2_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpxANsdA

other_document_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/php36eQQO

email   string  optional  

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

Display patient by id

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/324';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": {
        "id": 2,
        "name_english": "ali mohamed",
        "name_arabic": "أحمد علي",
        "email": "ahmed@gmail.com",
        "civil_id": "30201078908135",
        "phone_number": "01145684288",
        "nationality": "egyption",
        "city": "menofia",
        "gender": "male",
        "birth_date": "2002-08-08",
        "address": "64 altowheed stread",
        "insurance_company": "bank masr for life ensurance",
        "policy_holder": "mohomed hatem",
        "policy_number": "2262509",
        "policy_start_date": "2006-08-08",
        "policy_end_date": "2025-08-09",
        "notice": "i noticed",
        "how_did_you_know_about_us": "internet",
        "patient_status": null,
        "report_1": null,
        "report_2": null,
        "other_document": null,
        "transactions": []
    }
}
 

Example response (404, no patient with the specified ID):


{
    "status": "error",
    "message": "There is no patient with this ID",
    "data": ""
}
 

Request      

GET api/patient/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the patient. Example: 324

Update patient.

Example request:
curl --request PUT \
    "http://localhost:8000/api/patient/45" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name_english=wirsqbmxyegpbkcphjbeozbra"\
    --form "name_arabic=brzqghpenbtwpefzrqep"\
    --form "civil_id=eum"\
    --form "phone_number=erktdtzobwvigqqujtzzibzcx"\
    --form "nationality=wcayxhibpbewwgzpqrj"\
    --form "city=gxoxjryvflzsrealthfanzq"\
    --form "gender=flaupb"\
    --form "birth_date=mbnewvzqlwmvtsvsbhj"\
    --form "address=oxiopedfuvtudmxm"\
    --form "notice=emvgqvqkh"\
    --form "insurance_company=fj"\
    --form "policy_holder=poglbmbgyawnvfoqxzgkjicai"\
    --form "policy_number=n"\
    --form "policy_start_date=ozjgyebpc"\
    --form "policy_end_date=mgyuigvulmhhmbdhhnixcl"\
    --form "how_did_you_know_about_us=bhppjx"\
    --form "email=bruen.raul@example.com"\
    --form "civil_id_doc=@/tmp/phpasOEWb" \
    --form "patient_status_doc=@/tmp/phppM0oLk" \
    --form "report_1_doc=@/tmp/phpYrcEQ0" \
    --form "report_2_doc=@/tmp/phpchaf3Z" \
    --form "other_document_doc=@/tmp/php7h6zu3" 
const url = new URL(
    "http://localhost:8000/api/patient/45"
);

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

const body = new FormData();
body.append('name_english', 'wirsqbmxyegpbkcphjbeozbra');
body.append('name_arabic', 'brzqghpenbtwpefzrqep');
body.append('civil_id', 'eum');
body.append('phone_number', 'erktdtzobwvigqqujtzzibzcx');
body.append('nationality', 'wcayxhibpbewwgzpqrj');
body.append('city', 'gxoxjryvflzsrealthfanzq');
body.append('gender', 'flaupb');
body.append('birth_date', 'mbnewvzqlwmvtsvsbhj');
body.append('address', 'oxiopedfuvtudmxm');
body.append('notice', 'emvgqvqkh');
body.append('insurance_company', 'fj');
body.append('policy_holder', 'poglbmbgyawnvfoqxzgkjicai');
body.append('policy_number', 'n');
body.append('policy_start_date', 'ozjgyebpc');
body.append('policy_end_date', 'mgyuigvulmhhmbdhhnixcl');
body.append('how_did_you_know_about_us', 'bhppjx');
body.append('email', 'bruen.raul@example.com');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/45';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name_english',
                'contents' => 'wirsqbmxyegpbkcphjbeozbra'
            ],
            [
                'name' => 'name_arabic',
                'contents' => 'brzqghpenbtwpefzrqep'
            ],
            [
                'name' => 'civil_id',
                'contents' => 'eum'
            ],
            [
                'name' => 'phone_number',
                'contents' => 'erktdtzobwvigqqujtzzibzcx'
            ],
            [
                'name' => 'nationality',
                'contents' => 'wcayxhibpbewwgzpqrj'
            ],
            [
                'name' => 'city',
                'contents' => 'gxoxjryvflzsrealthfanzq'
            ],
            [
                'name' => 'gender',
                'contents' => 'flaupb'
            ],
            [
                'name' => 'birth_date',
                'contents' => 'mbnewvzqlwmvtsvsbhj'
            ],
            [
                'name' => 'address',
                'contents' => 'oxiopedfuvtudmxm'
            ],
            [
                'name' => 'notice',
                'contents' => 'emvgqvqkh'
            ],
            [
                'name' => 'insurance_company',
                'contents' => 'fj'
            ],
            [
                'name' => 'policy_holder',
                'contents' => 'poglbmbgyawnvfoqxzgkjicai'
            ],
            [
                'name' => 'policy_number',
                'contents' => 'n'
            ],
            [
                'name' => 'policy_start_date',
                'contents' => 'ozjgyebpc'
            ],
            [
                'name' => 'policy_end_date',
                'contents' => 'mgyuigvulmhhmbdhhnixcl'
            ],
            [
                'name' => 'how_did_you_know_about_us',
                'contents' => 'bhppjx'
            ],
            [
                'name' => 'email',
                'contents' => 'bruen.raul@example.com'
            ],
            [
                'name' => 'civil_id_doc',
                'contents' => fopen('/tmp/phpasOEWb', 'r')
            ],
            [
                'name' => 'patient_status_doc',
                'contents' => fopen('/tmp/phppM0oLk', 'r')
            ],
            [
                'name' => 'report_1_doc',
                'contents' => fopen('/tmp/phpYrcEQ0', 'r')
            ],
            [
                'name' => 'report_2_doc',
                'contents' => fopen('/tmp/phpchaf3Z', 'r')
            ],
            [
                'name' => 'other_document_doc',
                'contents' => fopen('/tmp/php7h6zu3', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, patient has been updated successfully):


{
    "status": "Request was successful",
    "message": "the patient was updated successfully",
    "data": {
        "id": 3,
        "name_english": "abdelfatah mahmoud housein",
        "name_arabic": "أحمد علي",
        "email": "ahmed@gmail.com",
        "civil_id": "30204532890541",
        "phone_number": "01145684288",
        "nationality": "egyption",
        "city": "menofia",
        "gender": "male",
        "birth_date": "2002-8-20",
        "address": "64 altowheed stread",
        "insurance_company": "bank masr for life ensurance",
        "policy_holder": "mohomed hatem",
        "policy_number": "2262509",
        "policy_start_date": "2006-8-8",
        "policy_end_date": "2025-8-9",
        "notice": "i noticed",
        "how_did_you_know_about_us": "internet",
        "patient_status": null,
        "report_1": null,
        "report_2": null,
        "other_document": null,
        "transactions": []
    }
}
 

Example response (404, no patient with the specified ID):


{
    "status": "error",
    "message": "There is no patient with this ID",
    "data": ""
}
 

Request      

PUT api/patient/{id}

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the patient. Example: 45

Body Parameters

name_english   string   

Must not be greater than 255 characters. Example: wirsqbmxyegpbkcphjbeozbra

name_arabic   string   

Must not be greater than 255 characters. Example: brzqghpenbtwpefzrqep

civil_id   string   

Example: eum

phone_number   string   

Must not be greater than 255 characters. Example: erktdtzobwvigqqujtzzibzcx

nationality   string   

Must not be greater than 255 characters. Example: wcayxhibpbewwgzpqrj

city   string  optional  

Must not be greater than 255 characters. Example: gxoxjryvflzsrealthfanzq

gender   string   

Must not be greater than 255 characters. Example: flaupb

Must be one of:
  • male
  • female
birth_date   string   

Must not be greater than 255 characters. Example: mbnewvzqlwmvtsvsbhj

address   string  optional  

Must not be greater than 255 characters. Example: oxiopedfuvtudmxm

notice   string  optional  

Must not be greater than 255 characters. Example: emvgqvqkh

insurance_company   string  optional  

Must not be greater than 255 characters. Example: fj

policy_holder   string  optional  

Must not be greater than 255 characters. Example: poglbmbgyawnvfoqxzgkjicai

policy_number   string  optional  

Must not be greater than 255 characters. Example: n

policy_start_date   string  optional  

Must not be greater than 255 characters. Example: ozjgyebpc

policy_end_date   string  optional  

Must not be greater than 255 characters. Example: mgyuigvulmhhmbdhhnixcl

how_did_you_know_about_us   string  optional  

Must not be greater than 255 characters. Example: bhppjx

civil_id_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpasOEWb

patient_status_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phppM0oLk

report_1_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpYrcEQ0

report_2_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpchaf3Z

other_document_doc   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/php7h6zu3

email   string  optional  

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

Delete patient.

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/3';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, patient has been deleted successfully):


{
    "status": "Request was successful",
    "message": "the patient has been  deleted successfully",
    "data": null
}
 

Example response (404, no patient with the specified ID):


{
    "status": "error",
    "message": "There is no patient with this ID",
    "data": ""
}
 

Request      

DELETE api/patient/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the patient. Example: 3

Service group management

APIs to manage service group resources

Display a listing of the resource.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
 

[
    {
        "id": 4,
        "code": "451",
        "name": "teet",
        "created_at": "2024-10-11T07:48:13.000000Z",
        "updated_at": "2024-10-11T07:48:13.000000Z"
    },
    {
        "id": 5,
        "code": "4512",
        "name": "teeth",
        "created_at": "2024-10-11T07:48:23.000000Z",
        "updated_at": "2024-10-11T07:48:23.000000Z"
    }
]
 

Request      

GET api/serviceGroup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/serviceGroup/create

Example request:
curl --request POST \
    "http://localhost:8000/api/serviceGroup/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"pzxb\",
    \"name\": \"x\"
}"
const url = new URL(
    "http://localhost:8000/api/serviceGroup/create"
);

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

let body = {
    "code": "pzxb",
    "name": "x"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'code' => 'pzxb',
            'name' => 'x',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": [
        {
            "id": 68,
            "code": "quis",
            "name": "aut"
        },
        {
            "id": 69,
            "code": "blanditiis",
            "name": "voluptatem"
        }
    ]
}
 

Example response (200, the service group created successfully):


{
    "status": "Request was successful",
    "message": "the service group has been created successfully",
    "data": {
        "code": "45123",
        "name": "surgery",
        "updated_at": "2024-10-11T07:35:31.000000Z",
        "created_at": "2024-10-11T07:35:31.000000Z",
        "id": 2
    }
}
 

Example response (404, code or name already exist):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "code": [
            "the specified code already exists"
        ],
        "name": [
            "the specified name already exists"
        ]
    }
}
 

Example response (422, required parameters missing):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "code": [
            "the service group code is required"
        ],
        "name": [
            "service group name is required"
        ]
    }
}
 

Request      

POST api/serviceGroup/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

code   string   

Must not be greater than 255 characters. Example: pzxb

name   string   

Must not be greater than 255 characters. Example: x

Display the specified resource.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
 

{
    "id": 4,
    "code": "451",
    "name": "teet",
    "created_at": "2024-10-11T07:48:13.000000Z",
    "updated_at": "2024-10-11T07:48:13.000000Z"
}
 

Request      

GET api/serviceGroup/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the serviceGroup. Example: 4

PUT api/serviceGroup/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/serviceGroup/4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"rcoxkeroldjtmqd\",
    \"name\": \"eyt\"
}"
const url = new URL(
    "http://localhost:8000/api/serviceGroup/4"
);

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

let body = {
    "code": "rcoxkeroldjtmqd",
    "name": "eyt"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/4';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'code' => 'rcoxkeroldjtmqd',
            'name' => 'eyt',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, the service group has been update successfully):


{
    "status": "Request was successful",
    "message": "the service group has been updated successfully",
    "data": {
        "code": "54564512",
        "name": "surgery"
    }
}
 

Example response (404, code or name already exist):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "code": [
            "the specified code already exists"
        ],
        "name": [
            "the specified name already exists"
        ]
    }
}
 

Example response (404, There is no service group with the specified ID):


{
    "status": "error",
    "message": "There is no service group with this ID",
    "data": ""
}
 

Request      

PUT api/serviceGroup/{id}

PATCH api/serviceGroup/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the serviceGroup. Example: 4

Body Parameters

code   string   

Must not be greater than 255 characters. Example: rcoxkeroldjtmqd

name   string   

Must not be greater than 255 characters. Example: eyt

Remove the specified resource from storage.

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/4';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, the service group has been deleted successfully):


{
    "status": "Request was successful",
    "message": "the service group has been  deleted successfully",
    "data": null
}
 

Example response (404, There is no service group with the specified ID):


{
    "status": "error",
    "message": "There is no service group with this ID",
    "data": ""
}
 

Request      

DELETE api/serviceGroup/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the serviceGroup. Example: 4

Services management

APIs to manage services resources

get all services

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


"request was successful"{
"status": "Request was successful",
"message": "success",
"data": {
"name_english": "teeth removal",
"name_arabic": "خلع أسنان",
"code": "05304545dssd555223",
"QTY": "20",
"cost": "210",
"price": "260",
"service_group_id": "2",
"updated_at": "2024-10-11T07:53:18.000000Z",
"created_at": "2024-10-11T07:53:18.000000Z",
"id": 4
}
}
 

Request      

GET api/service

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store services

Example request:
curl --request POST \
    "http://localhost:8000/api/service/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name_english\": \"tgkcmychgufvkjbfhmlvpahcg\",
    \"name_arabic\": \"jjtkwkvtfsrocuvildopobj\",
    \"code\": \"wrprssiqgz\",
    \"QTY\": 59,
    \"cost\": 31,
    \"price\": 29,
    \"service_group_id\": 3
}"
const url = new URL(
    "http://localhost:8000/api/service/create"
);

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

let body = {
    "name_english": "tgkcmychgufvkjbfhmlvpahcg",
    "name_arabic": "jjtkwkvtfsrocuvildopobj",
    "code": "wrprssiqgz",
    "QTY": 59,
    "cost": 31,
    "price": 29,
    "service_group_id": 3
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name_english' => 'tgkcmychgufvkjbfhmlvpahcg',
            'name_arabic' => 'jjtkwkvtfsrocuvildopobj',
            'code' => 'wrprssiqgz',
            'QTY' => 59,
            'cost' => 31,
            'price' => 29,
            'service_group_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


"service group created successfully"{
"status": "Request was successful",
"message": "the service group has been created successfully",
"data": {
"code": "4512",
"name": "teeth",
"updated_at": "2024-10-11T07:48:23.000000Z",
"created_at": "2024-10-11T07:48:23.000000Z",
"id": 5
}
}
 

Example response (400):


3 "code or name already exists"{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the specified code already exists"
],
"name": [
"the specified name already exists"
]
}
}
 

Example response (404, no service group with the specified id):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "service_group_id": [
            "there is no service group with this id"
        ]
    }
}
 

Request      

POST api/service/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name_english   string   

Must not be greater than 255 characters. Example: tgkcmychgufvkjbfhmlvpahcg

name_arabic   string   

Must not be greater than 255 characters. Example: jjtkwkvtfsrocuvildopobj

code   string   

Must not be greater than 255 characters. Example: wrprssiqgz

QTY   integer   

Must be at least 0. Example: 59

cost   number   

Must be at least 0. Example: 31

price   number   

Must be at least 0. Example: 29

service_group_id   integer   

Must be at least 1. Example: 3

Display Service by id

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/6230275';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": {
        "id": 4,
        "service_group_id": 2,
        "code": "05304545d555223",
        "name_english": "teeth removal",
        "name_arabic": "خلع أسنان",
        "QTY": 20,
        "cost": 210,
        "price": 260,
        "created_at": "2024-10-11T07:53:18.000000Z",
        "updated_at": "2024-10-11T07:53:18.000000Z"
    }
}
 

Example response (404, no service with the specified id):


{
    "status": "error",
    "message": "There is no service with this ID",
    "data": ""
}
 

Request      

GET api/service/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the service. Example: 6230275

update services

Example request:
curl --request PUT \
    "http://localhost:8000/api/service/41427630" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name_english\": \"kpaxwltgeitmxvahigfstdvw\",
    \"name_arabic\": \"inrkxhjsoprweqxwhzdn\",
    \"code\": \"mzb\",
    \"QTY\": 59,
    \"cost\": 40,
    \"price\": 3,
    \"service_group_id\": 18
}"
const url = new URL(
    "http://localhost:8000/api/service/41427630"
);

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

let body = {
    "name_english": "kpaxwltgeitmxvahigfstdvw",
    "name_arabic": "inrkxhjsoprweqxwhzdn",
    "code": "mzb",
    "QTY": 59,
    "cost": 40,
    "price": 3,
    "service_group_id": 18
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/41427630';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name_english' => 'kpaxwltgeitmxvahigfstdvw',
            'name_arabic' => 'inrkxhjsoprweqxwhzdn',
            'code' => 'mzb',
            'QTY' => 59,
            'cost' => 40,
            'price' => 3,
            'service_group_id' => 18,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


"service group created successfully"{
"status": "Request was successful",
"message": "the service group has been created successfully",
"data": {
"code": "4512",
"name": "teeth",
"updated_at": "2024-10-11T07:48:23.000000Z",
"created_at": "2024-10-11T07:48:23.000000Z",
"id": 5
}
}
 

Example response (400):


3 "code or name already exists"{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the specified code already exists"
],
"name": [
"the specified name already exists"
]
}
}
 

Example response (404, no service group with the specified id):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "service_group_id": [
            "there is no service group with this id"
        ]
    }
}
 

Example response (404, there is no service with the specified id):


{
    "status": "error",
    "message": "There is no service with this ID",
    "data": ""
}
 

Request      

PUT api/service/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the service. Example: 41427630

Body Parameters

name_english   string   

Must not be greater than 255 characters. Example: kpaxwltgeitmxvahigfstdvw

name_arabic   string   

Must not be greater than 255 characters. Example: inrkxhjsoprweqxwhzdn

code   string   

Must not be greater than 255 characters. Example: mzb

QTY   integer   

Must be at least 0. Example: 59

cost   number   

Must be at least 0. Example: 40

price   number   

Must be at least 0. Example: 3

service_group_id   integer   

Must be at least 1. Example: 18

delete service

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/725';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "the service has been deleted successfully",
    "data": null
}
 

Example response (404, there is no service with the specified id):


{
    "status": "error",
    "message": "There is no service with this ID",
    "data": ""
}
 

Request      

DELETE api/service/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the service. Example: 725

clinic management

APIs to manage clinic resources

Display all available clinics

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "status": "Request was successful",
    "message": "success",
    "data": [
        {
            "id": 5,
            "name_english": "surgery",
            "name_arabic": "جراحه",
            "specialization": "surgery",
            "location": "kweit",
            "address": "15 wall street",
            "phone": "0904562185",
            "mobile": "01236954812",
            "logo": "surgery/surgery_logo.jpg",
            "created_at": "2024-10-12T10:55:24.000000Z",
            "updated_at": "2024-10-12T10:55:24.000000Z"
        }
    ]
}
 

Request      

GET api/clinic

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create new clinic

Example request:
curl --request POST \
    "http://localhost:8000/api/clinic/create" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name_english=zrigvbkfklbwnlwn"\
    --form "name_arabic=jbmyq"\
    --form "specialization=apcvikcniojk"\
    --form "location=kjvsrvwah"\
    --form "address=ysg"\
    --form "phone=pyenfmk"\
    --form "mobile=qqwrphzgmeokzjuja"\
    --form "logo=@/tmp/phpmpiljG" 
const url = new URL(
    "http://localhost:8000/api/clinic/create"
);

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

const body = new FormData();
body.append('name_english', 'zrigvbkfklbwnlwn');
body.append('name_arabic', 'jbmyq');
body.append('specialization', 'apcvikcniojk');
body.append('location', 'kjvsrvwah');
body.append('address', 'ysg');
body.append('phone', 'pyenfmk');
body.append('mobile', 'qqwrphzgmeokzjuja');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name_english',
                'contents' => 'zrigvbkfklbwnlwn'
            ],
            [
                'name' => 'name_arabic',
                'contents' => 'jbmyq'
            ],
            [
                'name' => 'specialization',
                'contents' => 'apcvikcniojk'
            ],
            [
                'name' => 'location',
                'contents' => 'kjvsrvwah'
            ],
            [
                'name' => 'address',
                'contents' => 'ysg'
            ],
            [
                'name' => 'phone',
                'contents' => 'pyenfmk'
            ],
            [
                'name' => 'mobile',
                'contents' => 'qqwrphzgmeokzjuja'
            ],
            [
                'name' => 'logo',
                'contents' => fopen('/tmp/phpmpiljG', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, clinic created successfully):


{
    "status": "Request was successful",
    "message": "Clinic created successfully",
    "data": {
        "name_english": "surgery",
        "name_arabic": "جراحه",
        "specialization": "surgery",
        "location": "kweit",
        "address": "15 wall street",
        "phone": "0904562185",
        "mobile": "01236954812",
        "logo": "surgery/surgery_logo.jpg",
        "updated_at": "2024-10-12T10:35:36.000000Z",
        "created_at": "2024-10-12T10:35:36.000000Z",
        "id": 1
    }
}
 

Example response (404, name_english or name_arabic already exists):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name_english": [
            "This clinic english name already exists."
        ],
        "name_arabic": [
            "This clinic arabic name already exists."
        ]
    }
}
 

Example response (422, missing attributes):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name_english": [
            "The english name field is required."
        ],
        "name_arabic": [
            "The arabic name field is required."
        ],
        "specialization": [
            "The specialization field is required."
        ],
        "location": [
            "The location field is required."
        ],
        "address": [
            "The address field is required."
        ],
        "phone": [
            "The phone field is required."
        ]
    }
}
 

Request      

POST api/clinic/create

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name_english   string   

Must not be greater than 255 characters. Example: zrigvbkfklbwnlwn

name_arabic   string   

Must not be greater than 255 characters. Example: jbmyq

specialization   string   

Must not be greater than 255 characters. Example: apcvikcniojk

location   string   

Must not be greater than 255 characters. Example: kjvsrvwah

address   string   

Must not be greater than 255 characters. Example: ysg

phone   string   

Must not be greater than 255 characters. Example: pyenfmk

mobile   string  optional  

Must not be greater than 255 characters. Example: qqwrphzgmeokzjuja

logo   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpmpiljG

show a clinic by id

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/23';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, request was successful):


{
    "id": 5,
    "name_english": "surgery",
    "name_arabic": "جراحه",
    "specialization": "surgery",
    "location": "kweit",
    "address": "15 wall street",
    "phone": "0904562185",
    "mobile": "01236954812",
    "logo": "surgery/surgery_logo.jpg",
    "created_at": "2024-10-12T10:55:24.000000Z",
    "updated_at": "2024-10-12T10:55:24.000000Z"
}
 

Example response (404, no clinic with the specified id):


{
    "status": "error",
    "message": "There is no clinic with this ID",
    "data": ""
}
 

Request      

GET api/clinic/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the clinic. Example: 23

Update the specified resource in storage.

Example request:
curl --request PUT \
    "http://localhost:8000/api/clinic/95" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name_english=avsihdsracghupttkkcbrdyi"\
    --form "name_arabic=j"\
    --form "specialization=i"\
    --form "location=bqlouncitpuzruxvd"\
    --form "address=kenoxqewagpz"\
    --form "phone=yytapemmcfov"\
    --form "mobile=otmdqrcpmvmbcr"\
    --form "logo=@/tmp/phpAJ6Gut" 
const url = new URL(
    "http://localhost:8000/api/clinic/95"
);

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

const body = new FormData();
body.append('name_english', 'avsihdsracghupttkkcbrdyi');
body.append('name_arabic', 'j');
body.append('specialization', 'i');
body.append('location', 'bqlouncitpuzruxvd');
body.append('address', 'kenoxqewagpz');
body.append('phone', 'yytapemmcfov');
body.append('mobile', 'otmdqrcpmvmbcr');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/95';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name_english',
                'contents' => 'avsihdsracghupttkkcbrdyi'
            ],
            [
                'name' => 'name_arabic',
                'contents' => 'j'
            ],
            [
                'name' => 'specialization',
                'contents' => 'i'
            ],
            [
                'name' => 'location',
                'contents' => 'bqlouncitpuzruxvd'
            ],
            [
                'name' => 'address',
                'contents' => 'kenoxqewagpz'
            ],
            [
                'name' => 'phone',
                'contents' => 'yytapemmcfov'
            ],
            [
                'name' => 'mobile',
                'contents' => 'otmdqrcpmvmbcr'
            ],
            [
                'name' => 'logo',
                'contents' => fopen('/tmp/phpAJ6Gut', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, clinic updated successfully):


{
    "status": "Request was successful",
    "message": "Clinic updated successfully",
    "data": {
        "id": 1,
        "name_english": "brain surgery",
        "name_arabic": "جراحة المخ و الأعصاب",
        "specialization": "surgery",
        "location": "egypt",
        "address": "15 elnaser street",
        "phone": "0123598888",
        "mobile": "01236954812",
        "logo": "brain surgery/brain_surgery_logo.jpg",
        "created_at": "2024-10-12T10:35:36.000000Z",
        "updated_at": "2024-10-12T10:41:30.000000Z"
    }
}
 

Example response (404, no clinic with the specified id):


{
    "status": "error",
    "message": "There is no clinic with this ID",
    "data": ""
}
 

Example response (404, clinic name_english or name_arabic already exists):


{
    "status": "error",
    "message": "Validation failed",
    "data": {
        "name_english": [
            "This clinic english name already exists."
        ],
        "name_arabic": [
            "This clinic arabic name already exists."
        ]
    }
}
 

Example response (422, missing required attributes):


{
"status": "error",
"message": "Validation failed",
"data": {
"name_english": [
"The english name field is required."
],
"name_arabic": [
"The arabic name field is required."
],
"specialization": [
"The specialization field is required."
],
"location": [
"The location field is required."
],
"address": [
"The address field is required."
],
"phone": [
"The phone field is required."
]
}
 

Request      

PUT api/clinic/{id}

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the clinic. Example: 95

Body Parameters

name_english   string   

Must not be greater than 255 characters. Example: avsihdsracghupttkkcbrdyi

name_arabic   string   

Must not be greater than 255 characters. Example: j

specialization   string   

Must not be greater than 255 characters. Example: i

location   string   

Must not be greater than 255 characters. Example: bqlouncitpuzruxvd

address   string   

Must not be greater than 255 characters. Example: kenoxqewagpz

phone   string   

Must not be greater than 255 characters. Example: yytapemmcfov

mobile   string  optional  

Must not be greater than 255 characters. Example: otmdqrcpmvmbcr

logo   file  optional  

Must be an image. Must not be greater than 2048 kilobytes. Example: /tmp/phpAJ6Gut

DELETE api/clinic/{id}

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/2';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, clinic has been deleted successfully):


{
    "status": "Request was successful",
    "message": "the clinic has been deleted successfully",
    "data": ""
}
 

Example response (404, no clinic with the specified id):


{
    "status": "error",
    "message": "There is no service with this ID",
    "data": ""
}
 

Request      

DELETE api/clinic/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the clinic. Example: 2