Skip to main content

Endpoint

POST /api/v1/products
Creates a new product with the provided information.

Request Body

name
string
required
The name of the product
description
string
required
Detailed description of the product
sku
string
required
Stock Keeping Unit - unique identifier for inventory management
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 (for margin calculation)
weight_kg
number
required
Weight of the product in kilograms
is_active
boolean
required
Whether the product is currently active and available for sale

Response

Returns the created product object with all fields including the generated ID and timestamp.
id
integer
Unique identifier for the newly created 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
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 POST "https://api.furniture.com/api/v1/products" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Modern Oak Dining Table",
    "description": "Elegant 6-seater dining table made from solid oak wood",
    "sku": "TBL-OAK-001",
    "category_id": 5,
    "price": 899.99,
    "cost_price": 450.00,
    "weight_kg": 45.5,
    "is_active": true
  }'

Response Example

{
  "id": 1,
  "name": "Modern Oak Dining Table",
  "description": "Elegant 6-seater dining table made from solid oak wood",
  "sku": "TBL-OAK-001",
  "category_id": 5,
  "price": 899.99,
  "cost_price": 450.00,
  "weight_kg": 45.5,
  "is_active": true,
  "created_at": "2024-01-15T10:30:00",
  "product_dimension_id": null,
  "product_inventory_id": null,
  "image_ids": []
}

Response Codes

201
Success
Product created successfully. The response includes a Location header with the URI of the created resource.
400
Error
Invalid request body or validation errors

Build docs developers (and LLMs) love