Products
(ms.products)

A product is an individual item for sale in a storehippo store. Products are often physical, but don't have to be; a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). Simply put: if it's something for sale in a store, it's a Product.

Fields

_id
Read Only: No

Required: No
The unique identifier for the orders. This one is used for API purposes. 

{ "_id" : "54b8bbf73e2dfb0a0b640c5e" }

Read Only
alias
Type: string

Read Only: No

Required: No
It is unique alphanumeric identifier of product.

Read Only
brand
Type: string

Read Only: No

Required: No
This field carry the alias of selected brand from ms.brands entity.

This field relate product with selected brand.
 
collections
Type: array

Read Only: No

Required: No
This is an array of strings that carries the alias of ms.collections record 
This field relate product with selected collections.
 
categories
Type: array

Read Only: No

Required: No
This is an array of strings that carries the aliases of ms.category record .

This field relate product with selected categries.

 
compare_price
Type: number

Read Only: No

Required: No
It is listing price i.e all the discounts will be related to the field.
 
description
Type: string

Read Only: No

Required: No
The description of the product, complete with HTML formatting.
images
Type: array

Read Only: No

Required: No
It is an Array of object with contain following fields.
  1.   image : selected image will be kept here
  2.   caption : It is few lines that will be used as description of image.
  3.   tag : This field helps in binding images with variants 
inventory_allow_out_of_stock
Type: string

Read Only: No

Required: No
This fields tells the weather to accept the order even if product is out of stock. (Only if inventory_management is enabled)

Admin can specify the inventory_allow_out_of_stock of each variant seprately as well.
inventory_management
Type: string

Read Only: No

Required: No
This allows the admin to enable / disable the inventory managemet of product.

Admin can individually manage the inventory of variants ( if present ).
 
inventory_quantity
Type: number

Read Only: No

Required: Yes
This fields tells the number of unit left for the product and will be used when inventory management is enabled.

Admin can specify the 
inventory_quantity of each variant seprately as well.
price
Type: number

Read Only: No

Required: Yes
This field tell cost of product . 

It should be numeric.
publish
Type: string

Read Only: No

Required: No
This field helps in temporary disable or hide the product . 
 
seo
Type: object

Read Only: No

Required: No
This field contain the data related to seo sepecifically for product

 
tax
Type: custom

Read Only: No

Required: No
This field help in selecting the tax to be applied on the product.
This field carries the _id of the selected ms.taxes
variants
Type: custom

Read Only: No

Required: No
This field is array of collection , helps in creating variants of the product.

Ex : if you have a product Shirt  in various sizes and colors.

So you can define variant with specific size an color

Variants contain following fields.
    _id : unqiue identifier for variant
    options : It is array of object with following fields
                name:  Name of option Ex : color
                value : Value for color   Ex : Red

    sku : Same as in product
    barcode : Same as in product
    inventory_management: Same as in product
    weight: Same as in product
    inventory_quantity: Same as in product
    inventory_allow_out_of_stock: Same as in product
    dimensions: Same as in product
