- Please use following url for api activities: http://rifqi-salestock.esy.es/api
- Please follow chapter 2. How to do API test using postman to use the API
- Assumptions and steps:
- By default, the application has 3 registered users with following credentials:
- Admin Role: email: admin@salestock.id; password: admin
- Customer Role: email: customer@salestock.id; password: customer
- Customer Role: email: rifqi96@yahoo.com; password: password
- Please use following Auth as header for every request:
Accept: application/jsonAuthorization: Bearer *YOUR-LOGIN-API-TOKEN*
- In order to get authorization token, please use following keyword using post method:
login
- To use keywords, please use following format:
http://rifqi-salestock.esy.es/api/{keyword}
- In order to use the API, please use URL from point 1 by using format from above instruction and use following available keywords:
- GET METHOD:
- ** Public is allowed: **
- products/ = Get All Products List
- products{product_id} = Get product details
- ** Needs Admin/User role Authentication: **
- orders/ = Get All Orders
- orders/{order_id} = Get order details
- orders/{order_id}/status = Get order status
- shipments/{shipment_id}/status = Get shipment status
- POST METHOD:
- ** Public is allowed: **
- register = Register
- login = Login
- ** Needs Admin/User role Authentication: **
- logout = Logout
- orders/add = Add product to an order
- orders/coupon = Add coupon to an order
- orders/submit = Submit an order
- orders/{order_id}/submit/proof = Submit proof to an order
- orders/{order_id}/ship = Ship an order
- orders/{order_id}/cancel = Cancel an order
- GET METHOD:
- Please download postman collection for more about how to use the API https://drive.google.com/open?id=10GQ_hfIf_D2gQXRyXeiJ9uxbSw3rJis5 (Detail explanation on next chapter)
- By default, the application has 3 registered users with following credentials:
- Download postman collection: https://drive.google.com/open?id=10GQ_hfIf_D2gQXRyXeiJ9uxbSw3rJis5
- Import the collection to postman
- Run every request or do functional API test using newman
- PHP >= 7.0.0
- MariaDB / MySQL Database
- Composer (https://getcomposer.org/)
- Javascript Turned On in your browser
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
####Install Composer (https://getcomposer.org/)####
- Git clone :
$ git clone https://rifqi96@bitbucket.org/rifqi96/salestock.git - Dependencies Installation :
$ composer install - Create a Database with name
salestock - Configuration:
- Open
.envand Change with your database information
- Open
- Database Migration:
- Run Command :
$ php artisan migrate:refresh --seed
- Run Command :
- Now All Set Up!
- Open Terminal
- Type Command :
$ php artisan serve - Open the site through following url:
{localhost}:8000- Note: {localhost} is your localhost url. Normally localhost or 127.0.0.1 **
- Open the site through following url:
{url}/salestock/public- Note: {url} is your server url.