Products

(ms.products)

A product is an item put up for sale in a store. Products can be physical, digital (such as a movie, music or ebook file) and services (such as equipment rental, work for hire, customization of another product or an extended warranty).



Fields

Value Description
name   
Type: string
Required
Name of product.
Floral shirt
alias   
Type: string
Aliases are the unique product URL on storefront.
floral-shirt
description   
Type: string
A brief description of the product.
Regular fit, cotton floral shirt
images   
Type: array
Images for the product.
{
  "images": [
    {
    "tags": "floral",
    "image":"ms.products/558efa4358ae3b30020bcbf7/images/558efa4358ae3b30020bcbf8/558ef88fc17ed8460cfcb588/558ef88fc17ed8460cfcb588.jpg", 
    "caption": "Floral shirt",
    }
  ]
}
image
Type: image
Required
Single image related to the product.
caption
Type: string
This field holds text which acts as title of image on storefront.
tags
Type: string
Image tags are used to relate product images to their respective variants values.
media   
Type: array
Any media associated with the product.
{
"media": [
    {
      "url": "https://www.youtube.com/watch?v=u2XCdkL4bWI",
      "caption": "Demo of using product",
      "tag": "product media"
    }
  ]
}  
url
Type: string
Required
Embedded URL of the video of the product.
caption
Type: string
Alternative text which will be visible on the storefront.
tags
Type: string
Media tags are used to relate product videos to their respective variants.
price   
Type: number
Required
The selling price of the product at which the product is sold.
2000
compare_price   
Type: number
Compare price is the listing price of the product.
1542
mrp_discount   
Type: number
collections   
Type: array
Collections are used to group products across different categories together.
{
  "collections":["collection_1", "collection_2", "collection_3"]
}
uniquesku   
Type: string
brand   
Type: string
Brand is the identity of the product’s manufacturer.
Lee Cooper
sku   
Type: string
SKU (Stock-Keeping Unit) is the unique identifier or code that is used to identify the product or any of its variants.
shirt-floral
barcode   
Type: string
Barcode of the product.
isbn   
Type: string
ISBN code of the product.
hsn   
Type: string
HSN code of the product.
sac   
Type: string
SAC code of the product.
upc   
Type: string
UPC code of the product.
uom   
Type: string
categories   
Type: array
Categories help you to categorize the products based on different qualities of the product.
{
"categories":["category_1","category_2", "category_3"]
}
avg_rating   
Type: string
Ratings of the product given by users.
num_reviews   
Type: number
This field holds count of product reviews given by users.
weight   
Type: number
The weight of the product including the packaging weight.
150
dimension   
Type: object
Dimensions of the product.
length
Type: number
Length of the product.
width
Type: number
Width of the product.
height
Type: number
inventory_management   
Type: string
Allows to manage the inventory of the product.
1
inventory_allow_out_of_stock   
Type: string
By enabling it, order can be placed for the particular product even if it is Out of Stock.
1
inventory_quantity   
Type: number
Required
The total number of product available in the stock for sale.
23
option_set   
Type: string
Option set provides style choices to display different product variants in a more user-friendly manner.
options   
Type: array
The different properties of a product that are used to define product variants.
{
  "options": [
    {
      "name": "Fit Size",
      "values": [
        "S-39",
        "M-40",
        "L-42",
        "XL-44"
      ]
    },
    {
      "name":"Color",
      "values":[
        "red",
        "black",
        "blue"
      ]
    }
  ]
}
name
Type: string
Required
Name of the option.
size
values
Type: array
An array of object that contains possible values of options.
{
"values":["XL","L","XXL"]
}
variants   
Type: custom
variants help to offer choices to customers such as size, color, material etc.
<pre class="language-json"><code>"variants": [
    {
      "price": "449",
      "compare_price": "449",
      "sku": "ONN_CASUALZ_NC431_SMGN_S_1PC_TEst41",
      "inventory_management": "automatic",
      "inventory_quantity": 0,
      "options": [
        {
          "name": "Fit Size",
          "value": "S-39"
        }
      ],
      "variant_id": "S-39",
      "id": 75771,
      "dimension": {}
    },
    {
      "price": "449",
      "compare_price": "449",
      "sku": "ONN_CASUALZ_NC431_SMGN_S_1PC_TEst42",
      "inventory_management": "automatic",
      "inventory_quantity": 0,
      "options": [
        {
          "name": "Fit Size",
          "value": "M-40"
        }
      ],
      "variant_id": "M-40",
      "id": 52863,
      "dimension": {}
    },
    {
      "price": "449",
      "compare_price": "449",
      "sku": "ONN_CASUALZ_NC431_SMGN_S_1PC_TEst43",
      "inventory_management": "automatic",
      "inventory_quantity": 0,
      "options": [
        {
          "name": "Fit Size",
          "value": "L-42"
        }
      ],
      "variant_id": "L-42",
      "id": 62438,
      "dimension": {}
    },
    {
      "price": "449",
      "compare_price": "449",
      "sku": "ONN_CASUALZ_NC431_SMGN_S_1PC_TEst44",
      "inventory_management": "automatic",
      "inventory_quantity": 0,
      "options": [
        {
          "name": "Fit Size",
          "value": "XL-44"
        }
      ],
      "variant_id": "XL-44",
      "id": 88296,
      "dimension": {}
    }
  ]</code></pre>
