GET /products/{id}

Path parameters

  • id string Required

    The CUID of the product to retrieve

Responses

  • 200 application/json

    Product details retrieved successfully

    Hide response attributes Show response attributes object
    • id string Required

      Unique identifier for the product (CUID)

    • name string Required

      Name of the product

    • description string | null

      Description of the product

    • image string | null

      URL of the product image

    • price number(double) Required

      Price of the product

  • 404 application/json

    Product not found

    Hide response attribute Show response attribute object
    • message string Required

      A message describing the error

  • 500 application/json

    Internal Server Error

    Hide response attribute Show response attribute object
    • message string Required

      A message describing the error

GET /products/{id}
curl \
 --request GET 'http://localhost:3000/api/v1/products/{id}'
Response examples (200)
{
  "id": "string",
  "name": "string",
  "description": "string",
  "image": "string",
  "price": 42.0
}
Response examples (404)
{
  "message": "Product not found"
}
Response examples (500)
{
  "message": "Product not found"
}