Product

This page contains the documentation for the product endpoints.

The product endpoints allow you to get the list of products available and the details. You can also get the picture of the product. If your account has administrative rights, you can modify and delete a product.

Get Product list

get
/products

This endpoint allows you get the list of available products. It shows all available product.

Responses
200

Successful response. Returns a list of product.

application/json
get
/products
GET /products HTTP/1.1
Host: thefurniturebros.com
Accept: */*
[
  {
    "_id": "6555a1f49feeac7dccd9b1ee",
    "name": "brown tablede",
    "image": "1700110836527.webp",
    "price": 30,
    "description": "this is a brown table",
    "soldCount": 90,
    "__v": 0
  }
]

Get a Product Image

get
/products/{filename}

This endpoint allows you get the image of the product. The image is in the .webp format.

Path parameters
filenamestringRequired

The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.

Example: 1700110836527.webp
Responses
200

Successful response. Returns the image of the product.

image/webp
Responsestring · binary
get
/products/{filename}
GET /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Accept: */*
binary

Edit a Product

put
/products/{filename}

This endpoint allows you to edit a product.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Provide your API key.

Path parameters
filenamestringRequired

The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.

Example: 1700110836527.webp
Body
namestringOptional

The new name of the product.

Example: sample_item
imagestring · binaryOptional

The new filename of the product's image.

pricenumber · floatOptional

The new price of the product.

Example: 50
descriptionstringOptional

The new description of the product.

Example: sample description
soldCountintegerOptional

The new total number of units sold.

Example: 35
Responses
200

Successful response. Returns the new information of the product.

application/json
put
/products/{filename}
PUT /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 100

{
  "name": "sample_item",
  "image": "binary",
  "price": 50,
  "description": "sample description",
  "soldCount": 35
}
{
  "msg": "Product updated successfully",
  "updatedProduct": {
    "_id": "6555a1f49feeac7dccd9b1ee",
    "name": "brown tablede",
    "image": "1700110836527.webp",
    "price": 30,
    "description": "this is a brown table",
    "soldCount": 90,
    "__v": 0
  }
}

Delete a Product

delete
/products/{filename}

This endpoint allows you get delete a product.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Provide your API key.

Path parameters
filenamestringRequired

The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.

Example: 1701082686603.webp
Responses
200

Successful response. Returns the status of the operation.

application/json
delete
/products/{filename}
DELETE /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "msg": "Item deleted"
}

Get Product Details

get
/products/details/{filename}

This endpoint allows you get the details of a product.

Path parameters
filenamestring · min: 1Required

The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.

Responses
200

Successful response. Returns the information of the product

application/json
get
/products/details/{filename}
GET /products/details/{filename} HTTP/1.1
Host: thefurniturebros.com
Accept: */*
{
  "_id": "6555a1f49feeac7dccd9b1ee",
  "name": "brown tablede",
  "image": "1700110836527.webp",
  "price": 30,
  "description": "this is a brown table",
  "soldCount": 90,
  "__v": 0
}

Upload a Product

post
/products/upload

This endpoint allows you to upload a product.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Provide your API key.

Body
namestringOptional

The name of the product.

Example: sample item
imagestring · binaryOptional

The filename of the product's image.

pricenumber · floatOptional

The price of the product.

Example: 50
descriptionstringOptional

The description of the product.

Example: sample description
soldCountintegerOptional

The total number of units sold.

Example: 35
Responses
200

Successful response. Returns the status of the operation.

application/json
post
/products/upload
POST /products/upload HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 100

{
  "name": "sample item",
  "image": "binary",
  "price": 50,
  "description": "sample description",
  "soldCount": 35
}
200

Successful response. Returns the status of the operation.

{
  "msg": "product saved succesfully"
}

Last updated