Get All Products
Retrieves a list of all products in the system.
Response
Returns an array of product objects.
Unique identifier for the product
Brand identifier for the product
Available sizes for the product
Example Request
curl -X GET http://localhost:8080/api/products
Example Response
[
{
"id": "PROD001",
"brandId": "BRAND001",
"sizes": ["S", "M", "L", "XL"]
},
{
"id": "PROD002",
"brandId": "BRAND002",
"sizes": ["M", "L"]
}
]
Get Product By ID
Retrieves detailed information about a specific product.
Path Parameters
The unique identifier of the product to retrieve
Response
Returns a single product object.
Unique identifier for the product
Brand identifier for the product
Available sizes for the product
Example Request
curl -X GET http://localhost:8080/api/products/PROD001
Example Response
{
"id": "PROD001",
"brandId": "BRAND001",
"sizes": ["S", "M", "L", "XL"]
}
Error Responses
Product Not Found (404)
Returned when the requested product ID does not exist.
{
"error": "Product not found",
"message": "Product with ID PROD001 does not exist"
}