Update Product
Products
Update Product
Update an existing product’s information
PUT
Update Product
Endpoint
Authentication
Admin access required. Only users with theADMIN role can update products.
Path Parameters
number
required
The unique identifier of the product to update
Request Headers
Request Body
This endpoint acceptsmultipart/form-data to support image upload. All fields are optional - only include fields you want to update.
string
Product name (minimum 3 characters)
string
Product description (minimum 10 characters)
number
Product price (must be positive)
number
Original price (for displaying discounts)
number
Stock quantity (must be non-negative integer)
number
Category ID to associate with this product
number
Brand ID to associate with this product
number
Product weight in kg
number
Product height in cm
number
Product width in cm
number
Product depth in cm
boolean
Whether this product should be featured
file
Product image file (uploaded as multipart form data). If provided, replaces the existing image.
Response
boolean
Indicates if the product was updated successfully
object
The updated product object
number
Unique product identifier
string
Product name
string
Product description
decimal
Product price
decimal
Original price
number
Stock quantity
string
Product image URL
boolean
Featured status
decimal
Weight in kg
number
Height in cm
number
Width in cm
number
Depth in cm
number
Category ID
number
Brand ID
datetime
Creation timestamp
datetime
Last update timestamp
Example Request
Example Response
Error Responses
Invalid Product ID
Validation Error
Unauthorized
Server Error
Notes
- Only include fields you want to update in the request body
- If a new image is uploaded, it will replace the existing image
- The
updatedAttimestamp is automatically updated - Product dimensions and weight are important for shipping calculations