# Product 

##  Product attribute

| Attribute                 | Type          | Description                                                                             
| -----------------         | ------------- | --------------------------------------------------------------------------------------- 
| id                        | integer       | Primary key. Unique ID of the product (AUTO_INCREMENT).                                 
| image                     | integer       | Media ID of the product image                                                           
| name                      | string        | Name of the product                                                                     
| short_description         | text          | Short description of the product                                                        
| description               | text          | Full description of the product                                                         
| type                      | enum          | Product type (`simple`, `variable`, `grouped`, `courses`, `variation`, `courses_kit`, <a href="#bundle">bundle</a> )
| status                    | enum          | Product status (`active`, `inactive`, `draft`)                                          
| product_role              | enum          | product role (`franchise`, `student`)                                                  
| virtual                   | enum          | Product virtual (`1`, `0`)                                                             
| subscription              | enum          | Product subscription (`1`, `0`)                                                        
| subscription_type         | enum          | Product field subscription = 1  (`monthly`, `quarterly`, `annually`)                   
| multi_products            | json          | If the product type is `grouped`, then include `multiple product IDs` for both` simple` and `course` product types.
| bundle_multi_products     | json          | If the product type is `bundle`, then include `multiple product IDs` for both` simple` and `course` product types.
| bundle_sale_type          | Enum          | <a href="#bundle">bundle_sale_type</a> individual or multiple product add in bundle_multi_products  
| featured                  | boolean       | Whether the product is featured                                                        
| price                     | float         | Current price of the product                                                           
| regular_price             | float         | Regular price                                                                          
| sale_price                | float         | Sale price                                                                             
| manage_stock              | boolean       | Stock management enabled                                                               
| total_sales               | integer       | Total sales count                                                                      
| downloadable              | tinyint       | Product subscription (`1`, `0`)                                                        
| downloadable_type         | enum          | Product field downloadable = `1`(`Upload media image`)
| reviews_allowed           | boolean       | Whether reviews are enabled                                                            
| average_rating            | float         | Average product rating                                                                 
| rating_count              | integer       | Total number of ratings                                                                
| attributes                | json          | Product attributes ( <a href="#attribute">JSON format</a>)
| parent_id                 | integer       | Parent product ID (`used for variations`)                                              
| weight	                | decimal       | Product weight                                                                          
| length	                | decimal       | Product length                                                                          
| width	                    | decimal       | Product width                                                                           
| height	                | decimal       | Product height                                                                         
| sku	                    | varchar(100)  | Unique identifier                                                                         
| upsell_ids	            | json          | List of up-sell `products IDs`                                                          
| cross_sell_ids	        | json          | List of cross-sell `products IDs`                                                       
| categories	            | int           | `categories ID` of the product categories                                                
| first_time_price          | int           | If the product is a subscription type, the initial payment will be this price.       
| taxable                   | ENUM          | taxable (`1`, `0`)    
| tax_included_price        | ENUM          | tax_included_price (`1`, `0`) 
| tax_option                | json          | Tax options will be fetched dynamically from the <a href="#settings">settings</a> table as JSON data.     


### Optional (`Only when type = courses` and `Only when type = courses_kit`)
| Attribute        | Type      | Description       |
| ---------------- | --------- | ----------------- |
| courses_id       | integer   | Related course ID |
| courses_level_id | integer[] | Course level IDs  |


### settings

| Attribute           | Type | Description                                                                                                                                                                                |
| ------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `tax_configuration` | JSON | Tax configuration options are stored in the `settings` table under the `tax_configuration` key. This value contains an array of tax objects, including tax labels, names, and percentages. |

#### Example Record

GST
- Label: GST
- Name: GST
- Percentage: 18%

CGST
- Label: CGST
- Name: CGST
- Percentage: 5%

Service Tax
- Label: Service Tax
- Name: service_tax
- Percentage: 30%
#### example this
 `{"label":"GST", "name":"GST","percentage":18},`


#### Notes

* Tax options are fetched dynamically from the `settings` table.
* The API uses the <a href="#get-tax-info">tax_configuration</a>`` setting to populate available tax options.
* If a product is marked as `taxable = 1`, a valid tax configuration must be provided.



               


## Get all products

