Skip to main content

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

ParameterTypeDescription
product_idstringThe unique identifier of the product to update.

Request Headers

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess token for authentication. (required)

Request Body

The request body should include updated details for the product. Below are the fields that can be updated:

FieldTypeDescription
namestringThe name of the product.
skustringStock Keeping Unit identifier.
descriptionobjectDetailed description structure.
shortDescriptionstringShort description of the product.
specificationsarrayList of product specifications.
statusstringStatus of the product (e.g., "active").
weightnumberWeight of the product.
filesarrayList of file attachments (currently empty).
manufacturerstringName of the manufacturer.
pricestringPrice of the product.
optionsarrayProduct options (currently empty).
variantsarrayProduct variants (currently empty).
metaFieldsarrayAdditional metadata fields (currently empty).
mediaGalleryarrayList of media objects with url, type, label, and isDefault.
categoriesarrayList of category IDs the product belongs to.
bundledProductsarrayList of bundled products (currently empty).
groupedProductsarrayList of grouped product objects with productId, quantity, and dynamicQuantity.
tierPricearrayArray 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

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true for a successful operation.
messagestringA message conveying the outcome of the operation, e.g., "Product updated Successfully".
dataobjectContains the product object detailing the product information just added.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal 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.