Update Product
Update an existing base product.
Endpoint
Authentication
Required (Store role)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | Product ID |
Request Body
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
category_id |
integer | No | Category ID |
brand_id |
integer | No | Brand ID (nullable) |
currency_id |
integer | No | Currency ID |
Response
Success (200 OK)
{
"id": 1,
"store_id": 5,
"store": {...},
"category_id": 4,
"category": {...},
"brand_id": 3,
"brand": {...},
"currency_id": 2,
"currency": {...},
"created": "2025-01-15T10:30:00Z"
}
Error Responses
Product Not Found (404)
Category Not Found (404)
Example Request
curl -X PUT "https://api.luxmart.site/v1/products/store/?id=1" \
-H "Authorization: Token your_access_token" \
-H "Content-Type: application/json" \
-d '{
"category_id": 4,
"brand_id": 3,
"currency_id": 2
}'
Notes
- Only provided fields are updated
- Product must belong to the authenticated store
- Category, brand, and currency must exist and not be deleted