```shell
curl -X GET https://vedaay-api.mulika.in/products \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "message": "Products retrieved successfully",
    "code": 200,
    "pagination": {
        "current_page": 1,
        "per_page": 100,
        "total_records": 52,
        "total_pages": 1
    },
    "data": [
        {
            "id": "39",
            "image": "63",
            "name": "validation new  Course",
            "description": "Complete validation course ",
            "type": "simple",
            "status": "inactive",
            "featured": "1",
            "short_description": "Learn Test from scratch",
            "price": "49.99",
            "regular_price": "59.99",
            "sale_price": "49.99",
            "manage_stock": "0",
            "total_sales": "0",
            "downloadable": "1",
            "shipping_required": "0",
            "shipping_taxable": "0",
            "shipping_class": "digital",
            "shipping_class_id": "0",
            "reviews_allowed": "1",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [],
            "parent_id": "0",
            "created_at": "2025-12-30 13:15:20",
            "updated_at": "2025-12-31 17:53:10",
            "product_meta": []
        },
    ]
}
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #42c253; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /products
</span>

1.  GET /products
2.  GET /products?page=1&per_page=20 
3.  GET /products?search=new test
4.  GET /products?search_fields=name,status,parent_id,stock_status,type
5.  GET /products?column_count=status,type,parent_id,created_by,created_at
6.  GET /products??include=235,236&exclude=237
7.  GET /products?filters[status]=inactive&[type]=simple&[featured]=0
8.  GET /products?include_status=inactive,draft
9.  GET /products?type=courses
10. GET /products?parent_ecxlude=235,263
11. GET /products?include_types=courses,simple&exclude_types=variation
12. GET /products?order=asc
13. GET /products?column_count=status&order=desc&filters[parent_id]=0
14. GET /products?featured_courses_product=252,299&filters[parent_id]=0

### Parameters

| Parameter       | Type    | Description                                                                  |
| --------------- | ------- | ---------------------------------------------------------------------------- |
| page            | integer | Page number for pagination (default: `1`)                                    |
| per_page        | integer | Number of products per page (default: `10`, max: `100`)                      |
| status          | string  | Filter by product status: `active`, `inactive`, `draft`                      |
| include_status  | string  | Include multiple statuses (comma separated) `inactive,draft`                 |
| featured        | boolean | Filter featured products (`0` or `1`)                                        |
| type            | string  | Filter by type: `simple`, `variable`, `grouped`, `courses`                   |
| include_types   | string  | Include multiple types `courses,simple`                                      |
| exclude_types   | string  | Exclude product types `variation`                                            |
| search          | string  | Search by product name (partial match)                                       |
| search_fields   | string  | Search in specific fields `name,status,parent_id,stock_status,type`          |
| include         | string  | Include specific product IDs `235,236`                                       |
| exclude         | string  | Exclude specific product IDs `237`                                           |
| parent_exclude  | string  | Exclude parent product IDs `235,263`                                         |
| column_count    | string  | Select only specific columns `status,type,parent_id,created_by,created_at`   |
| filters[status] | string  | Advanced filter example `inactive`                                           |
| filters[type]   | string  | Advanced filter example `simple`                                             |
| order           | string  | Filter by customer Return only ascending / descending (asc,desc) products    |



## Get single product
```shell
curl -X GET https://vedaay-api.mulika.in/products/456 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 {
    "status": "success",
    "message": "Product retrieved successfully",
    "code": 200,
    "data": {
        "id": 456,
        "image": {
            "media_id": "102",
            "media_src": "https://dev-api.vedaay.mulika.in/media/src/102/1770283467_686bab3ccc699_back7.jpg",
            "media_title": null,
            "media_alt": null,
            "media_type": "image/jpeg"
        },
        "gallery_images": [
            {
                "media_id": "102",
                "media_src": "https://dev-api.vedaay.mulika.in/media/src/102/1770283467_686bab3ccc699_back7.jpg",
                "media_title": null,
                "media_alt": null,
                "media_type": "image/jpeg"
            }
        ],
        "name": "all products",
        "description": "all products",
        "type": "simple",
        "product_role": "student",
        "multi_products": [],
        "status": "active",
        "virtual": "1",
        "subscription": "1",
        "subscription_type": "monthly",
        "created_by": "343",
        "featured": 1,
        "short_description": "all products vedaay abacus",
        "price": 1,
        "regular_price": 1,
        "sale_price": 1,
        "manage_stock": 1,
        "stock_quantity": "1",
        "stock_status": "in_stock",
        "total_sales": 1,
        "downloadable": 1,
        "downloadable_media": {
            "media_id": "102",
            "media_src": "https://dev-api.vedaay.mulika.in/media/src/102/1770283467_686bab3ccc699_back7.jpg",
            "media_title": null,
            "media_alt": null,
            "media_type": "image/jpeg"
        },
        "reviews_allowed": 1,
        "average_rating": 1,
        "rating_count": 1,
        "attributes": [],
        "parent_id": 0,
        "created_at": "2026-03-11 16:tax_info09:26",
        "updated_at": "2026-03-11 16:09:26",
        "weight": "",
        "length": "",
        "width": "",
        "height": "",
        "sku": "",
        "category": [
            {
                "id": "2",
                "title": "Mobile Phones test",
                "parent_id": "0",
                "description": "Smartphones & Mobiles",
                "created_at": "2025-12-26 23:32:56"
            },
            {
                "id": "8",
                "title": "IT",
                "parent_id": "0",
                "description": "AI & DBMS",
                "created_at": "2025-12-30 10:29:19"
            }
        ],
        "upsell_ids": [
            {
                "id": "447",
                "image": "102",
                "gallery_images": "[102]",
                "name": "all products",
                "description": "all products",
                "product_role": "student",
                "status": "active",
                "price": "1"
            }
        ],
        "cross_sell_ids": [
            {
                "id": "446",
                "image": "102",
                "gallery_images": "[102]",
                "name": "all products",
                "description": "all products",
                "product_role": "student",
                "status": "active",
                "price": "1"
            }
        ],
        "meta": [
            {
                "key": "color",
                "value": "blue"
            },
            {
                "key": "size",
                "value": "large"
            }
        ],
        "courses_levels": []
    }
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #674ed7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /products/{id}
</span>

