Business Products Model

Action

Method

Resource

Description

Get all

GET

/business/:business_id/categories/:category_id/products

Get all products with business_id and category_id.

Get

GET

/business/:business_id/categories/:category_id/products/:product_id

Get product with id business_id, category_id and product_id.

Create

POST

/business/:business_id/categories/:category_id/products

Create a product with business_id and category_id.

Update

POST

/business/:business_id/categories/:category_id/products/:product_id

Update product with business_id, category_id and product_id.

Delete

DELETE

/business/:business_id/categories/:category_id/procuts/:product_id

Delete product with business_id, category_id and product_id.

The product model is composed of the following attributes:

Attribute

Type

Required

Description

name

string

no, required to create.

The product's name.

price

float

no, required to create.

The product's price.

description

string

no

The product's description.

images

base64 image, url image or File image.

no

The product's image.

inventoried

boolean

no

If product is inventoried or not.

quantity

integer

no

The product's quantity when the product is inventoried.

featured

boolean

no

If the product is featured or not.

extras

json

no

The product's extras.

enabled

boolean

no

The product's status.

upselling

bolean

no

📘

Restrictions for POST, PUT, DELETE products.

Business products 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 business products.
  • User type Business owner can create,update or remove only business products related to his business.

📘

GET responses for business menus

In general, there are no restrictions to obtain business products but exist to paths to obtain and data obtained depends on the type of user:

  • Normal
  • mode:dashboard

Therefore, depending on the mode and the type of user response will be obtained as shown below:

  • User type Administrator and mode:dashboard can get all business products.
  • User type Business owner and mode:dashboard can get business products related to his business.
  • User type Customer can get all business products bounded by the business he can get and if business products are enabled for his request.

📘

Upselling feature

This feature has been implemented to have a way to promote new products, the best use for this is once you finish filling the cart and ask if you want any of these products with this attribute if you have ingredients or extras, this product options are opened and if it is not added directly to the cart.

Example: