The Furniture Bros API docs
  • Start here
    • Introduction
    • Get Started
    • Authentication
    • Making a request
    • Examples
    • Functionalities
    • Release Notes
      • 5 Dec 2024
      • 4 Dec 2023
      • 30 Nov 2023
      • 24 Nov 2023
      • 20 Nov 2023
      • 14 Nov 2023
      • 26 Oct 2023
      • 23 Oct 2023
      • 05 Oct 2023
    • Glossary
      • API terms
      • Functionality terms
  • API Endpoints
    • Account
    • Product
    • Cart
    • Address
    • Orders
    • Statistics
Powered by GitBook
On this page
  1. API Endpoints

Product

This page contains the documentation for the product endpoints.

PreviousAccountNextCart

Last updated 6 months ago

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

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
400
See message description.
500
see message description.
get
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

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
400
See message description.
500
see message description.
get
GET /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Accept: */*
binary

Delete a Product

delete

This endpoint allows you get delete a product.

Authorizations
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
400
See message description.
500
see message description.
delete
DELETE /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "msg": "Item deleted"
}

Get Product Details

get

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
400
See message description.
500
see message description.
get
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
}
  • GETGet Product list
  • GETGet a Product Image
  • PUTEdit a Product
  • DELETEDelete a Product
  • GETGet Product Details
  • POSTUpload a Product

Edit a Product

put

This endpoint allows you to edit a product.

Authorizations
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
400
See message description.
500
see message description.
put
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
  }
}

Upload a Product

post

This endpoint allows you to upload a product.

Authorizations
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
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"
}