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

All fields are optional. Only include the fields you want to update.

FieldTypeDescription
namestringThe name of the product.
skustringThe Stock Keeping Unit identifier.
descriptionobjectDetailed description of the product.
specificationsarrayList of specifications for the product.
customUrlstringCustom URL for the product.
shortDescriptionstringA short description of the product.
weightnumberThe weight of the product.
dimensionsobjectDimensions of the product (width, height, depth).
statusstringProduct status; valid values are active or inactive.
visibilitybooleanVisibility status of the product.
manufacturerstringName of the manufacturer.
mpnstringManufacturer Part Number.
brandstringThe unique identifier (ID) of the brand.
quantityobjectQuantity details
mediaGalleryarrayArray of media (images, videos) associated with the product.
filesarrayArray of file attachments related to the product.
inventoryTypestringType of inventory management. Valid values: product, variant.
trackInventorybooleanIndicates if inventory tracking is enabled for the product.
isFeaturedbooleanSet this as true if the product is a featured product.
inventoryarrayInventory details array.
pricenumberPrice of the product.
costnumberThe cost to acquire the product.
salenumberSale price for the product (if on sale).
additionalCostobjectAdditional cost details with type and value.
taxcodestringTax code for the product.
isTaxExemptbooleanWhether the product is tax exempt.
optionsarrayArray of product options available.
variantsarrayArray of product variants.
groupedProductsarrayGrouped products associated with this product, comprising product ID, quantity, and dynamic quantity.
bundledProductsarrayArray of bundled products with each having optionTitle, inputType, and isRequired status.
isFreeShippingbooleanDetermines if the product qualifies for free shipping.
manageCustomsbooleanIndicates if customs details are managed.
customsobjectCustoms information for the product.
filtersarrayFilter options applied to the product.
metaFieldsarrayArray of metadata fields related to the product.
tierPricearrayArray of tierPrice fields based on qty and price.
searchKeyWordsarrayKeywords for improving product searchability.
synonymKeywordsarrayArray of synonym keywords for enhanced search capabilities.
seoobjectSEO (Search Engine Optimization) attributes for the product.
categoriesarrayIDs of categories the product belongs to.
sortOrdernumberSorting order priority.
relatedProductsarrayInformation about related products

Description Object

FieldTypeDescription
dataTypeStringFormat of the description, either "JSON" or "HTML". Default is "HTML".
valueStringThe actual product description in specified format.

Specifications

FieldTypeDescription
nameStringName of the specification.
valueStringValue of the specification.

Dimensions

FieldTypeDescription
widthNumberWidth of the product. Default is 1.
heightNumberHeight of the product. Default is 1.
depthNumberDepth of the product. Default is 1.

Quantity

FieldTypeDescription
minQuantityNumberMinimum quantity required. Default is 1.
quantityIncrementNumberIncrement in quantity. Default is 1.
FieldTypeDescription
typeStringType of media, such as image or video.
formatStringFormat of the media file.
labelStringLabel/name for the media file.
urlStringURL where the media file is located.
isDefaultBooleanWhether this is the default/primary media. Default: false

Files

FieldTypeDescription
typeStringType of file, e.g., document, image, video. Default is "document".
formatStringFormat of the file, identifying the file type.
nameStringFile name for reference.
urlStringAccess URL for the file.

Inventory

FieldTypeDescription
stockNumberCurrent stock level.
minStockNumberMinimum stock level to maintain.

Additional Cost

FieldTypeDescription
typeStringType of additional cost. Valid values: fixed, percentage.
valueNumberThe additional cost value.

Price Range

FieldTypeDescription
minPriceNumberMinimum price within the range.
maxPriceNumberMaximum price within the range.

Options

FieldTypeDescription
optionNameStringName of the option.
optionTypeStringType of option, e.g., color, dropdown, radio, etc.
optionValuesArray of ObjectsValues associated with this option.

Option Values

FieldTypeDescription
labelStringDisplay label for the option value.
valueStringThe actual value (e.g., hex color code, text).
isDefaultBooleanWhether this is the default selected value.

Variants

FieldTypeDescription
skuStringUnique SKU for the variant.
nameStringName of the variant.
priceNumberPrice of the variant.
costNumberCost of the variant.
saleNumberSale price for the variant.
weightNumberWeight of the variant.
optionsArray of ObjectsArray of option selections for this variant.
mediaGalleryArrayVariant-specific media gallery.
inventoryArrayVariant-specific inventory details.
tierPriceArrayVariant-specific tier pricing.

Variant Options

FieldTypeDescription
optionNameStringName of the option (must match parent option).
optionValueLabelStringDisplay label of the selected value.
optionValueStringThe actual value selected.

Metafields

FieldTypeDescription
codeStringCode of the metafield (must match defined metafield).
valueStringValue for the metafield.

Customs

FieldTypeDescription
countryCodeStringCode representing the country for customs.
commodityDescriptionStringDescription of the commodity for customs purposes.
hsCodesArray of ObjectsHsCode details with country and code.

Filters

FieldTypeDescription
codeStringCode for filter criteria. [Required]
labelStringLabel for the filter. [Required]
optionsArray of ObjectsOptions available under filter criteria.

SEO

FieldTypeDescription
pageTitleStringTitle to be optimized for SEO purposes.
metaKeywordsStringKeywords to enhance searchability.
metaDescriptionStringDescription meta-tag for SEO.
FieldTypeDescription
codeStringCode associated with related product type.
labelStringLabel describing the relation.
productsArrayArray of product IDs that are related.
isShowBooleanWhether to display the related products section.

Grouped Products

FieldTypeDescription
productIdStringIdentifier of the grouped product.
quantityNumberQuantity of the product within the group.
dynamicQuantityBooleanWhether the quantity can dynamically change.

Bundled Products

FieldTypeDescription
optionTitleStringTitle of the bundled option.
inputTypeStringInput type for the bundled option.
isRequiredBooleanIndicates if the bundled product option is mandatory. Default is false.
bundledItemsArray of ObjectsItems included within the bundle configuration.

Tier Price

FieldTypeDescription
quantitynumberMinimum quantity for tier pricing.
discountnumberDiscount applied to this tier.
pricenumberPrice at this tier.
tierPricingTypestringType 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
}
]
}
{
"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

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.