Products

Products

POST /products

Creates a new product with the given details

Endpoint

POST/products

Request Body

{
  "establishmentId": "string"
  "name": "string"
  "price": "number"
  "stock": "string"
  "valueInEuros": "string"
  "height": "number"
  "weight": "number"
  "extendedDescription": "string"
  "additionalDetails": "string"
  "verificationDate": "string"
  "verifiedBy": "string"
  "status": "string"
  "dateOfObject": "string"
  "imageUrl": "string"
  "featuredImageUrl": "string"
  "featured": "boolean"
}
AttributeType
establishmentIdstring
namestring
pricenumber
stockstring
valueInEurosstring
heightnumber
weightnumber
extendedDescriptionstring
additionalDetailsstring
verificationDatestring
verifiedBystring
statusstring
dateOfObjectstring
imageUrlstring
featuredImageUrlstring
featuredboolean

Responses

200

Product created successfully

{
  "message": "Product created successfully"
  "product_id": "123e4567-e89b-12d3-a456-426614174000"
}

400

Bad request, invalid input

{
  "error": "string"
}

500

Server error

{
  "error": "string"
}

GET /products

Lists products associated with a specific establishment ID.

Endpoint

GET/products

Parameters

AttributeDescriptionType
establishmentIdThe establishment ID to query products for.string

Responses

200

List of products associated with the establishment ID.

500

Internal Server Error - Error fetching products.

{
  "message": "string"
  "error": "string"
}

DELETE /products/[productId]

Deletes a product based on the provided product ID.

Endpoint

DELETE/products/{productId}

Parameters

AttributeDescriptionType
productIdThe ID of the product to delete.string

Responses

200

Product deleted successfully.

{
  "message": "string"
}

400

Bad Request - Missing or invalid product ID.

{
  "message": "string"
}

404

Product not found.

{
  "message": "string"
}

500

Internal Server Error - Error deleting the product.

{
  "message": "string"
}

PUT /products/[productId]

Updates a product with the given details

Endpoint

PUT/products/{productId}

Request Body

{
  "establishmentId": "string"
  "name": "string"
  "price": "number"
  "stock": "string"
  "valueInEuros": "string"
  "height": "number"
  "weight": "number"
  "extendedDescription": "string"
  "additionalDetails": "string"
  "verificationDate": "string"
  "verifiedBy": "string"
  "status": "string"
  "dateOfObject": "string"
}
AttributeType
establishmentIdstring
namestring
pricenumber
stockstring
valueInEurosstring
heightnumber
weightnumber
extendedDescriptionstring
additionalDetailsstring
verificationDatestring
verifiedBystring
statusstring
dateOfObjectstring

Parameters

AttributeDescriptionType
productIdThe ID of the product to update.string

Responses

200

Product created successfully

{
  "message": "Product created successfully"
  "product_id": "123e4567-e89b-12d3-a456-426614174000"
}

400

Bad request, invalid input

{
  "error": "string"
}

500

Server error

{
  "error": "string"
}