### Parameters

| Parameter | Type    | Description       |
| --------- | ------- | ----------------- |
| id        | integer | ID of the product |



## Get tax info
```shell
curl -X GET https://vedaay-api.mulika.in/products/tax-configuration \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 {
    "status": "success",
    "code": 200,
    "message": "Tax configuration retrieved successfully",
    "data": [
        {
            "label": "GST",
            "name": "GST",
            "percentage": 18
        },
        {
            "label": "CGST",
            "name": "CGST",
            "percentage": 5
        },
        {
            "label": "Service Tax",
            "name": "service_tax",
            "percentage": 30
        }
    ]
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #674ed7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /products/tax-configuration
</span>


## Create product

```shell
curl -X POST https://vedaay-api.mulika.in/products \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
"image": "102",
"gallery_images": [102],
"name": "all products",
"description": "all products",
"short_description": "all products vedaay abacus",
"type": "simple",
"virtual":1,
"subscription":1,
"subscription_type":"monthly",
"product_role":"student",
"status": "active",
"featured": "1",
"price": "1",
"regular_price": "1",
"sale_price": "1",
"manage_stock": "1",
"stock_quantity": "1",
"stock_status": "in_stock",
"total_sales": "1",
"downloadable": "1",
"downloadable_media":102,
"reviews_allowed": "1",
"average_rating": "1",
"rating_count": "1",
"parent_id": "0",
"category":[2,8],
 "meta": [
        {
            "key": "color",
            "value": "blue"
        },
        {
            "key": "size",
            "value": "large"
        }
    ],
    "upsell_ids":[447],
    "cross_sell_ids":[446]
}'
 ```
> Responce:

```json
   {
    "status": "success",
    "code": 200,
    "message": "Product created successfully",
    "data": {
        "id": "456",
        "image": "102",
        "gallery_images": [
            102
        ],
        "name": "all products",
        "description": "all products",
        "type": "simple",
        "product_role": "student",
        "multi_products": null,
        "status": "active",
        "virtual": 1,
        "subscription": 1,
        "subscription_type": "monthly",
        "created_by": "343",
        "featured": 1,
        "short_description": "all products vedaay abacus",
        "price": 1,
        "regular_price": 1,
        "sale_price": 1,
        "manage_stock": 1,
        "stock_quantity": "1",
        "stock_status": "in_stock",
        "total_sales": "1",
        "downloadable": 1,
        "downloadable_media": "102",
        "reviews_allowed": "1",
        "average_rating": "1",
        "rating_count": "1",
        "attributes": "",
        "parent_id": "0",
        "created_at": "2026-03-11 16:09:26",
        "updated_at": "2026-03-11 16:09:26",
        "weight": "",
        "length": "",
        "width": "",
        "height": "",
        "sku": "",
        "category": [
            2,
            8
        ],
        "upsell_ids": [
            447
        ],
        "cross_sell_ids": [
            446
        ],
        "meta": [
            {
                "product_id": 456,
                "meta_key": "color",
                "meta_value": "blue"
            },
            {
                "product_id": 456,
                "meta_key": "size",
                "meta_value": "large"
            }
        ]
    }
}
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d7be4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /products
</span>


