REST API for hotel management system with PHP
Postman documentation here
Method | URL | Parameters (form) | Description |
---|---|---|---|
POST | http://{host}/api/login.php | username: string * password: string * |
Returns a JWT if login successfully |
Method | URL | Parameters (JSON) | Description |
---|---|---|---|
GET | http://{host}/api/room | Show all rooms in JSON format | |
GET | http://{host}/api/room/{id} | Show selected room data in JSON format | |
POST | http://{host}/api/room | beds: integer * type: string cost_per_day: number * number: integer |
Add room in the database |
PATCH | http://{host}/api/room/{id} | beds: integer type: string cost_per_day: number number: integer |
Update room info |
DELETE | http://{host}/api/room/{id} | Delete room from database |
Method | URL | Parameters (JSON) | Description |
---|---|---|---|
GET | http://{host}/api/customer/ | Show all customers in JSON fomrat | |
GET | http://{host}/api/customer/{id} | Show selected customer data in JSON format | |
POST | http://{host}/api/customer/{id} | firstname: string * lastname: string * phone: string * |
Add customer in the database |
PATCH | http://{host}/api/customer/{id} | firstname: string lastname: string phone: string |
Update customer info |
DELETE | http://{host}/api/customer/{id} | Delete customer from database |
Method | URL | Parameters (JSON) | Description |
---|---|---|---|
GET | http://{host}/api/reservation/ | Show all customers in JSON fomrat | |
GET | http://{host}/api/reservation/{id} | Show selected customer data in JSON format | |
POST | http://{host}/api/reservation/{id} | checkin: string * checkout: string * customer_id: integer * room_id: integer * billed: boolean * breakfast: boolean * lunch: boolean * dinner: boolean * |
Add customer in the database |
PATCH | http://{host}/api/reservation/{id} | checkin: string checkout: string customer_id: integer room_id: integer billed: boolean breakfast: boolean lunch: boolean dinner: boolean |
Update customer info |
DELETE | http://{host}/api/reservation/{id} | Delete customer from database |