Delete Product DELETE /api/1/entity/ms.products/{#_id}

Example

Delete single product
DELETE /entity/ms.products/55c1a742471e6ec36c2d0aae

Example Response Json

{
    "data":"Deleted Successfully"
}

Message

Code Message
401 Not Authorized
406 Something went wrong
Get Single Product GET /api/1/entity/ms.products/{#_id}

Example


GET /entity/ms.products/55c1a18184067eb46c91d48e

Example Response Json

{
    "_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"
}

Message

Code Message
401 Not Authorized
406 Something went wrong

Query Parameters

Code Message
_Id Unique Identifier of the order to be updated
Update Product PUT /api/1/entity/ms.products/{#_id}

Example

Update single product
PUT /entity/ms.products/55c1a536471e6ec36c2d09bb

Example Request Json

{
  "data":{
    "inventory_quantity": 5,
    "name": "200 Red Roses Bouquet",
    "testfile":{
      "data":"https://example.com/a.png",
      "uploadType":"url",
      "name":"a.png"
    },
    "price": 2499
  }
}

Example Response Json

{
    "data":"Updated Successfully"
}

Message

Code Message
401 Not Authorized
406 Something went wrong
Add Product POST /api/1/entity/ms.products

Example

Add single product
POST /api/1/entity/ms.products

Example Request Json

{
    "data":{
        "images": [
            {
                "caption": "12 ROES BOUQET",
                "image": "ms.products/558ef477832ed02702ceaba1/images/558ef477832ed02702ceaba2/558ef421c17ed8460cfcb580/558ef421c17ed8460cfcb580.jpg",
                "tags": "flowers to bangalore, send flowers to bangalore, florist bangalore, bangalore florist",
                "_metadata": {
                    "image": {
                        "_id": "558ef421c17ed8460cfcb580",
                        "name": "BB_DOTD_12ROS.jpg",
                        "size": 56783,
                        "type": "image/jpeg"
                    }
                },
                "_id": "558ef477832ed02702ceaba2"
            }
        ],
        "publish": "1",
        "dimension": {
        },
        "inventory_management": "none",
        "inventory_low_stock_quantity": "5",
        "options": [
        ],
        "SEO": {
            "title": "Send Flowers to Bangalore, Online Flower Delivery in Bangalore",
            "keywords": "Send Flowers to Bangalore, Online Flower Delivery in Bangalore",
            "description": "Send a bunch of 12 roses in Bangalore at ₹ 299/- 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'"
        },
        "attributes": [
        ],
        "features": [
        ],
        "categories": [
            "deal-of-the-day"
        ],
        "description": "<strong>DEAL OF THE DAY...!!&nbsp;</strong><br />\n<br />\nSend a Bouquet of 12 Red Roses in Bangalore at ₹ 299/- <u><strong>Same day delivery in Bangalore</strong></u>.<br />\n<br />\nBangalore Blooms is one of the oldest<em> <u>florist in Bangalore</u></em> to &#39;<strong>Send Flowers in Bangalore</strong>&#39;&nbsp;and to &#39;<strong>Order Cakes in Bangalore</strong>&#39;",
        "name": "12 Red Roses Bouquet",
        "alias": "12-red-roses-bouquet",
        "price": 299,
        "compare_price": 499,
        "sku": "BB_DOTD_12ROS",
        "weight": "100",
        "available": 1,
        "sort_order": 23
    }
}

Example Response Json

{
  "data":{
      "id":"55c1a536471e6ec36c2d09bb"
  }
}

Message

Code Message
401 Unauthorized
406 Something went wrong
List Products GET /api/1/entity/ms.products

Example

List based on query
GET /api/1/entity/ms.products?q={"categories":"men"}

Example Request

Get the products which belongs to the category men

Example Request Json

q={"categories":"men"}

Example Response Json

{
  "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": "2127196-blue-s",
      "seller": "59730ee332640c7e2be337fb",
      "approve": "approved",
      "inventory_quantity": 0
    },
    {
      "_id": "5974f485751d548e2b51e246",
      "name": "Blue Jacket",
      "alias": "blue-jacket",
      "categories": [
        "men",
        "jackets"
      ],
      "price": 14.28,
      "compare_price": 17.28,
      "sku": "2127196-blue-s",
      "inventory_management": "automatic",
      "inventory_quantity": 998,
      "seller": "5656d8269019d01c77caac2a"
    }
  ],
  "paging": {
    "limit": 50,
    "start": 0,
    "count": 50,
    "total": 50
  }
}

Message

Code Message
401 Not Authorized
406 Something went wrong

Query Parameters

Code Message
facets Set facets to true. E.g facets:true
facetgroup Send name of facetgroup in query to get the facets in response. E.g facetgroup: default_category_facet
sort Send sortfield in query to sort the products based on that field. E.g : sort: price
q It will take the parameters that the products have to satisfy to be included in the response
Resolve Product GET /api/1/entity/ms.products/_/resolveProduct?q={"_id":{#_id}}

This command fetch product from database  and perform following operations: 

  1.  Apply the given variant on product
  2.  custom price of product .(If enabled for product)
Custom pricing for product can be enabled by installing app (Custom pricing ) .After installing this app price for product can be accepted from frontend.
 

Message

Code Message
200 Success
406 invalid_product

Query Parameters

Code Message
q._id product unqiue id (Required)
q.variant_id variant_id for variant to be applied (Optional)
q.vendor unique id for vendor (Optional)
q.selected_options selected options (Optional)
q.price cost of product (Optional)
Update Product By SKU PUT /api/1/entity/ms.products/_/updateProductBySku?q={"sku":#sku}

This API is used to update a product or its variant by using its SKU.

Example

updateProductBySku
PUT /api/1/entity/ms.products/_/updateProductBySku?q={"sku":"testsku"}

Example Request Json

{
  "data":{
    "inventory_quantity": 5
  }
}

Example Response Json

{
    "data":"Updated Successfully"
}

Message

Code Message
200 Success
406 Sku not found
404 Product/Variant not found with sku
406 Multiple products cannot be there having same SKU

Query Parameters

Code Message
q.sku  A stock keeping unit (SKU) is a unique identification code for a product.
List Products By Sku GET /api/1/entity/ms.products

Example

List based on sku
GET /api/1/entity/ms.products?q={"uniquesku":"testsku"}

Example Request

Get the products which belongs to the category men

Example Request Json

q={"uniquesku":"testsku"}

Example Response Json

{
  "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
  }
}

Message

Code Message
401 Not Authorized
406 Something went wrong

Query Parameters

Code Message
facets Set facets to true. E.g facets:true
facetgroup Send name of facetgroup in query to get the facets in response. E.g facetgroup: default_category_facet
sort Send sortfield in query to sort the products based on that field. E.g : sort: price
q It will take the parameters that the products have to satisfy to be included in the response