API Overview

The Storehippo API is organized around REST. Our API has predictable, resource-oriented URLs, and uses message key HTTP response to indicate API success or errors. We use built-in HTTP features, like HTTP authentication  which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses.

How to call


// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://example.com/api/1/entity/ms.products");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('access-key', 'access-key-name'));
curl_setopt($ch, CURLOPT_HEADER, 0); // do not bring headers
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// grab URL and pass it to the browser
$output = curl_exec($ch);
$products = json_decode($output);
print_r($products);

$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);


// close cURL resource, and free up system resources
curl_close($ch);
                                        

var request = require('request');
var options = {
    url: "http://example.com/api/1/entity/ms.products",
    headers: {}
}
options.headers['access-key'] = 'access-key-name';

request(options, function (err, response, body) {

    //console.log("Error >>>>> ", err);
    //console.log("Response >>>>> ", response);
    console.log("Body >>>>> ", body);

})
                                    

Ms.shipping_rates

This API provide the different shipping charges to be applied on orders.

It enable the admin to charge shipping cost according to his/her wish.

Fields

_idThis field is unique identifer of records.
name
Type: string

Read Only: No

Required: No
This tells the mane of shipping method . It will be visible everywhere on cart as well as on order.
priceIt is charges of the shipping.
Applicable only in case of manual shipping
methodThis field tells weather the condition is based upon  total weight of order or total amount of order.

It is an object 
      criteria :  order_based/ weight_based
      criteria_options : This also an object having fields: 
                             min :  minimum value
                             max : maximum value
   
enabled
Type: string

Read Only: No

Required: No
It is a check weather the shipping method is enabled or not .

values:
 '1'
 '0'
optionsThis is an array of object . Used to specify prices according to states.

fields of option 
    state : State name
    price : price to be used for mentioned state
countriesIt is an array of string contain the ISO-2 country codes