### Authentication

`Authentication required: Yes (via token, $this->request->user)`



---

### Bundle

Applicable only when `type = bundle`

### Required Parameters

| Parameter                | Type     | Description |
|-------------------------|----------|-------------|
| bundle_multi_products   | array    | List of product IDs to include in the bundle |
| bundle_sale_type        | string   | Defines bundle sale behavior |

---

### bundle_sale_type (Enum)

- `individual` → Only **one product ID** allowed in `bundle_multi_products`
- `multiple` → **Multiple product IDs** allowed in `bundle_multi_products`

---

### Rules

- If `bundle_sale_type = individual`  
  → `bundle_multi_products` must contain exactly **1 product ID**

- If `bundle_sale_type = multiple`  
  → `bundle_multi_products` must contain **more than 1 product ID**

---

### Attribute

Used to assign product type `variation` add attributes and their selected items to a product.

### Request Body
 ` "attributes": [{ "id": 49,"items": [116]} ]`

---

### Product Meta
    Used to store additional product information as key–value pairs.
### Request Body
`"meta": [
  { "key": "color", "value": "red" },
  { "key": "size", "value": "large" }
]`



## Update product
```shell
curl -X PUT https://vedaay-api.mulika.in/products/45 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
    "description": "Complete text book"
  }
```
> Responce:

```json
   {
	"status": "success",
	"message": "Product updated successfully",
	"code": 200,
	"data": {
		"id": "45",
		"name": "BOOK",
		"description": "Complete text book",
		"type": "simple",
		"status": "active",
		"featured": "1",
		"short_description": "Learn Test book",
		"price": "500",
		"regular_price": "500",
		"sale_price": "499",
		"manage_stock": "0",
		"total_sales": "0",
		"downloadable": "1",
		"shipping_required": "0",
		"shipping_taxable": "0",
		"shipping_class": "digital",
		"shipping_class_id": "0",
		"reviews_allowed": "1",
		"average_rating": "4",
		"rating_count": "4",
		"attributes": "[{\"id\":49,\"items\":[116]}]",
		"parent_id": "0",
		"created_at": "2026-01-05 15:49:38",
		"updated_at": "2026-01-07 12:13:04"
	}
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #4e92d7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /product/{id}
</span>

### Parameters

| Parameter | Type    | Description       |
| --------- | ------- | ----------------- |
| id        | integer | ID of the product |
 


## Delete product
```shell
curl -X DELETE https://vedaay-api.mulika.in/products/37 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
	"status": "success",
	"message": "Product deleted successfully",
	"code": 200,
	"data": {
		"id": "37"
	}
}
```
<span style="background: #000000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d74e4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span> /product/{id}
</span>

### Parameters

| Parameter | Type    | Description       |
| --------- | ------- | ----------------- |
| id        | integer | ID of the product |



# product variations 

## Product variations attribute

| Attribute         | Type          | Description                                  
| ----------------- | ------------- | -------------------------------------------  
| id                | int           | ID of the product                            
| name              | text          | Name of the product                          
| short_description | text          | Short description of the product             
| description       | varchar(50)   | Full description of the product              
| type              | varchar(50)   | product variations type (`variation`) `read-only`
| price             | float         | Current price of the product 
| manage_stock      | boolean       | Stock management enabled     
| downloadable      | boolean       | Is product downloadable                 
| reviews_allowed   | boolean       | Reviews enabled              
| average_rating    | float         | Average rating               
| rating_count      | integer       | Number of ratings            
| attributes        | JSON          | Product attributes ( <a href="#attribute">JSON format</a>)




## Get all product variations

```shell
curl -X GET https://vedaay-api.mulika.in/products/60/variation \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "message": "Variations retrieved successfully",
    "code": 200,
    "pagination": {
        "current_page": 1,
        "per_page": 10,
        "total_records": 14,
        "total_pages": 2
    },
    "data": [
        {
            "id": "64",
            "name": "test01",
            "description": "test01",
            "type": "variation",
            "status": "active",
            "featured": "0",
            "short_description": "test01",
            "price": "50",
            "regular_price": "40",
            "sale_price": "10",
            "manage_stock": "0",
            "total_sales": "0",
            "downloadable": "1",
            "shipping_required": "0",
            "shipping_taxable": "0",
            "shipping_class": "digital",
            "shipping_class_id": "0",
            "reviews_allowed": "1",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [
                {
                    "attr_id": "48",
                    "label": "courses-A",
                    "items": [
                        {
                            "items_id": "115",
                            "label": "Level 1"
                        }
                    ]
                }
            ],
            "parent_id": "60",
            "created_at": "2026-01-19 09:27:53",
            "updated_at": "2026-01-19 09:27:53"
        }
    ]
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #42c253; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /products/{id}/variation
</span>


