Skip to main content

Endpoint

PUT /api/v1/products/{id}
Updates an existing product with new information.

Path Parameters

id
integer
required
The unique identifier of the product to update

Request Body

name
string
required
The name of the product
description
string
required
Detailed description of the product
sku
string
required
Stock Keeping Unit identifier
category_id
integer
required
ID of the category this product belongs to
price
number
required
Selling price of the product
cost_price
number
required
Cost price of the product
weight_kg
number
required
Weight of the product in kilograms
is_active
boolean
required
Whether the product is active and available for sale

Response

Returns the updated product object with all fields.
id
integer
Unique identifier for the product
name
string
The name of the product
description
string
Detailed description of the product
sku
string
Stock Keeping Unit identifier
category_id
integer
ID of the product’s category
price
number
Selling price of the product
cost_price
number
Cost price of the product
weight_kg
number
Weight in kilograms
is_active
boolean
Whether the product is active
created_at
string
Original creation timestamp in ISO 8601 format
product_dimension_id
integer
ID of the associated product dimensions record
product_inventory_id
integer
ID of the associated inventory record
image_ids
array
List of image IDs associated with this product

Example

curl -X PUT "https://api.furniture.com/api/v1/products/1" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Modern Oak Dining Table - Updated",
    "description": "Elegant 8-seater dining table made from solid oak wood with premium finish",
    "sku": "TBL-OAK-001",
    "category_id": 5,
    "price": 999.99,
    "cost_price": 475.00,
    "weight_kg": 50.0,
    "is_active": true
  }'

Response Example

{
  "id": 1,
  "name": "Modern Oak Dining Table - Updated",
  "description": "Elegant 8-seater dining table made from solid oak wood with premium finish",
  "sku": "TBL-OAK-001",
  "category_id": 5,
  "price": 999.99,
  "cost_price": 475.00,
  "weight_kg": 50.0,
  "is_active": true,
  "created_at": "2024-01-15T10:30:00",
  "product_dimension_id": 1,
  "product_inventory_id": 1,
  "image_ids": [101, 102, 103]
}

Response Codes

200
Success
Product updated successfully
404
Error
Product not found with the specified ID
400
Error
Invalid request body or validation errors

Build docs developers (and LLMs) love