Ms.store_variants

Fields

name
Type: string

Read Only: No

Required: No
Name of store variant (Used for internal purpose).
It is globally unique.

 
conditions
Type: array

Read Only: No

Required: No
It is an array of object having following fields.
    field : name of conditions, possible values are mentioned below.
               user_countries/ location_countries / user_groups / devices
   operator :
This tells the condition to be applied,  possible values are mentioned below.
                one_of_them / none_of_them
   values :
This is an array carrying values for the field
action
Type: object

Read Only: No

Required: No
This field is an object the contain the action to be applied when all conditions meets. This object hasa following actions:

   theme : this field will contain valid theme id , which will be applied when all conditions are satisfied.
  currency : this will carry valid ISO-3 currency code 
  language : This will carry valid ISO-2 labhuage code
Delete Store Variant DELETE /entity/ms.store_variants/{#_id}

Example

Delete single store variant
DELETE /entity/ms.store_variants/55cd711fbf5186563161af7b

Example Response Json

record deleted successfully

Message

Code Message
401 Unauthorized
406 Something went wrong
Add Store Variant POST /entity/ms.store_variants

Example

Add store variant for condition on location_countries
POST /entity/ms.store_variants

Example Request Json

{"data":{"name":"Sample","conditions":[{"operator":"one_of_these","field":"location_countries","values":["IN","DJ","GB"]}],"action":{"theme":"557199823bbf756c12447c86","language":"EN","currency":"INR"}}}

Example Response Json

{"_id":"55cd711fbf5186563161af7b"}

Message

Code Message
401 Unauthorized
406 Something went wrong
Get Store Variant GET /entity/ms.store_variants/{#_id}

Example

Get single record of store variant
GET /entity/ms.store_variants/55cd711fbf5186563161af7b

Example Response Json

{
   "data":{"_id":"55cd711fbf5186563161af7b","name":"Sample","conditions":[{"operator":"one_of_these","field":"location_countries","values":["IN","DJ","GB"],"_id":"55cd711fbf5186563161af7c"}],"action":{"theme":"557199823bbf756c12447c86","language":"EN","currency":"INR"},"created_on":"2015-08-14T04:39:59.243Z","_created_by":"530d7f8bc6b8283a11000002"}
}

Message

Code Message
401 Not Authorized
406 Something went wrong
Update Store variants PUT /entity/ms.store_variants/{#_id}

Example

Update store variants by adding one more condition
PUT /entity/ms.store_variants/55cd711fbf5186563161af7b

Example Request Json

{"data":{"_id":"55cd711fbf5186563161af7b","name":"Sample","conditions":[{"operator":"one_of_these","field":"location_countries","values":["IN","DJ","GB"],"_id":"55cd711fbf5186563161af7c"},{"operator":"one_of_these","field":"devices","values":["mobile"]}],"action":{"theme":"557199823bbf756c12447c86","language":"EN","currency":"INR"},"created_on":"2015-08-14T04:39:59.243Z","_created_by":"530d7f8bc6b8283a11000002"}}

Example Response Json

updated successfully

Message

Code Message
401 Unauthorized
406 Something went wrong
List Store Variants GET /entity/ms.store_variants

Example

List store variants
GET /entity/ms.store_variants

Example Response Json

{
  "data":{"total":1,"count":1,"limit":30,"start":0,"records":[{"_id":"55cd711fbf5186563161af7b","name":"Sample","conditions":[{"operator":"one_of_these","field":"location_countries","values":["IN","DJ","GB"],"_id":"55cd711fbf5186563161af7c"},{"operator":"one_of_these","field":"devices","values":["mobile"],"_id":"55cd720ebf5186563161af7e"}],"action":{"theme":"557199823bbf756c12447c86","language":"EN","currency":"INR"},"created_on":"2015-08-14T04:39:59.243Z","_created_by":"530d7f8bc6b8283a11000002","updated_on":"2015-08-14T04:43:58.664Z","_updated_by":"530d7f8bc6b8283a11000002"}]}
}

Message

Code Message
401 Not Authorized
406 Something went wrong