### product variations

| Parameter | Type    | Description                                             |
| --------- | ------- | ------------------------------------------------------- |
| parentId  | integer | **Path parameter**: Parent product ID (`required`)      |
| page      | integer | Page number for pagination (`default: 1`)               |
| per_page  | integer | Number of variations per page (`max: 100, default: 10`) |





## Get single product variations
```shell
curl -X GET https://vedaay-api.mulika.in/products/60/variation/86 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 {
    "status": "success",
    "code": 200,
    "message": "Variation retrieved successfully",
    "data": {
        "id": "86",
        "name": "Variation 3",
        "description": "Desc",
        "type": "variation",
        "status": "active",
        "featured": "0",
        "short_description": "Short desc",
        "price": "100",
        "regular_price": "120",
        "sale_price": "90",
        "manage_stock": "10",
        "total_sales": "0",
        "downloadable": "1",
        "shipping_required": "0",
        "shipping_taxable": "0",
        "shipping_class": "digital",
        "shipping_class_id": "0",
        "reviews_allowed": "0",
        "average_rating": "0",
        "rating_count": "50",
        "attributes": [
            {
                "attr_id": "49",
                "label": "courses-B",
                "items": [
                    {
                        "items_id": "116",
                        "label": "Level 2",
                        "type": "course",
                        "meta": [
                            {
                                "meta_key": "course_id",
                                "meta_value": "252"
                            },
                            {
                                "meta_key": "course_level",
                                "meta_value": "40"
                            }
                        ]
                    }
                ]
            }
        ],
        "parent_id": "60",
        "created_at": "2026-01-20 11:34:55",
        "updated_at": "2026-01-20 11:34:55"
    }
}
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #674ed7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /products/{id}/variation/{id}
</span>

### Parameters

| Parameter | Type    | Description         |
| --------- | ------- | --------------------|
| id        | integer | ID of the product   |
| id        | integer | ID of the variation |




## Create product variations
```shell
curl -X POST https://vedaay-api.mulika.in/products/60/variation \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
        "name": "Variation 3",
        "description": "Desc",
        "type": "variation",
        "status": "active",
        "featured": 1,
        "short_description": "Short desc",
        "price": 100,
        "regular_price": 120,
        "sale_price": 90,
        "manage_stock": 0,
        "stock_quantity":5,
        "stock_status":"in_stock",
        "total_sales": 0,
        "downloadable": 1,
        "shipping_required": 0,
        "shipping_taxable": 0,
        "shipping_class": "digital",
        "shipping_class_id": 0,
        "reviews_allowed": 1,
        "average_rating": 0,
        "rating_count": 0,
        "attributes": [{"id":49,"items":[116]}]
    }'
 ```
> Responce:

```json
    {
    "status": "success",
    "message": "Variation created successfully",
    "code": 201,
    "data": {
        "id": 303,
        "image": 0,
        "gallery_images": null,
        "name": "Variation 3",
        "description": "Desc",
        "type": "variation",
        "status": "active",
        "created_by": 201,
        "featured": 1,
        "short_description": "Short desc",
        "price": 100,
        "regular_price": 120,
        "sale_price": 90,
        "manage_stock": 0,
        "stock_quantity": "5",
        "stock_status": "in_stock",
        "total_sales": 0,
        "downloadable": 1,
        "shipping_required": 0,
        "shipping_taxable": 0,
        "shipping_class": "digital",
        "shipping_class_id": 0,
        "reviews_allowed": 1,
        "average_rating": 0,
        "rating_count": 0,
        "attributes": [
            {
                "id": 49,
                "items": [
                    116
                ]
            }
        ],
        "parent_id": 259,
        "created_at": "2026-02-25 14:08:44",
        "updated_at": "2026-02-25 14:08:44"
    }
}
```


<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d7be4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /products/{id}/variation
</span>


### Notes

`parent_id is automatically set from the URL path parameter.`



## Update product variations
```shell
curl -X PUT https://vedaay-api.mulika.in/products/60/variation/64 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
    "description": " testtestesteste",
      "name": "test"
}
  

