Update Product
The PUT endpoint updates the details of an existing product specified by the product_id.
Endpoint
- URL:
/products/{product_id} - Method:
PUT
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
product_id | string | The unique identifier of the product to update. |
Request Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be application/json. |
accessToken | string | Access token for authentication. (required) |
Request Body
The request body should include updated details for the product. Below are the fields that can be updated:
| Field | Type | Description |
|---|---|---|
name | string | The name of the product. |
sku | string | Stock Keeping Unit identifier. |
description | object | Detailed description structure. |
shortDescription | string | Short description of the product. |
specifications | array | List of product specifications. |
status | string | Status of the product (e.g., "active"). |
weight | number | Weight of the product. |
files | array | List of file attachments (currently empty). |
manufacturer | string | Name of the manufacturer. |
price | string | Price of the product. |
options | array | Product options (currently empty). |
variants | array | Product variants (currently empty). |
metaFields | array | Additional metadata fields (currently empty). |
mediaGallery | array | List of media objects with url, type, label, and isDefault. |
categories | array | List of category IDs the product belongs to. |
bundledProducts | array | List of bundled products (currently empty). |
groupedProducts | array | List of grouped product objects with productId, quantity, and dynamicQuantity. |
tierPrice | array | Array of tierPrice fields based on qty and price. |
Sample Request Body
{
"name": "Shirt",
"sku": "Shirt-2",
"shortDescription": "Black Color shirt",
}
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"message": "Product updated Successfully",
"data": {
"name": "Shirt"
}
}
Success Response Body
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request, typically true for a successful operation. |
message | string | A message conveying the outcome of the operation, e.g., "Product updated Successfully". |
data | object | Contains the product object detailing the product information just added. |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure you replace
{product_id}in the URL with the actual unique identifier of the product being updated. - Provide a valid and active access token in the request header to authenticate your request.