Skip to main content
PUT
/
api
/
product
/
inventory
/
update
/
{product_id}
Update Product
curl --request PUT \
  --url https://api.example.com/api/product/inventory/update/{product_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "category": "<string>",
  "barcode": "<string>"
}
'
{
  "message": "<string>",
  "productId": "<string>",
  "name": "<string>"
}
This endpoint requires authentication. Include a valid Bearer token in the Authorization header.

Endpoint

PUT /api/product/inventory/update/{product_id}
This endpoint updates the details of an existing product in the inventory database.

Path Parameters

product_id
string
required
The unique identifier of the product to update

Request Body

All fields are optional. Only include the fields you want to update.
name
string
The updated name of the product
category
string
The updated category of the product
barcode
string
The updated barcode identifier for the product

Authentication

This endpoint requires a valid JWT Bearer token. The token should be included in the Authorization header:
Authorization: Bearer <your_access_token>
The user ID is extracted from the JWT token to verify authorization.

Response

message
string
Status message indicating successful update
productId
string
The unique identifier of the updated product
name
string
The updated name of the product

Example Request

curl -X PUT https://api.expireeye.com/api/product/inventory/update/550e8400-e29b-41d4-a716-446655440000 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -d '{
    "name": "Organic Whole Milk",
    "category": "Dairy Products",
    "barcode": "123456789012"
  }'

Example Response

{
  "message": "Product updated successfully",
  "productId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Organic Whole Milk"
}

Error Responses

If the product is not found or the update fails, an appropriate error response will be returned:
{
  "detail": "Product not found"
}

Build docs developers (and LLMs) love