attributes   
Type: array
Attributes specify different properties of the product as key-value pairs.
{
  "attributes": 
  [
    {
    "name":"size",
    "value":"XL"
    },
   {
     "name":"color",
     "value":"red"
   }
  ]
}

name
Type: string
Required
Name of the attribute.
value
Type: string
Required
Value of the attribute.
group
Type: string
Group of the attribute.
features   
Type: array
Features are used to specify the few unique selling features of the product.
{
  "feature":["feature1","feature2"]
}
channel_categories   
Type: string
SEO   
Type: object
SEO contains data that affects the online visibility of a product on search engine.
{
  "SEO": {
    "title": "Get cotton fabric shirt for just Rs 899",
    "description": "Beautiful floral shirt at ₹ 899/- Same day delivery. No shipping cost.",
     "keywords": "Floral shirt, cotton shirt"
  }
}
title
Type: string
The title of the product to specify a custom title for the product page for SEO.
Get cotton fabric shirt for just Rs 899
description
Type: string
Specify a custom meta description for the product page for SEO.
Beautiful floral shirt at ₹ 899/- Same day delivery. No shipping cost.
keywords
Type: string
Keywords are used to specify a custom meta keywords for the product page for SEO.
Floral shirt, cotton shirt
canonical_url
Type: string
The canonical URL is used to declare a single page as its source or for duplicate pages to reference their source/originating page.
sitemap_priority
Type: string
Sitemap priority defines the priority of the particular page in your store.
0.3
tax   
Type: custom
This field stores the id of tax created in ms.taxes.
58a3da25f94fb055489cfbc1
publish   
Type: string
Enabling the flag makes the product visible on storefront.
1
sort_order   
Type: number
Sort order is used to set the specific order of the product.
allow_custom_pricing   
Type: string
min_limit_to_buy_this_product   
Type: number
This field holds the minimum limit to buy product.
1
max_limit_to_buy_this_product   
Type: number
This field holds the maximum limit to buy product.
5
files   
Type: array
The downloadable files related to the product displayed on the product page.
file
Type: file
A downloadable file related to the product.
description
Type: string
A short description of the file.
maximum_downloads
Type: integer
shipping_cost   
Type: string
Shipping cost for the product is specified here.
100
tag   
Type: string
Tag is used to relate product variants to images.
is_catalog   
Type: string
To enable product catalog.
catalog_only   
Type: string
channels   
Type: custom
google_product_category   
Type: string

Commands (Endpoints)

POST /api/1/entity/ms.products   
Add a new product

Examples

Add a basic product

Request
{
  "name": "Sample Product",
  "price": 20
}
Response
{
  "status": 200,
  "data": {
    "_id": "5c3f3c724b99c515ee8f53d8"
  }
}
DEL /api/1/entity/ms.products/{resource_id}   
Deletes a product

Examples

Delete single product

Request
Response
{
    "data":"Deleted Successfully"
}
PUT /api/1/entity/ms.products/{resource_id}   
Updates an existing product

Examples

Update single product

