Create
You can add unlimited categories by category create route, category route allow only POST Method
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
body:{
"parent_id": "",
"name": "test category",
"banner": "", // file or base64
"icon" : "", // file or base64
"thumbnails" : "", // file or base64
"commission": 0,
"commission_type": "", //fixed | parcentage ,
"status": 1, // 0 | 1,
"description": "",
"extend_props": {
"test": "theis extend props",
"test2": "theis extend props 02",
".....": "....."
}
}
### OUTPUT
{
"0": "Success",
"store_data": {
"unique_id": "Q5WpoWDoZ1zKxkF",
"parent_id": null,
"name": "test category",
"slug": "test_category",
"banner": "",
"icon": "",
"thumbnails": "",
"commission": "10",
"commission_type": "fixed",
"status": "1",
"description": "this is description",
"extend_props": {
"test": "theis extend props",
"test2": "theis extend props 02"
},
"created_by": 1,
"updated_by": 1,
"updated_at": "2023-03-17T04:31:53.000000Z",
"created_at": "2023-03-17T04:31:53.000000Z",
}
}
List
Get all category list by GET Method with filter function customized option for you. below list of route with parameter
http://ecom.coderorbit.com/public/api/admin/{{app_token}}/category
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### OUTPUT
"data" : [
{
"id": 1,
"unique_id": "sLJvIENyg100Pxk",
"parent_id": null,
"name": "Test Category",
"slug": "Test Category",
"banner": "",
"icon": "",
"thumbnails": "",
"commission": 10,
"commission_type": "fixed",
"status": 1,
"description": "this is description",
"extend_props": {
"'test'": "theis extend props 02"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-03-17T04:25:43.000000Z",
"updated_at": "2023-03-17T04:25:43.000000Z",
"props": []
},
.........
],
If you want to get by pagination to the list by GET Method Here we have this featuer for you in ths route with parameter like: limit_per_page
http://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?limit_per_page=1
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### OUTPUT
"data" : [
{
"id": 1,
"unique_id": "sLJvIENyg100Pxk",
"parent_id": null,
"name": "Test Category",
"slug": "Test Category",
"banner": "",
"icon": "",
"thumbnails": "",
"commission": 10,
"commission_type": "fixed",
"status": 1,
"description": "this is description",
"extend_props": {
"'test'": "theis extend props 02"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-03-17T04:25:43.000000Z",
"updated_at": "2023-03-17T04:25:43.000000Z",
"props": []
},
.........
],
,
"first_page_url": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category",
"per_page": 15,
"prev_page_url": null,
"to": 100,
"total": 100
}
=== Query Parameters ===
limit_per_page = 1 // Default 15
name = ''
page = 1 // number of page for pagination
data = all
Here is example url:
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?limit_per_page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?name=apple
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category?data=all&limit_per_page=1&name=admin&page=1
==============================================================================================================
Single Category Show
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
Edit Category
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category/{{id}}/edit
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### OUTPUT
{
"data": {
"id": 1,
"unique_id": "sLJvIENyg100Pxk",
"parent_id": null,
"name": "Test Category",
"slug": "test_category",
"banner": "",
"icon": "",
"thumbnails": "",
"commission": 10,
"commission_type": "fixed",
"status": 1,
"description": "this is description",
"extend_props": {
"'test'": "theis extend props 02"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-03-17T04:25:43.000000Z",
"updated_at": "2023-03-17T04:25:43.000000Z"
}
}
Update Category
Method allow for category update PUT/PATCH/POST
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
body:{
"parent_id": "",
"name": "test category update",
"banner": "", // file or base64
"icon" : "", // file or base64
"thumbnails" : "", // file or base64
"commission": 0,
"commission_type": "", //fixed | parcentage ,
"status": 1, // 0 | 1,
"description": "",
"extend_props": {
"test": "theis extend props",
"test2": "theis extend props 02",
".....": "....."
},
}
### OUTPUT
{
"data": {
"id": 1,
"unique_id": "sLJvIENyg100Pxk",
"parent_id": null,
"name": "test category update",
"slug": "test_category_update",
"banner": "",
"icon": "",
"thumbnails": "",
"commission": 10,
"commission_type": "fixed",
"status": 1,
"description": "this is description",
"extend_props": {
"'test'": "theis extend props 02"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-03-17T04:25:43.000000Z",
"updated_at": "2023-03-17T04:25:43.000000Z"
}
}
DELETE
Method allow for category delete DELETE
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### OUTPUT
Success