Create Multiple Products
The POST endpoint allows you to create multiple products in a single request. This method is useful for batch creation of products with detailed specifications and associations.
Endpoint
- URL:
/products/multiple - 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
The request body should be a JSON array, with each element representing a product object. Below are the fields for each product:
| 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. |
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. |
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. |
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 | object | Inventory details. |
price | number | Price of the product. Required. |
cost | number | The cost to acquire the product. |
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. |
customFields | array | Custom fields for additional product information. |
- field | string | The field name. |
- value | string | The value for the field. |
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. |
searchKeyWords | array | Keywords for improving product searchability. |
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. |
name | String | Name of the media file. |
url | String | URL where the media file is located. |
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. |
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. |
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. |
label | String | Label describing the relation. |
products | array | Array of product IDs that are related. |
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
Sample Request Body
[
{
"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",
"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"]
},
{
"name": "Black Shirt",
"sku": "Shirt-Black",
"shortDescription": "Black Color shirt"
}
]
Response
- Status Code: 200 Created
Sample Response Body
A successful response confirms product creation and lists each product's ID:
{
"success": true,
"message": "Products created successfully"
}
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". |
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 each product object in the array is well-formed with valid identifier fields and values.
- Confirm that the access token is active and has the necessary permissions to create products.