Create Product
This endpoint allows you to create a new product with detailed specifications, status, categories, and associated products.
Endpoint
- URL:
/products - Method:
POST
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Request Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be application/json. |
accessToken | string | Access token for authentication. (required) |
Request Body
| Field | Type | Description |
|---|---|---|
name | string | The name of the product. Required. |
sku | string | The Stock Keeping Unit identifier. Required. |
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. Required. |
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 | object | 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 Body
Example 1: Simple Product
{
"name": "Shirt",
"sku": "Shirt-1",
"shortDescription": "White Color shirt",
"specifications": [
{
"name": "Id",
"value": "23766"
},
{
"name": "Supplier Part Number",
"value": "806611"
},
{
"name": "Manufacturer Name",
"value": "Berry Plastics"
},
{
"name": "Inv Mast Uid",
"value": "21443"
}
],
"status": "active",
"weight": 0,
"files": [],
"manufacturer": "Berry Plastics",
"brand": "65b0d13f98539a33577ac4cc",
"price": "0.00",
"options": [],
"variants": [],
"metaFields": [],
"mediaGallery": [
{
"url": "https://cdn.flexipim.com/spruceindustries/product_assets/media/1672783399_aluf-plastics-contractor-bags-pg6-6060-64600.jpg",
"type": "image",
"label": "1672783399_aluf-plastics-contractor-bags-pg6-6060-64600.jpg",
"isDefault": true
}
],
"categories": ["65b0d13f98539a33577ac4cb", "65b88ef2045a7d009e797eff"],
"tierPrice": [
{
"quantity": 3,
"discount": 20,
"price": 9,
"tierPricingType": "fixed"
},
{
"quantity": 5,
"discount": 40,
"price": 5,
"tierPricingType": "discount"
}
]
}
Example 2: Product with Variants, Options, and Metafields
{
"name": "Developer Test Item",
"sku": "5920236",
"description": {
"dataType": "HTML",
"value": "<p>This is test item</p>"
},
"shortDescription": "<p>This is test item</p>",
"status": "active",
"dimensions": {
"width": 0,
"height": 0,
"depth": 0
},
"weight": 1,
"inventoryType": "variant",
"trackInventory": false,
"quantity": {
"minQuantity": 1,
"quantityIncrement": 1
},
"inventory": [],
"price": 261.54,
"cost": 170,
"sale": 0,
"additionalCost": {
"type": "fixed",
"value": 0
},
"tierPrice": [],
"taxcode": null,
"isTaxExempt": false,
"manufacturer": "Alligator - TPMS",
"mpn": "5920234",
"brand": "65b0d13f98539a33577ac4cd",
"customUrl": "/developer-test-item/",
"seo": {},
"synonymKeywords": [],
"isFeatured": false,
"isFreeShipping": false,
"visibility": false,
"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
},
{
"url": "https://www.youtube.com/watch?v=DD8QUfAiR5E",
"type": "image",
"label": "1. Please watch for more details",
"isDefault": false
},
{
"url": "https://www.youtube.com/watch?v=QhTqc0znzWQ&t=42s",
"type": "image",
"label": "2. Please watch for more details",
"isDefault": false
}
],
"files": [],
"specifications": [
{
"name": "Details",
"value": "<p>This is 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"
},
{
"code": "weight",
"value": ["500g", "600g", "1000g"]
}
],
"relatedProducts": [
{
"code": "relatedProduct",
"label": "Related Product",
"products": ["69660a7730f4d2a940149eed"],
"isShow": true
}
]
}
Response
- Status Code: 200 Created
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 added 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
- Use appropriate values for each field to successfully create a product.