```
> Responce:

```json
   {
    "status": "success",
    "code": 200,
    "message": "Variation updated successfully",
    "data": {
        "id": "64",
        "name": "test",
        "description": " testtestesteste",
        "type": "variation",
        "status": "active",
        "featured": "0",
        "short_description": "test01",
        "price": "50",
        "regular_price": "40",
        "sale_price": "10",
        "manage_stock": "0",
        "total_sales": "0",
        "downloadable": "1",
        "shipping_required": "0",
        "shipping_taxable": "0",
        "shipping_class": "digital",
        "shipping_class_id": "0",
        "reviews_allowed": "1",
        "average_rating": "0",
        "rating_count": "0",
        "attributes": "[{\"id\":48,\"items\":[115]}]",
        "parent_id": "60",
        "created_at": "2026-01-19 09:27:53",
        "updated_at": "2026-01-21 11:37:45"
    }
}  
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #4e92d7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /products/{id}/variation/{id}
</span>




## Delete product variations
```shell
curl -X DELETE https://vedaay-api.mulika.in/products/60/variation/64 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "code": 200,
    "message": "Variation deleted successfully"
}
```
<span style="background: #000000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d74e4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span> /product/variation/{id}
</span>

### Path Parameters

| Parameter   | Type    | Description                                   |
| ----------- | ------- | --------------------------------------------- |
| productId   | integer | ID of the parent product (`required`)         |
| variationId | integer | ID of the variation to delete (`required`)    |


## Generate variation
```shell
curl -X POST https://vedaay-api.mulika.in/products/422/generate-variations \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE


```
> Responce:

