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
All fields are optional. Only include the fields you want to update.
| Field | Type | Description |
|---|---|---|
name | string | The name of the product. |
sku | string | The Stock Keeping Unit identifier. |
description | object | Detailed description of the product. |
specifications | array | List of specifications for the product. |
customUrl | string | Custom URL for the product. |
shortDescription | string | A short description of the product. |
weight | number | The weight of the product. |
dimensions | object | Dimensions of the product (width, height, depth). |
status | string | Product status; valid values are active or inactive. |
visibility | boolean | Visibility status of the product. |
manufacturer | string | Name of the manufacturer. |
mpn | string | Manufacturer Part Number. |
brand | string | The unique identifier (ID) of the brand. |
quantity | object | Quantity details |
mediaGallery | array | Array of media (images, videos) associated with the product. |
files | array | Array of file attachments related to the product. |
inventoryType | string | Type of inventory management. Valid values: product, variant. |
trackInventory | boolean | Indicates if inventory tracking is enabled for the product. |
isFeatured | boolean | Set this as true if the product is a featured product. |
inventory | array | Inventory details array. |
price | number | Price of the product. |
cost | number | The cost to acquire the product. |
sale | number | Sale price for the product (if on sale). |
additionalCost | object | Additional cost details with type and value. |
taxcode | string | Tax code for the product. |
isTaxExempt | boolean | Whether the product is tax exempt. |
options | array | Array of product options available. |
variants | array | Array of product variants. |
groupedProducts | array | Grouped products associated with this product, comprising product ID, quantity, and dynamic quantity. |
bundledProducts | array | Array of bundled products with each having optionTitle, inputType, and isRequired status. |
isFreeShipping | boolean | Determines if the product qualifies for free shipping. |
manageCustoms | boolean | Indicates if customs details are managed. |
customs | object | Customs information for the product. |
filters | array | Filter options applied to the product. |
metaFields | array | Array of metadata fields related to the product. |
tierPrice | array | Array of tierPrice fields based on qty and price. |
searchKeyWords | array | Keywords for improving product searchability. |
synonymKeywords | array | Array of synonym keywords for enhanced search capabilities. |
seo | object | SEO (Search Engine Optimization) attributes for the product. |
categories | array | IDs of categories the product belongs to. |
sortOrder | number | Sorting order priority. |
relatedProducts | array | Information about related products |
Description Object
| Field | Type | Description |
|---|---|---|
dataType | String | Format of the description, either "JSON" or "HTML". Default is "HTML". |
value | String | The actual product description in specified format. |
Specifications
| Field | Type | Description |
|---|---|---|
name | String | Name of the specification. |
value | String | Value of the specification. |
Dimensions
| Field | Type | Description |
|---|---|---|
width | Number | Width of the product. Default is 1. |
height | Number | Height of the product. Default is 1. |
depth | Number | Depth of the product. Default is 1. |
Quantity
| Field | Type | Description |
|---|---|---|
minQuantity | Number | Minimum quantity required. Default is 1. |
quantityIncrement | Number | Increment in quantity. Default is 1. |
Media Gallery
| Field | Type | Description |
|---|---|---|
type | String | Type of media, such as image or video. |
format | String | Format of the media file. |
label | String | Label/name for the media file. |
url | String | URL where the media file is located. |
isDefault | Boolean | Whether this is the default/primary media. Default: false |
Files
| Field | Type | Description |
|---|---|---|
type | String | Type of file, e.g., document, image, video. Default is "document". |
format | String | Format of the file, identifying the file type. |
name | String | File name for reference. |
url | String | Access URL for the file. |
Inventory
| Field | Type | Description |
|---|---|---|
stock | Number | Current stock level. |
minStock | Number | Minimum stock level to maintain. |
Additional Cost
| Field | Type | Description |
|---|---|---|
type | String | Type of additional cost. Valid values: fixed, percentage. |
value | Number | The additional cost value. |
Price Range
| Field | Type | Description |
|---|---|---|
minPrice | Number | Minimum price within the range. |
maxPrice | Number | Maximum price within the range. |
Options
| Field | Type | Description |
|---|---|---|
optionName | String | Name of the option. |
optionType | String | Type of option, e.g., color, dropdown, radio, etc. |
optionValues | Array of Objects | Values associated with this option. |
Option Values
| Field | Type | Description |
|---|---|---|
label | String | Display label for the option value. |
value | String | The actual value (e.g., hex color code, text). |
isDefault | Boolean | Whether this is the default selected value. |
Variants
| Field | Type | Description |
|---|---|---|
sku | String | Unique SKU for the variant. |
name | String | Name of the variant. |
price | Number | Price of the variant. |
cost | Number | Cost of the variant. |
sale | Number | Sale price for the variant. |
weight | Number | Weight of the variant. |
options | Array of Objects | Array of option selections for this variant. |
mediaGallery | Array | Variant-specific media gallery. |
inventory | Array | Variant-specific inventory details. |
tierPrice | Array | Variant-specific tier pricing. |
Variant Options
| Field | Type | Description |
|---|---|---|
optionName | String | Name of the option (must match parent option). |
optionValueLabel | String | Display label of the selected value. |
optionValue | String | The actual value selected. |
Metafields
| Field | Type | Description |
|---|---|---|
code | String | Code of the metafield (must match defined metafield). |
value | String | Value for the metafield. |
Customs
| Field | Type | Description |
|---|---|---|
countryCode | String | Code representing the country for customs. |
commodityDescription | String | Description of the commodity for customs purposes. |
hsCodes | Array of Objects | HsCode details with country and code. |
Filters
| Field | Type | Description |
|---|---|---|
code | String | Code for filter criteria. [Required] |
label | String | Label for the filter. [Required] |
options | Array of Objects | Options available under filter criteria. |
SEO
| Field | Type | Description |
|---|---|---|
pageTitle | String | Title to be optimized for SEO purposes. |
metaKeywords | String | Keywords to enhance searchability. |
metaDescription | String | Description meta-tag for SEO. |
Related Products
| Field | Type | Description |
|---|---|---|
code | String | Code associated with related product type. |
label | String | Label describing the relation. |
products | Array | Array of product IDs that are related. |
isShow | Boolean | Whether to display the related products section. |
Grouped Products
| Field | Type | Description |
|---|---|---|
productId | String | Identifier of the grouped product. |
quantity | Number | Quantity of the product within the group. |
dynamicQuantity | Boolean | Whether the quantity can dynamically change. |
Bundled Products
| Field | Type | Description |
|---|---|---|
optionTitle | String | Title of the bundled option. |
inputType | String | Input type for the bundled option. |
isRequired | Boolean | Indicates if the bundled product option is mandatory. Default is false. |
bundledItems | Array of Objects | Items included within the bundle configuration. |
Tier Price
| Field | Type | Description |
|---|---|---|
quantity | number | Minimum quantity for tier pricing. |
discount | number | Discount applied to this tier. |
price | number | Price at this tier. |
tierPricingType | string | Type of tier pricing (e.g., "discount", "fixed"). |
Sample Request
curl --location --request PUT '<BASE-URL>/products/{product_id}' \
--header 'accessToken: <ACCESS-TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Updated Product Name",
"status": "active"
}'
Example 1: Simple Update - Name and Description
{
"name": "Shirt",
"sku": "Shirt-2",
"shortDescription": "Black Color shirt",
"status": "active"
}
Example 2: Update Price and Inventory
{
"price": 299.99,
"cost": 180,
"sale": 249.99,
"trackInventory": true,
"inventory": [
{
"stock": 100,
"minStock": 10
}
]
}
Example 3: Update Product with Variants and Options
{
"name": "Developer Test Item",
"sku": "5920236",
"description": {
"dataType": "HTML",
"value": "<p>This is an updated test item</p>"
},
"shortDescription": "<p>This is an updated test item</p>",
"status": "active",
"dimensions": {
"width": 0,
"height": 0,
"depth": 0
},
"weight": 1,
"inventoryType": "variant",
"trackInventory": false,
"quantity": {
"minQuantity": 1,
"quantityIncrement": 1
},
"price": 261.54,
"cost": 170,
"sale": 0,
"manufacturer": "Alligator - TPMS",
"mpn": "5920234",
"brand": "65b0d13f98539a33577ac4cd",
"customUrl": "/developer-test-item/",
"isFeatured": false,
"isFreeShipping": false,
"visibility": true,
"categories": ["696a558b2c0b334070270d81"],
"mediaGallery": [
{
"url": "https://4870543.app.netsuite.com/core/media/media.nl?id=10625&c=4870543&h=6j3EEZseA21iSXh8x-OElXRN7ILXhnLuqWjfMK0OrQr82Myo",
"type": "image",
"label": "10625",
"isDefault": true
},
{
"url": "https://4870543.app.netsuite.com/core/media/media.nl?id=161737&c=4870543&h=aK9u0WIwV_3GjeQMBvw_ntOCpvWIzAM5vzuN2saCsYGnBo5X",
"type": "image",
"label": "161737",
"isDefault": false
}
],
"specifications": [
{
"name": "Details",
"value": "<p>This is an updated test item</p>"
}
],
"options": [
{
"optionName": "1 Color Options",
"optionType": "radio",
"optionValues": [
{
"label": "Red",
"value": "#F51115",
"isDefault": false
}
]
},
{
"optionName": "2 Color Options",
"optionType": "radio",
"optionValues": [
{
"label": "Black",
"value": "#362DF7",
"isDefault": false
},
{
"label": "Red",
"value": "#F51115",
"isDefault": false
}
]
}
],
"variants": [
{
"sku": "5920234-Red-Black",
"name": "Developer Test Item",
"price": 284.54,
"cost": 170,
"sale": 0,
"weight": 1,
"options": [
{
"optionName": "1 Color Options",
"optionValueLabel": "Red",
"optionValue": "#F51115"
},
{
"optionName": "2 Color Options",
"optionValueLabel": "Black",
"optionValue": "#362DF7"
}
],
"mediaGallery": [],
"inventory": [],
"tierPrice": []
},
{
"sku": "5920234-Red-Red",
"name": "Developer Test Item",
"price": 284.54,
"cost": 170,
"sale": 0,
"weight": 1,
"options": [
{
"optionName": "1 Color Options",
"optionValueLabel": "Red",
"optionValue": "#F51115"
},
{
"optionName": "2 Color Options",
"optionValueLabel": "Red",
"optionValue": "#F51115"
}
],
"mediaGallery": [],
"inventory": [],
"tierPrice": []
}
],
"metaFields": [
{
"code": "capacity",
"value": "500 ml"
},
{
"code": "dimension",
"value": "100 x 50 x 30 cm"
}
],
"relatedProducts": [
{
"code": "relatedProduct",
"label": "Related Product",
"products": ["69660a7730f4d2a940149eed"],
"isShow": true
}
]
}
Example 4: Update Media Gallery Only
{
"mediaGallery": [
{
"url": "https://cdn.example.com/product-image-1.jpg",
"type": "image",
"label": "Front View",
"isDefault": true
},
{
"url": "https://cdn.example.com/product-image-2.jpg",
"type": "image",
"label": "Side View",
"isDefault": false
},
{
"url": "https://www.youtube.com/watch?v=example",
"type": "video",
"label": "Product Demo",
"isDefault": false
}
]
}
Example 5: Update Metafields and Categories
{
"categories": ["65b0d13f98539a33577ac4cb", "65b88ef2045a7d009e797eff"],
"metaFields": [
{
"code": "brand_name",
"value": "Premium Brand"
},
{
"code": "material_type",
"value": "Cotton"
}
]
}
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.