Ingredients can be used for food products, or ingredients can be used as specifications or characteristics for a product.
| Action | Method | Resource | |
|---|---|---|---|
| Get all | GET | /business/:business_id/categories/:category_id/products/:product_id/ingredients | Get all ingredients of a product with business_idcategory_id and product_id. |
| Get | GET | /business/:business_id/:category_id/products/:product_id/ingredients/:ingredient_id | Get all ingredient of a product with business_idcategory_id , product_id and ingredient_id. |
| Create | POST | /business/:business_id/categories/:category_id/products/:product_id/ingredients | create ingredients of a product with business_idcategory_id and product_id. |
| Update | POST | /business/:business_id/:category_id/products/:product_id/ingredients/:ingredient_id | Update ingredient of a product with business_idcategory_id , product_id and ingredient_id. |
| Delete | DELETE | /business/:business_id/:category_id/products/:product_id/ingredients/:ingredient_id | delete ingredient of a product with business_idcategory_id , product_id and ingredient_id. |
| Attribute | Type | Required | Description |
|---|---|---|---|
| name | string | no, required to create | The ingredient name. |
| image | string | no | The ingredient image. |
Restrictions for POST, PUT, DELETE ingredients.Product ingredients can only be created, updated or removed by user level 0 (Type: Administrator) and user level 2 (Type: Business owner).
- User type Administrator can create, update or remove any products ingredients for any business.
- User type Business owner can create, update or remove only product ingredients related to his business.
Note: Unlike the extras that are shared between products, the ingredients are directly linked to the products and are not shared between products.

