I have used Laravel 5.3 to create this rest API, I only uploaded the files which I used, not the whole framework. Documentation: routes/web.php This file is where you may define all of the routes that are handled by the application. Order.php and User.php are Models, They are used to grab data from the database and pass them to the Controllers. Http/Controllers/OrderController.php This File is where most of the code is written, it is the controller which takes the input, check with the database using Models as stated above and then Returns a Json object.
Screenshots
Get Order that exists:
Get Order that doesnt exist:
Cancel Order:
Cancel Order That is already canceled:
Cancel Order that does not exist: