-
URL
/vendors
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": [ { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo" : "<Vendor's logo>", "tags": [ { "id": "<Tag's Id>", "name": "<Tag's name>" }, ... ] } ] }
- Status Code
-
Sample Call:
<base url>/api/v1/vendors
-
URL
/vendors?tags[]=<tags name>
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": [ { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo" : "<Vendor's logo>", "tags": [ { "id": "<Tag's Id>", "name": "<Tag's name>" }, ... ] } ] }
- Status Code
-
Sample Call:
<base url>/api/v1/vendors?tags=promo&tags[]=featured
-
URL
/vendors/<vendor id>/dishes
-
Method
GET
-
Success Response
- Status Code
200
- Content
[ { "id": "<Dish id>", "vendor_id": "<Vendor id>", "name": "<Dish name>", "price": "<Dish price>", "created_at": "<Dish timestamp>", "updated_at": "<Dish timestamp>" }, ... ]
- Status Code
-
Sample Call:
<base url>/api/v1/vendors/<vendor id>/dishes
-
URL
/vendors/<vendor id>
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": { { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo" : "<Vendor's logo>", "tags": [ { "id": "<Tag's Id>", "name": "<Tag's name>" }, ... ] } } }
- Status Code
-
Error Response:
- 404 Data Not Found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 404 Data Not Found
-
Sample Call:
<base url>/api/v1/vendors/<vendor id>
-
URL
/vendors
-
Method
POST
-
Data Params
{ "name": "<Vendor's name>", "logo": "<Vendor's logo>", "tags": "<Vendor's tag1>, <Vendor's tag2>" }
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <vendor's name> successfully added." }
- Status Code
-
Error Response:
- 422 Unprocessable Entity
{ "message": "The given data was invalid.", "errors": { "<field's name>": ["<field's name> is required"] } }
- 422 Unprocessable Entity
-
Sample Call:
<base url>/api/v1/vendors
-
URL
/vendors/<vendor id>
-
Method
PUT
-
Data Params
{ "name": "<Vendor's name>", "logo": "<Vendor's logo>", "tags": "<Vendor's tag1>, <Vendor's tag2>" }
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <vendor name> successfully changed." }
- Status Code
-
Error Response:
- 422 Unprocessable Entity
{ "message": "The given data was invalid.", "errors": { "<field's name>": ["<field's name> is required"] } }
- 404 Data not found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 422 Unprocessable Entity
-
Sample Call:
<base url>/api/v1/vendors/<vendor id>
-
URL
/vendors/<vendor id>
-
Method
DELETE
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <vendor name> successfully deleted." }
- Status Code
-
Error Response:
- 404 Data not found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 404 Data not found
-
Sample Call:
<base url>/api/v1/vendors/<vendor id>
-
URL
/dishes
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": [ { "id": "<Dish's Id>", "name": "<Dish's name>", "price" : "<Dish's price>", "vendor": { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo": "<Vendor's logo>", "created_at": "<Vendor's timestamp>", "updated_at": "<Vendor's timestamp>" } }, ... ] }
- Status Code
-
Sample Call:
<base url>/api/v1/dishes
-
URL
/dishes/<dish id>
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": { "id": "<Dish's Id>", "name": "<Dish's name>", "price": "<Dish's price>", "vendor": { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo": "<Vendor's logo>", "created_at": "<Vendor's timestamp>", "updated_at": "<Vendor's timestamp>" } } }
- Status Code
-
Error Response:
- 404 Data Not Found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 404 Data Not Found
-
Sample Call:
<base url>/api/v1/dishes
-
URL
/dishes
-
Method
POST
-
Data Params
{ "name": "<Dish's name>", "vendor_id": "<Vendor's id>", "price": "<Dish's price>" }
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <dish's name> successfully added." }
- Status Code
-
Error Response:
- 422 Unprocessable Entity
{ "message": "The given data was invalid.", "errors": { "<field's name>": ["<field's name> is required"] } }
- 422 Unprocessable Entity
-
Sample Call:
<base url>/api/v1/dishes
-
URL
/dishes/<dish id>
-
Method
PUT
-
Data Params
{ "name": "<Dish's name>", "vendor_id": "<Vendor's id>", "price": "<Dish's price>" }
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <dish name> successfully changed." }
- Status Code
-
Error Response:
- 422 Unprocessable Entity
{ "message": "The given data was invalid.", "errors": { "<field's name>": ["<field's name> is required"] } }
- 404 Data not found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 422 Unprocessable Entity
-
Sample Call:
<base url>/api/v1/dishes/<dish id>
-
URL
/dishes/<dish id>
-
Method
DELETE
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <vendor name> successfully deleted." }
- Status Code
-
Error Response:
- 404 Data not found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 404 Data not found
-
Sample Call:
<base url>/api/v1/dishes/<dish id>
-
URL
/orders
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": [ { "id": "<Order's Id>", "quantity": "<Order's quantity>", "amount" : "<Order's amount>", "vendor": { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo": "<Vendor's logo>", "created_at": "<Vendor's timestamp>", "updated_at": "<Vendor's timestamp>" }, "dish": { "id": "<Dish's Id>", "name": "<Dish's name>", "price": "<Dush's price>", "created_at": "<Dish's timestamp>", "updated_at": "<Dish's timestamp>" }, "user": { "id": "<User's Id>", "name": "<User's name>", "email": "<User's email>", "email_verified_at": "<User's verified timestamp>" "created_at": "<User's timestamp>", "updated_at": "<User's timestamp>" } }, ... ] }
- Status Code
-
Sample Call:
<base url>/api/v1/orders
-
URL
/orders/<order id>
-
Method
GET
-
Success Response
- Status Code
200
- Content
{ "data": { "id": "<Order's Id>", "quantity": "<Order's quantity>", "amount" : "<Order's amount>", "vendor": { "id": "<Vendor's Id>", "name": "<Vendor's name>", "logo": "<Vendor's logo>", "created_at": "<Vendor's timestamp>", "updated_at": "<Vendor's timestamp>" }, "dish": { "id": "<Dish's Id>", "name": "<Dish's name>", "price": "<Dush's price>", "created_at": "<Dish's timestamp>", "updated_at": "<Dish's timestamp>" }, "user": { "id": "<User's Id>", "name": "<User's name>", "email": "<User's email>", "email_verified_at": "<User's verified timestamp>" "created_at": "<User's timestamp>", "updated_at": "<User's timestamp>" } } }
- Status Code
-
Error Response:
- 404 Data Not Found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 404 Data Not Found
-
Sample Call:
<base url>/api/v1/orders/<order id>
-
URL
/orders
-
Method
POST
-
Data Params
{ "vendor_id": "<Vendor's id>", "dish_id": "<Dish's id>", "user_id": "<User's price>", "quantity": "<Order's quantity>" }
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <Order's number> successfully added." }
- Status Code
-
Error Response:
- 422 Unprocessable Entity
{ "message": "The given data was invalid.", "errors": { "<field's name>": ["<field's name> is required"] } }
- 422 Unprocessable Entity
-
Sample Call:
<base url>/api/v1/orders
-
URL
/orders/<order id>
-
Method
PUT
-
Data Params
{ "vendor_id": "<Vendor's id>", "dish_id": "<Dish's id>", "user_id": "<User's price>", "quantity": "<Order's quantity>" }
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <order number> successfully changed." }
- Status Code
-
Error Response:
- 422 Unprocessable Entity
{ "message": "The given data was invalid.", "errors": { "<field's name>": ["<field's name> is required"] } }
- 404 Data not found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 422 Unprocessable Entity
-
Sample Call:
<base url>/api/v1/orders/<order id>
-
URL
/orders/<order id>
-
Method
DELETE
-
Success Response
- Status Code
200
- Content
{ "statusCode": 200, "message": "Success. <order number> successfully deleted." }
- Status Code
-
Error Response:
- 404 Data not found
{ "statusCode": 404, "message": "Sorry. Data not found" }
- 404 Data not found
-
Sample Call:
<base url>/api/v1/orders/<order id>