This tells that this shipping method is applicable on which countries.
Delete Shipping Methods DELETE /entity/ms.shipping_methods/{#_id}

Example

Delete Single Record
/entity/ms.shipping_methods/528961a249adb7740b000001
Example Response Json
{
   "data":"Data deleted successfully"
}

Message

CodeMessage
401Unauthorized
406Something went wrong
Add Shipping Method POST /entity/ms.shipping_methods

Example

Add Shipping Method
/entity/ms.shipping_methods
Example Request Json
{
    "data":{
        "ship_through": "manually",
        "options": [
        ],
        "enabled": "1",
        "method": {
            "criteria": "order_based",
            "criteria_options": {
                "min": "1",
                "max": "500"
            }
        },
        "_metadata": {
            "method": {
                "order_based": {
                    "min": "0",
                    "max": "10000"
                }
            }
        },
        "name": "Delivery Charges",
        "price": 49,
        "countries": [
            "IN"
        ],
        "alias": "method-1"
    }
}
Example Response Json
{
   "data":{
           "_id":"54f3fe54e8e5022a0edeebda"
   }
}

Message

CodeMessage
401Unauthorized
406Something went wrong
Update Shipping Method PUT /entity/ms.shipping_methods/{#_id}

Example

Update Shipping Method
/entity/ms.shipping_methods/555065f48d3b90e43b45ec40
Example Request Json
{
    "data":{
        "_id": "555065f48d3b90e43b45ec40",
        "ship_through": "manually",
        "options": [
        ],
        "enabled": "1",
        "method": {
            "criteria": "order_based",
            "criteria_options": {
                "min": "1",
                "max": "500"
            }
        },
        "_metadata": {
            "method": {
                "order_based": {
                    "min": "0",
                    "max": "10000"
                }
            }
        },
        "name": "Delivery Charges",
        "price": 49,
        "countries": [
            "IN"
        ],
        "alias": "method-1"
    }
}
Example Response Json
{
     "data":"Data Updated Successfully"
}

Message

CodeMessage
401Unauthorized
406Something went wrong
Get Shipping Methods GET /entity/ms.shipping_methods/{#_id}

Example

Get Single Shipping Method
/entity/ms.shipping_methods/555065f48d3b90e43b45ec40
Example Response Json
{
    "data":{
        "_id": "555065f48d3b90e43b45ec40",
        "ship_through": "manually",
        "options": [
        ],
        "enabled": "1",
        "method": {
            "criteria": "order_based",
            "criteria_options": {
                "min": "1",
                "max": "500"
            }
        },
        "_metadata": {
            "method": {
                "order_based": {
                    "min": "0",
                    "max": "10000"
                }
            }
        },
        "name": "Delivery Charges",
        "price": 49,
        "countries": [
            "IN"
        ],
        "alias": "method-1",
        "created_on": "2015-05-11T08:19:00.738Z",
        "_created_by": "5497b4fec6270c5843b2dae6",
        "updated_on": "2015-06-15T08:21:31.347Z",
        "_updated_by": "5487e40c76a8efdb2fcf1f21"
    }
}

Message

CodeMessage
401Not Authorized
406Something went wrong
List Shipping Methods GET /entity/ms.shipping_methods

Example

List Shipping Methods
/entity/ms.shipping_methods
Example Response Json
{
    "data":{
        "total": 1,
        "count": 1,
        "limit": 50,
        "start": 0,
        "records": [
            {
                "_id": "555065f48d3b90e43b45ec40",
                "ship_through": "manually",
                "options": [
                ],
                "enabled": "1",
                "method": {
                    "criteria": "order_based",
                    "criteria_options": {
                        "min": "1",
                        "max": "500"
                    }
                },
                "_metadata": {
                    "method": {
                        "order_based": {
                            "min": "0",
                            "max": "10000"
                        }
                    }
                },
                "name": "Delivery Charges",
                "price": 49,
                "countries": [
                    "IN"
                ],
                "alias": "method-1",
                "created_on": "2015-05-11T08:19:00.738Z",
                "_created_by": "5497b4fec6270c5843b2dae6",
                "updated_on": "2015-06-15T08:21:31.347Z",
                "_updated_by": "5487e40c76a8efdb2fcf1f21"
            }
        ]
    }
}

Message

CodeMessage
401Not Authorized
406Something went wrong
Get Shipping Methods Applicable on given cart GET /entity/ms.shipping_methods/_/getShippingMethods

Example

get applicable shipping methods on cart
/entity/ms.shipping_methods/_/getShippingMethods
Example Request Json
{
    "data":{
        "cart":{
            "_id": "55c860198a63607d2a0da356",
            "additional_charges": [
            ],
            "available_wallets": [
            ],
            "billing_address": {
            },
            "client_details": {
            },
            "currency": {
                "name": "INR",
                "conversion_rate": "1"
            },
            "currency_code": "INR",
            "currency_rate": "1",
            "coupon_code": null,
            "discounts": [
            ],
            "discounts_total": 0,
            "discounts_percentage": 0,
            "discount_total": 0,
            "ecoupon": {
            },
            "wallets": [
            ],
            "email_id": null,
            "gift_cards": [
            ],
            "gift_card_total": 0,
            "item_count": 0,
            "items": [
            ],
            "language": "EN",
            "metafields": {
            },
            "options": {
            },
            "sub_total": 0,
            "total": 0,
            "payment_method": {
            },
            "shipping_address": {
            },
            "shipping_method": {
            },
            "shipping_method_name": null,
            "status": "initial",
            "shipping_total": 0,
            "taxes": [
            ],
            "taxes_total": 0,
            "total_weight": 0,
            "user_id": null,
            "version": "ms.0.3.0",
            "prices_are": "inclusive",
            "valid_email_id": false,
            "valid_shipping_address": false,
            "valid_billing_address": false,
            "valid_shipping_method": false,
            "valid_payment_method": false,
            "created_on": "2015-08-10T08:26:01.131Z"
        }
    }
}
Example Response Json
{
    "data":{
        "count": 1,
        "start": 0,
        "records": [
            {
                "_id": "555065f48d3b90e43b45ec40",
                "name": "Delivery Charges",
                "price": 49

            }
        ]
    }

}