Request
{
  "name": "Updated Product"
}
Response
{
  "status": 200
}
GET /api/1/entity/ms.products/{resource_id}   
Retrieves a single product

Examples

Request
Response
{
    "_id": "558efa4358ae3b30020bcbf7",
    "_metadata": {
        "i18n": {
            "EN": {
            }
        }
    },
    "metafields":{
      "one":"two"
    },
    "images": [
        {
            "tags": "florist in bangalore, flower delivery in bangalore, send flowers to bangalore, roses to bangalore, bouquets to bangalore",
            "image": "ms.products/558efa4358ae3b30020bcbf7/images/558efa4358ae3b30020bcbf8/558ef88fc17ed8460cfcb588/558ef88fc17ed8460cfcb588.jpg",
            "caption": "200 Roses Bouquet",
            "_metadata": {
                "image": {
                    "_id": "558ef88fc17ed8460cfcb588",
                    "name": "BB_DOTD_200ROS.jpg",
                    "size": 86809,
                    "type": "image/jpeg"
                }
            },
            "_id": "558efa4358ae3b30020bcbf8"
        }
    ],
    "categories": [
        "deal-of-the-day"
    ],
    "publish": "1",
    "dimension": {
    },
    "inventory_management": "none",
    "inventory_low_stock_quantity": "5",
    "options": [
    ],
    "SEO": {
        "title": "Send a Bouquet of 200 Roses in Bangalore, Order Flowers Online in Bangalore",
        "description": "Send a bunch of 200 roses in Bangalore at ₹ 2499/- Same day delivery in Bangalore. Bangalore Blooms is  one of the oldest florist in Bangalore to 'Send Flowers in Bangalore' and to 'Order Cakes in Bangalore'",
        "keywords": "Exotic flowers, florists in bangalore, flower delivery bangalore, send flowers to bangalore, local florist in bangalore, florist bangalore"
    },
    "attributes": [
    ],
    "features": [
    ],
    "description": "EXCLUSIVE DEAL OF THE DAY..!!!<br />\n<br />\nSend this exotic <u><strong>Bouquet of 200 Red Roses</strong></u> in Bangalore <span style=\"line-height: 20.7999992370605px;\">at an Unbelievable Price of<br />\nRs. 2499/- Only.</span>&nbsp;<strong>Free Delivery within City Limits of Bangalore</strong>.&nbsp;<br />\n<br />\n&nbsp;",
    "name": "200 Red Roses Bouquet",
    "alias": "200-red-roses-bouquet",
    "price": 2499,
    "compare_price": 4999,
    "sku": "BB_DOTD_200ROS",
    "weight": "1000",
    "available": 1,
    "sort_order": 235,
    "created_on": "2015-06-27T19:32:23.986Z",
    "_created_by": "5532747b389e154972ee6bb9",
    "updated_on": "2015-07-02T04:37:21.357Z",
    "_updated_by": "54858e54e681db2741900f5d",
    "option_set": "554a0a9a1bfdb5ce3f11fe38"
}
GET /api/1/entity/ms.products   
Retrieves a list of products

Examples

List based on sku

Request
q={"uniquesku":"testsku"}
Response
{
  "messages": [
    {
      "name": "ms.entity.products.list",
      "level": "success",
      "key": "ms.entity.products.list",
      "message": ""
    }
  ],
  "data": [
    {
      "_id": "59798ff7d97535bb034ca5dc",
      "publish": "1",
      "alias": "puma-shoes",
      "name": "Puma Shoes",
      "categories": [
        "men",
        "shoes"
      ],
      "price": 5.20,
      "compare_price": 9.28,
      "sku": "testsku",
      "seller": "59730ee332640c7e2be337fb",
      "approve": "approved",
      "inventory_quantity": 0
    }
  ],
  "paging": {
    "limit": 50,
    "start": 0,
    "count": 1
  }
}
GET /api/1/entity/ms.products/_/updateProductBySku   
This API is used to update a product or its variant by using its SKU.
sku
price
compare_price
weight
inventory_quantity

Examples

updateProductBySku

Request
{
  "data":{
    "inventory_quantity": 5
  }
}
Response
{
    "data":"Updated Successfully"
}