Skip to main content

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

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess 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:

FieldTypeDescription
namestringThe name of the product. Required.
skustringThe Stock Keeping Unit identifier. Required.
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.
statusstringProduct status; valid values are active or inactive.
visibilitybooleanVisibility status of the product.
manufacturerstringName of the manufacturer.
mpnstringManufacturer Part Number.
quantityobjectQuantity details
mediaGalleryarrayArray of media (images, videos) associated with the product.
filesarrayArray of file attachments related to the product.
trackInventorybooleanIndicates if inventory tracking is enabled for the product.
isFeaturedbooleanSet this as true if the product is a featured product.
inventoryobjectInventory details.
pricenumberPrice of the product. Required.
costnumberThe cost to acquire the product.
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.
customFieldsarrayCustom fields for additional product information.
- fieldstringThe field name.
- valuestringThe value for the field.
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.
searchKeyWordsarrayKeywords for improving product searchability.
seoobjectSEO (Search Engine Optimization) attributes for the product.
categoriesarrayIDs of categories the product belongs to.
sortOrdernumberSorting order priority.
relatedProductsobjectInformation 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.
nameStringName of the media file.
urlStringURL where the media file is located.

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.

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.

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.
labelStringLabel describing the relation.
productsarrayArray of product IDs that are related.

Grouped Products

FieldTypeDescription
productIdStringIdentifier of the grouped product.
quantityNumberQuantity of the product within the group.
dynamicQuantityBooleanWhether 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

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 added Successfully".

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 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.