```json
{
    "status": "Success",
    "code": 200,
    "message": "Variations generated successfully",
    "data": [
        {
            "id": "490",
            "name": "my product V - Blue",
            "type": "variation",
            "status": "active",
            "product_role": "student",
            "subscription": "1",
            "subscription_type": "monthly",
            "created_by": "343",
            "product_code": "",
            "short_description": "",
            "price": "1",
            "manage_stock": "0",
            "stock_quantity": "0",
            "stock_status": "in_stock",
            "reviews_allowed": "0",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [
                {
                    "id": 69,
                    "items": [
                        155
                    ]
                }
            ],
            "parent_id": "422",
            "created_at": "2026-05-01 17:11:54",
            "updated_at": "2026-05-01 17:11:54",
            "weight": "",
            "length": "",
            "width": "",
            "height": "",
            "sku": "VAR-422-155"
        },
        {
            "id": "491",
            "name": "my product V - medium",
            "type": "variation",
            "status": "active",
            "product_role": "student",
            "subscription": "1",
            "subscription_type": "monthly",
            "created_by": "343",
            "product_code": "",
            "short_description": "",
            "price": "1",
            "manage_stock": "0",
            "stock_quantity": "0",
            "stock_status": "in_stock",
            "reviews_allowed": "0",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [
                {
                    "id": 70,
                    "items": [
                        156
                    ]
                }
            ],
            "parent_id": "422",
            "created_at": "2026-05-01 17:11:54",
            "updated_at": "2026-05-01 17:11:54",
            "weight": "",
            "length": "",
            "width": "",
            "height": "",
            "sku": "VAR-422-156"
        },
        {
            "id": "492",
            "name": "my product V - gray",
            "type": "variation",
            "status": "active",
            "product_role": "student",
            "subscription": "1",
            "subscription_type": "monthly",
            "created_by": "343",
            "product_code": "",
            "short_description": "",
            "price": "1",
            "manage_stock": "0",
            "stock_quantity": "0",
            "stock_status": "in_stock",
            "reviews_allowed": "0",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [
                {
                    "id": 71,
                    "items": [
                        157
                    ]
                }
            ],
            "parent_id": "422",
            "created_at": "2026-05-01 17:11:54",
            "updated_at": "2026-05-01 17:11:54",
            "weight": "",
            "length": "",
            "width": "",
            "height": "",
            "sku": "VAR-422-157"
        },
        {
            "id": "493",
            "name": "my product V - Red - medium - gray",
            "type": "variation",
            "status": "active",
            "product_role": "student",
            "subscription": "1",
            "subscription_type": "monthly",
            "created_by": "343",
            "product_code": "",
            "short_description": "",
            "price": "1",
            "manage_stock": "0",
            "stock_quantity": "0",
            "stock_status": "in_stock",
            "reviews_allowed": "0",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [
                {
                    "id": 69,
                    "items": [
                        154
                    ]
                },
                {
                    "id": 70,
                    "items": [
                        156
                    ]
                },
                {
                    "id": 71,
                    "items": [
                        157
                    ]
                }
            ],
            "parent_id": "422",
            "created_at": "2026-05-01 17:11:54",
            "updated_at": "2026-05-01 17:11:54",
            "weight": "",
            "length": "",
            "width": "",
            "height": "",
            "sku": "VAR-422-154-156-157"
        },
        {
            "id": "494",
            "name": "my product V - Blue - medium - gray",
            "type": "variation",
            "status": "active",
            "product_role": "student",
            "subscription": "1",
            "subscription_type": "monthly",
            "created_by": "343",
            "product_code": "",
            "short_description": "",
            "price": "1",
            "manage_stock": "0",
            "stock_quantity": "0",
            "stock_status": "in_stock",
            "reviews_allowed": "0",
            "average_rating": "0",
            "rating_count": "0",
            "attributes": [
                {
                    "id": 69,
                    "items": [
                        155
                    ]
                },
                {
                    "id": 70,
                    "items": [
                        156
                    ]
                },
                {
                    "id": 71,
                    "items": [
                        157
                    ]
                }
            ],
            "parent_id": "422",
            "created_at": "2026-05-01 17:11:54",
            "updated_at": "2026-05-01 17:11:54",
            "weight": "",
            "length": "",
            "width": "",
            "height": "",
            "sku": "VAR-422-155-156-157"
        }
    ]
}  
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #4e92d7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /products/{id}/variation/{id}
</span>




# Product Attribute

###  Product attribute

| Attribute         | Type          | Description                       |
| ----------------- | ------------- | --------------------------------- |
| attr_id           | int           | ID of the Product-attr            |
| label             | varchar(255)  | Name of the Product-attr          |

### Product attribute items

| Column   | Type                     | Description                         |
| -------- | ------------------------ | ----------------------------------- |
| items_id | int (PK, AI)             | Product attribute item ID           |
| attr_id  | int                      | Product attribute ID (`from URL`)   |
| label    | varchar(255)             | Attribute item label                |
| type     | enum(`general`,`course`) | Attribute item type                 |

### Product attribute item meta

| Column     | Type         | Description                             |
| ---------- | ------------ | --------------------------------------- |
| id         | int (PK, AI) | Meta record ID                          |
| items_id   | int          | Reference to `product_attribute_items.items_id` |
| meta_key   | varchar(255) | Meta key text                           |
| meta_value | varchar(255) | Meta value ID                           |




## Get all product attribute

```shell
curl -X GET https://vedaay-api.mulika.in/product-attribute \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "message": "Product-attr retrieved successfully",
    "code": 200,
    "data": [
        {
            "attr_id": "51",
            "label": "courses-A+B",
            "items": [
                {
                    "items_id": "121",
                    "label": "Level 4",
                    "type": "course",
                    "meta": [
                        {
                            "meta_id": "227",
                            "meta_key": "course_id",
                            "meta_value": "254"
                        },
                        {
                            "meta_id": "226",
                            "meta_key": "course_level",
                            "meta_value": "25"
                        }
                    ]
                }
            ]
        },
   ]
  }
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #42c253; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /product-attribute
</span>

1. GET /product-attribute?search=new test
2. GET /product-attribute?order=asc


## Get single product attribute

