Create product
You can add unlimited products by product create route, product route allow only POST Method
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
body: {
"name" : "", # Required //string
"description" : "", #longtext,
"brand_id" : "", #integer
"vendor_id" : "", #integer
"country_id" : "", #integer
"district_id" : "", #integer
"police_station_id" : "", #integer
"sequence" : "", #double
"status" : "", #integer
"regular_price" : "", #double
"current_price" : "", #double
"dicount" : "", #double
"dicount_type" : "", #string like: fixed or parcentage
"start_offer" : "", # date time
"end_offer" : "", # date time
"banner" : "", # image file or base64
"additional": {
"white": {
"color_icon": null, # image file or base64
"color_thumbnails": null, # image file or base64
"color_galleries": null, # image file or base64, Galleries use multiple images by comma separator
"size": {
"s": {
"color": "black", #string
"size": "s", #string
"regular_price": 200, #integer
"current_price": 150, #integer
"discount": 25, #integer
"dicount_type": 0, #integer like: 0|1 0 = fixed, 1 = parcentage
"stock": 24 #integer
},
"m": {
... here is other additional product details
},
}
},
"black" :{
"color_icon": null,
"color_thumbnails": null,
"color_galleries": null,
"size": {
"s": {
"color": null,
"size": null,
"regular_price": 200,
"current_price": 150,
"discount": 25,
"dicount_type": 0,
"stock": 24
}
}
}
},
"additional_attributes": {
"size": ["S","M","L"],
"color": ["Black","White","Gray","Blue"]
},
"extend_props": {
"test" : "hello",
"test2" : "check for required"
},
# you can customize validition by validition tab
"validation": {
"roles": {
"name": "required",
"additional":{
"color_icon": "required"
}
}
}
}
### Result
{
"0": "Success",
"store_data": {
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
"id": 1,
"unique_id": "iYKOQM0waTaB5pT",
"parent_id": 0,
"name": "T-shirt",
"slug": "t_shirt_iYKOQM0waTaB5pT",
"sequence": null,
"commission": null,
"commission_type": null,
"icon": null,
"thumbnails": null,
"banner": null,
"description": null,
"status": null,
"extend_props": {
"check": "test status"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-10T02:50:40.000000Z",
"updated_at": "2023-05-10T02:50:40.000000Z",
"pivot": {
"product_id": 8,
"category_id": 1
}
},
{
.......
}
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}
}
List
Get all product list by GET Method with filter function customized option for you. below list of route with parameter
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"current_page": 1,
"data": [
{
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
"id": 1,
"unique_id": "iYKOQM0waTaB5pT",
"parent_id": 0,
"name": "T-shirt",
"slug": "t_shirt_iYKOQM0waTaB5pT",
"sequence": null,
"commission": null,
"commission_type": null,
"icon": null,
"thumbnails": null,
"banner": null,
"description": null,
"status": null,
"extend_props": {
"check": "test status"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-10T02:50:40.000000Z",
"updated_at": "2023-05-10T02:50:40.000000Z",
"pivot": {
"product_id": 8,
"category_id": 1
}
},
{
.......
}
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}
],
"first_page_url": "",
"from": 1,
"last_page": 1,
"last_page_url": "",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "",
"per_page": 15,
"prev_page_url": null,
"to": 6,
"total": 6
}
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
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product?limit_per_page=1
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"current_page": 1,
"data": [
{
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
"id": 1,
"unique_id": "iYKOQM0waTaB5pT",
"parent_id": 0,
"name": "T-shirt",
"slug": "t_shirt_iYKOQM0waTaB5pT",
"sequence": null,
"commission": null,
"commission_type": null,
"icon": null,
"thumbnails": null,
"banner": null,
"description": null,
"status": null,
"extend_props": {
"check": "test status"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-10T02:50:40.000000Z",
"updated_at": "2023-05-10T02:50:40.000000Z",
"pivot": {
"product_id": 8,
"category_id": 1
}
},
{
.......
}
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}],
"first_page_url": "",
"from": 1,
"last_page": 1,
"last_page_url": "",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "",
"per_page": 15,
"prev_page_url": null,
"to": 6,
"total": 6
}
Basic Query Parameters
limit_per_page = 1 // Default 15
name = ''
page = 1 // number of page for pagination
data = all
orderBy = desc // desc|asc
Here is example url:
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product?limit_per_page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product?name=apple
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product?page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product?data=all&limit_per_page=1&name=admin&page=1
==============================================================================================================
Advance Query/Filter Parameters
body: {
"regular_price" : 50,
"current_price": 50,
"country_id": "",
"extendProps":{
"prop_name": "value",
},
"police_station_id": "",
"district_id": "",
"vendor_id": "",
"brand_id": "",
"name": "",
"status": "",
"dicount_type": "", // Fixed|Parcentage
"stock": "",
"unit": "",
"minimum_order": "",
"start_offer": "", // only Date
"end_offer": "", // Only Date
"range_start_from_offer": "", // Only Date
"range_start_to_offer": "", // Only Date
"range_end_from_offer": "", // Only Date
"range_end_to_offer": "", // Only Date
"category": [], // array
"regular_price_range": "", // 0,100
"current_price_range": "", // 0,100
// or query function
"or_regular_price": "",
"or_current_price": "",
"or_country_id": "",
"or_extendProps":{
"prop_name": "value",
},
"or_police_station_id": "",
"or_district_id": "",
"or_vendor_id": "",
"or_brand_id": "",
"or_name": "",
"or_status": "",
"or_dicount_type": "", // Fixed|Parcentage
"or_stock": "",
"or_unit": "",
"or_minimum_order": "",
"or_start_offer": "", // only Date
"or_end_offer": "", // Only Date
"or_range_start_from_offer": "", // Only Date
"or_range_start_to_offer": "", // Only Date
"or_range_end_from_offer": "", // Only Date
"or_range_end_to_offer": "", // Only Date
"or_category":[], // array
"or_regular_price_range": "", // 0,100
"or_current_price_range": "", // 0,100
}
Details Data
Get product details by GET Method with all relational data for you. below list of route with parameter
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
....
},
{
....
}
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}
Edit
Get product details by GET Method with all relational data for you. below list of route with parameter
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product/{{id}}/edit
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
....
},
{
....
}
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}
Update
Method allow for update PUT/PATCH/POST
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
body:{
name, // Required //string
description, //longtext
brand_id, //integer
vendor_id, //integer
country_id, //integer
district_id, //integer
police_station_id, //integer
sequence, //double
status, //integer
regular_price, //double
current_price, //double
dicount, //double
dicount_type, //string like: fixed or parcentage
stock, //integer
unit, //integer
minimum_order, //integer
start_offer, // date time
end_offer, // date time
category[], // array
banner, // image file or base64
icon, // image file or base64
thumbnails, // image file or base64
extend_props['test'],
extend_props['test2'],
.....
}
### Result
{
"0": "Success",
"store_data": {
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
"id": 1,
"unique_id": "iYKOQM0waTaB5pT",
"parent_id": 0,
"name": "T-shirt",
"slug": "t_shirt_iYKOQM0waTaB5pT",
"sequence": null,
"commission": null,
"commission_type": null,
"icon": null,
"thumbnails": null,
"banner": null,
"description": null,
"status": null,
"extend_props": {
"check": "test status"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-10T02:50:40.000000Z",
"updated_at": "2023-05-10T02:50:40.000000Z",
"pivot": {
"product_id": 8,
"category_id": 1
}
},
{
.......
}
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}
}
### Result
{
"id": 1,
"unique_id": "QsdTr6mAaU4DghV",
"category": ["1","2","3"],
"brand_id": 1,
"vendor_id": 1,
"country_id": 1,
"district_id": 1,
"police_station_id": 1,
"name": "this first add product from api",
"slug": "this_first_add_product_from_api_QsdTr6mAaU4DghV",
"sequence": 0,
"icon": null,
"thumbnails": null,
"banner": null,
"description": "this first add product from vs code description",
"status": 1,
"regular_price": 50,
"current_price": 40,
"dicount": 10,
"dicount_type": "fixed",
"stock": 20,
"unit": "pcs",
"minimum_order": 1,
"start_offer": "2023-02-19 12:55:51",
"end_offer": "2023-11-19 12:55:51",
"extend_props": {
"test": "test one",
"test2": "test two"
},
"created_by": 1,
"updated_by": 1,
"created_at": "2023-05-11T03:56:21.000000Z",
"updated_at": "2023-05-11T03:56:37.000000Z",
"categories": [
{
....
},
],
"brand":{
....
},
"vendor":{
....
},
"country":{
...
},
"district":{
....
},
"police_station":{
}
}
}
Delete
Method allow for delete Delete
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/product/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
Success