Create product
Create a new product in the catalog.
Request body
Product name (max 150 characters)
Product description (max 1000 characters)
Brand name (max 100 characters)
ID of the category this product belongs to. Must be a positive integer.
Product price. Must be a non-negative decimal value with up to 2 decimal places.
ISO 3-letter uppercase currency code (e.g., USD, EUR, GBP)
Product status. Valid values: ACTIVE, INACTIVE, OUT_OF_STOCK, DISCONTINUED
curl -X POST "http://localhost:8083/products" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Premium Wireless Headphones",
"description": "High-quality noise-canceling headphones with 30-hour battery life",
"brand": "AudioTech",
"categoryId": 5,
"price": 199.99,
"currency": "USD",
"status": "ACTIVE"
}'
Response
Unique product identifier
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Whether the product is soft-deleted
{
"id": 123,
"name": "Premium Wireless Headphones",
"description": "High-quality noise-canceling headphones with 30-hour battery life",
"brand": "AudioTech",
"categoryId": 5,
"price": 199.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-03-03T12:00:00Z",
"updatedAt": "2026-03-03T12:00:00Z",
"deleted": false
}
List products
Retrieve a paginated list of products with optional filters.
Query parameters
Filter products by category ID
Filter products by brand name
Filter by product status. Valid values: ACTIVE, INACTIVE, OUT_OF_STOCK, DISCONTINUED
Page number (zero-indexed)
Sort criteria (e.g., name,asc or price,desc)
curl -X GET "http://localhost:8083/products?categoryId=5&status=ACTIVE&page=0&size=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
Current page number (zero-indexed)
Total number of products matching the filters
Whether this is the last page
{
"content": [
{
"id": 123,
"name": "Premium Wireless Headphones",
"description": "High-quality noise-canceling headphones",
"brand": "AudioTech",
"categoryId": 5,
"price": 199.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-02-01T14:20:00Z",
"deleted": false
},
{
"id": 124,
"name": "Bluetooth Speaker",
"description": "Portable waterproof speaker",
"brand": "AudioTech",
"categoryId": 5,
"price": 79.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-01-20T09:15:00Z",
"updatedAt": "2026-01-20T09:15:00Z",
"deleted": false
}
],
"page": 0,
"size": 10,
"totalElements": 45,
"totalPages": 5,
"last": false
}
Get product by ID
Retrieve detailed information about a specific product.
GET /products/{productId}
Path parameters
The unique identifier of the product
curl -X GET "http://localhost:8083/products/123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
Unique product identifier
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Whether the product is soft-deleted
{
"id": 123,
"name": "Premium Wireless Headphones",
"description": "High-quality noise-canceling headphones with 30-hour battery life",
"brand": "AudioTech",
"categoryId": 5,
"price": 199.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-02-01T14:20:00Z",
"deleted": false
}
Update product
Update an existing product’s information.
PUT /products/{productId}
Path parameters
The unique identifier of the product to update
Request body
Product name (max 150 characters)
Product description (max 1000 characters)
Brand name (max 100 characters)
ID of the category this product belongs to. Must be a positive integer.
Product price. Must be a non-negative decimal value.
ISO 3-letter uppercase currency code
Product status. Valid values: ACTIVE, INACTIVE, OUT_OF_STOCK, DISCONTINUED
curl -X PUT "http://localhost:8083/products/123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Premium Wireless Headphones Pro",
"description": "Updated model with enhanced features",
"brand": "AudioTech",
"categoryId": 5,
"price": 249.99,
"currency": "USD",
"status": "ACTIVE"
}'
Response
Unique product identifier
Updated product description
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Whether the product is soft-deleted
{
"id": 123,
"name": "Premium Wireless Headphones Pro",
"description": "Updated model with enhanced features",
"brand": "AudioTech",
"categoryId": 5,
"price": 249.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-03-03T12:30:00Z",
"deleted": false
}
Delete product
Soft delete a product. The product will be marked as deleted but not removed from the database.
DELETE /products/{productId}
Path parameters
The unique identifier of the product to delete
curl -X DELETE "http://localhost:8083/products/123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
{
"message": "Product deleted successfully"
}
Search products
Search for products by name or brand using a query string.
Query parameters
Search term to match against product names and brands
curl -X GET "http://localhost:8083/products/search?query=wireless" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
Returns an array of product objects matching the search query.
[
{
"id": 123,
"name": "Premium Wireless Headphones",
"description": "High-quality noise-canceling headphones",
"brand": "AudioTech",
"categoryId": 5,
"price": 199.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-02-01T14:20:00Z",
"deleted": false
},
{
"id": 125,
"name": "Wireless Gaming Mouse",
"description": "Ergonomic wireless mouse for gaming",
"brand": "TechGear",
"categoryId": 8,
"price": 49.99,
"currency": "USD",
"status": "ACTIVE",
"createdAt": "2026-02-10T11:00:00Z",
"updatedAt": "2026-02-10T11:00:00Z",
"deleted": false
}
]