```shell
curl -X GET https://vedaay-api.mulika.in/product-attribute/51 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 {
    "status": "success",
    "code": 200,
    "message": "Successfully retrieved attribute",
    "data": {
        "attr_id": "51",
        "label": "courses-A+z",
        "items": [
            {
                "items_id": "121",
                "label": "Level 4",
                "type": "course",
                "meta": [
                    {
                        "meta_key": "course_id",
                        "meta_value": "254"
                    }
                ]
            }
        ]
    }
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #674ed7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> product-attribute/{id}
</span>

## Create product attribute

```shell
curl -X POST https://vedaay-api.mulika.in/product-attribute \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{

   "label": "courses-A+z"
}'
 ```
> Responce:

```json
    {
    "status": "success",
    "code": 200,
    "message": "Attribute updated successfully",
    "data": {
        "attr_id": "51",
        "label": "courses-A+z"
    }
}
```
POST /product-attribute
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d7be4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /product-attribute
</span>


## Update product attribute

```shell
curl -X PUT https://vedaay-api.mulika.in/product-attribute/51 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
    "label": "courses-A+B"
  }
```
> Responce:

```json
   {
    "status": "success",
    "code": 200,
    "message": "Attribute updated successfully",
    "data": {
        "attr_id": "51",
        "label": "courses-A+B"
    }
}
    
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #4e92d7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /product-attribute/{id}
</span>



## Delete product attribute

```shell
curl -X DELETE https://vedaay-api.mulika.in/product-attribute/51 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
	"status": "success",
	"message": "Product-attr deleted successfully",
	"code": 200,
	"data": {
		"id": "51"
	}
}
```
<span style="background: #000000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d74e4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span> /product-attribute/{id}
</span>


# product attribute iteam 

## Get all product attribute iteam 


```shell
curl -X GET https://vedaay-api.mulika.in/product-attribute/51/items \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "code": "200",
    "message": "successfully",
    "data": [
        [
            {
                "items_id": "121",
                "attr_id": "51",
                "label": "Level 4",
                "type": "course"
            }
        ]
    ]
}
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #42c253; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span>  /product-attribute/(id)/items
</span>



## Get single product attribute iteam 

```shell
curl -X GET https://vedaay-api.mulika.in/product-attribute/51/items/121 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "code": "200",
    "message": "successfully",
    "data": {
        "items_id": "121",
        "label": "Level 4",
        "type": "course",
        "meta": [
            {
                "meta_key": "course_id",
                "meta_value": "254"
            },
            {
                "meta_key": "course_levels",
                "meta_value": [
                    "25"
                ]
            }
        ]
    }
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #674ed7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /product-attribute/{id}/items/{id}
</span>


## Create product attribute iteam 

```shell
curl -X POST https://vedaay-api.mulika.in/product-attribute/51/items \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
        "label": "Level 4",
        "type": "course",
        "meta": [
            {
                "meta_key": "course_level",
                "meta_value": "45"
            },
            {
                "meta_key": "course_id",
                "meta_value": "254"
            }
        ]
    }'
 ```
> Responce:

```json
   {
    "status": "success",
    "code": 200,
    "message": "Item + meta added successfully",
    "data": {
        "items_id": 121,
        "label": "Level 4",
        "type": "course",
        "meta": [
            {
                "meta_key": "course_levels",
                "meta_value": "45"
            },
            {
                "meta_key": "course_id",
                "meta_value": "254"
            }
        ]
    }
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d7be4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /product-attribute
</span>


## Update product attribute iteam 

```shell
curl -X PUT https://vedaay-api.mulika.in/product-attribute/51/items \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
  "items_id": 121,
  "label": "Level 4",
  "type": "course",
  "meta": [
    {
      "meta_key": "course_level",
      "meta_value": "40"
    },
    {
      "meta_key": "course_id",
      "meta_value": "254"
    }
  ]
}'
```
> Responce:

```json
{
    "status": "success",
    "code": 200,
    "message": "Item updated successfully",
    "data": {
        "items_id": "121",
        "attr_id": "51",
        "label": "Level 4",
        "type": "course",
        "meta": [
            {
                "meta_key": "course_levels",
                "meta_value": "40"
            },
            {
                "meta_key": "course_id",
                "meta_value": "254"
            }
        ]
    }
}

```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #4e92d7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /product-attribute/{id}
</span>



## Delete  product attribute iteam 

```shell
curl -X DELETE https://vedaay-api.mulika.in/product-attribute/51/items/121 \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "code": "200",
    "message": "Item deleted successfully",
    "data": {
        "items_id": "121"
    }
}
```
<span style="background: #000000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #d74e4e; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span> /product-attribute/{id}/items/{id}
</span>

