Documentation / API / Operations on Products

GET, COUNT, CREATE, UPDATE and DELETE operations available on products.

Products Operations

GET

URL

POST https://your-secured-store-url:443/api/v1/products/get

Filters

Filter Type
id Array of GUID
name Array of String (max 255 chars)
slug Array of String (max 255 chars)
vendor Array of String (max 255 chars)
price_min Decimal (max 8 digits and 2 decimals)
price_max Decimal (max 8 digits and 2 decimals)
taxable Boolean
discountprice_min Decimal (max 8 digits and 2 decimals)
discountprice_max Decimal (max 8 digits and 2 decimals)
discounted Boolean
minbuy_min Integer (max 11 digits)
minbuy_max Integer (max 11 digits)
maxbuy_min Integer (max 11 digits)
maxbuy_max Integer (max 11 digits)
sku Array of String (max 255 chars)
barcode Array of String (max 255 chars)
type Array of String (Predefined values)
quantity_min Integer (max 11 digits)
quantity_max Integer (max 11 digits)
allowbuynostock Boolean
weight_min Decimal (max 2 digits and 2 decimals)
weight_max Decimal (max 2 digits and 2 decimals)
visible Boolean
size_min Integer (max 11 digits)
size_max Integer (max 11 digits)
nbsold_min Integer (max 11 digits)
nbsold_max Integer (max 11 digits)
createdon_min DateTime
createdon_max DateTime

Request

Retrieve all the items (max 1000)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Retrieve specific items by ID

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'id' : ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234']
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
		    'id' : ['04500207-c685-41e7-b1c5-ed2123842ffd'],
		    'name' : ['Example'],
		    'slug' : ['example'],
		    'vendor' : ['Mr Example'],
		    'price_min' : '20.50',
		    'price_max' : '999.99',
		    'taxable' : 'true',
		    'discountprice_min' : '0',
		    'discountprice_max' : '200.20',
		    'discounted' : 'true',
		    'minbuy_min' : '0',
		    'minbuy_max' : '2',
		    'maxbuy_min' : '1',
		    'maxbuy_max' : '9999',
		    'sku' : ['HKKJKJ765GH'],
		    'barcode' : ['123456'],
		    'type' : ['PHYSICAL'],
		    'quantity_min' : '1',
		    'quantity_max' : '99999',
		    'allowbuynostock' : 'true',
		    'weight_min' : '0.15',
		    'weight_max' : '100.99',
		    'visible' : 'true',
		    'size_min' : '0',
		    'size_max' : '50',
		    'nbsold_min' : '0',
		    'nbsold_max' : '9999',
		    'createdon_min' : '2015-01-01',
		    'createdon_max' : '2042-01-01'
        },
        'pagination' : {
            'pageNumber' : '1',
            'pageSize' : '1000'
        }
    }

Response

If no error occured, you will receive a response like this one (object type: Product). Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "04500207-c685-41e7-b1c5-ed2123842ffd",
      "name": "Example",
      "slug": "example",
      "description": "example of description",
      "vendor": "Mr Example",
      "taxable": "true",
      "price": "49.98",
      "discountprice": "10.50",
      "discounted": "true",
      "minbuy": "1",
      "maxbuy": "100",
      "sku": "HKKJKJ765GH",
      "barcode": "123456",
      "type": "PHYSICAL",
      "quantity": "1000",
      "allowbuynostock": "true",
      "weight": "5.42",
      "visible": "true",
      "seopagetitle": "SEO page title",
      "seopagedescription": "SEO META description",
      "seometakeywords": "SEO META keywords",
      "size": "5",
      "nbsold": "40",
      "categories": [
         {
            "id": "381b456b-cce3-4920-ae97-c36f833962d3",
            "name": "Category A"
         },
         {
            "id": "622e6b55-ffa6-4149-9993-a44cf7f9cc9f",
            "name": "Category B"
         }
      ],
      "collections": [
         {
            "id": "7a2405a9-790d-4993-987b-ca6f21060da3",
            "name": "Collection A"
         },
         {
            "id": "83d86894-1b75-4308-997b-199bf353320b",
            "name": "Collection B"
         }
      ],
      "images": [
         {
            "id": "4e7c1130-f24b-4e97-a428-e605fc61dfe3",
            "url": "http://mystore1.commerscale.com/product-image/mystore1.commerscale.com.jpg",
            "rank": "1"
         }
      ],
      "reviews": [
         {
            "id": "b895040a-42d2-4495-8ae6-286deeb7411f",
            "customerid": "3bd55c5a-eac2-4dae-8016-61bd72161422",
            "rating": "10",
            "comment": "My comment",
            "createdon": "2016-01-07 14:02:36"
         }
      ],
      "tags": [
         {
            "tag": "tag example 1"
         },
         {
            "tag": "tag example 2"
         },
         {
            "tag": "tag example 3"
         }
      ],
      "variants": [
         {
            "id": "93f35ec8-331a-46ae-8599-85ee7dc7244a",
            "color": "green",
            "size": "medium",
            "material": "fiber",
            "duration": "",
            "sku": "HKKJKJ765GI",
            "barcode": "22323434",
            "quantity": "0",
            "displayname": "green / medium / fiber (HKKJKJ765GI)"
         }
      ],
      "author": "Mr Example",
      "createdon": "2015-10-25 10:29:08"
   }
]

COUNT

URL

POST https://your-secured-store-url:443/api/v1/products/count

Filters

Filter Type
id Array of GUID
name Array of String (max 255 chars)
slug Array of String (max 255 chars)
vendor Array of String (max 255 chars)
price_min Decimal (max 8 digits and 2 decimals)
price_max Decimal (max 8 digits and 2 decimals)
taxable Boolean
discountprice_min Decimal (max 8 digits and 2 decimals)
discountprice_max Decimal (max 8 digits and 2 decimals)
discounted Boolean
minbuy_min Integer (max 11 digits)
minbuy_max Integer (max 11 digits)
maxbuy_min Integer (max 11 digits)
maxbuy_max Integer (max 11 digits)
sku Array of String (max 255 chars)
barcode Array of String (max 255 chars)
type Array of String (Predefined values)
quantity_min Integer (max 11 digits)
quantity_max Integer (max 11 digits)
allowbuynostock Boolean
weight_min Decimal (max 2 digits and 2 decimals)
weight_max Decimal (max 2 digits and 2 decimals)
visible Boolean
size_min Integer (max 11 digits)
size_max Integer (max 11 digits)
nbsold_min Integer (max 11 digits)
nbsold_max Integer (max 11 digits)
createdon_min DateTime
createdon_max DateTime

Request

Count the items

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Count specific items by visibility

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'visible' : 'true'
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
		    'id' : ['04500207-c685-41e7-b1c5-ed2123842ffd'],
		    'name' : ['Example'],
		    'slug' : ['example'],
		    'vendor' : ['Mr Example'],
		    'price_min' : '20.50',
		    'price_max' : '999.99',
		    'taxable' : 'true',
		    'discountprice_min' : '0',
		    'discountprice_max' : '200.20',
		    'discounted' : 'true',
		    'minbuy_min' : '0',
		    'minbuy_max' : '2',
		    'maxbuy_min' : '1',
		    'maxbuy_max' : '9999',
		    'sku' : ['HKKJKJ765GH'],
		    'barcode' : ['123456'],
		    'type' : ['PHYSICAL'],
		    'quantity_min' : '1',
		    'quantity_max' : '99999',
		    'allowbuynostock' : 'true',
		    'weight_min' : '0.15',
		    'weight_max' : '100.99',
		    'visible' : 'true',
		    'size_min' : '0',
		    'size_max' : '50',
		    'nbsold_min' : '0',
		    'nbsold_max' : '9999',
		    'createdon_min' : '2015-01-01',
		    'createdon_max' : '2042-01-01'
        }
    }

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

{
   "count": "45"
}

CREATE

URL

POST https://your-secured-store-url:443/api/v1/products/create

Data properties

Mandatory
Property Type
name String (max 255 chars)
slug String (max 255 chars)
vendor String (max 255 chars)
price Decimal (max 8 digits and 2 decimals)
taxable Boolean
discountprice Decimal (max 8 digits and 2 decimals)
discounted Boolean
minbuy Integer (max 11 digits)
maxbuy Integer (max 11 digits)
sku String (max 255 chars)
barcode String (max 255 chars)
type String (Predefined values)
quantity Integer (max 11 digits)
allowbuynostock Boolean
weight Decimal (max 2 digits and 2 decimals)
visible Boolean
size Integer (max 11 digits)
seopagetitle String (max 255 chars)
seopagedescription String (max 255 chars)
seometakeywords String (max 255 chars)
categoryid Array of GUID (need to be a valid category id)
collectionid Array of GUID (need to be a valid collection id)
tags Array of String (max 255 chars)

Request

Most complete request

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
    'data' : [		{
			'name' : 'Product 2',
			'slug' : 'product-2',
			'description' : 'Description for product 2',
			'vendor' : 'Mr Vendor',
			'price' : '500.99',
			'taxable' : 'true',
			'discountprice' : '449.99',
			'discounted' : 'false',
			'minbuy' : '1',
			'maxbuy' : '5',
			'sku' : 'ABCD',
			'barcode' : '12345',
			'type' : 'PHYSICAL',
			'quantity' : '99',
			'allowbuynostock' : 'true',
			'fileid' : '40d9e788-b556-4733-8cf9-fe53dabf75c6',
			'weight' : '10.65',
			'visible' : 'true',
			'size' : '1',
			'seopagetitle' : 'SEO page title',
			'seopagedescription' : 'SEO META description',
			'seometakeywords' : 'SEO META keywords',
			'categoryid' : ['381b456b-cce3-4920-ae97-c36f833962d3','622e6b55-ffa6-4149-9993-a44cf7f9cc9f'],
			'collectionid' : ['1a602ece-e91c-46c1-8316-669bac1aa739','1c54200b-8049-47c0-931d-2795467970cc'],
			'tags' : ["tag-product-1","tag-product-2"]
		}]
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "d8d222b3-3b3d-4a18-b123-55fb84ba8f9b",
      "name": "Product 2",
      "slug": "product-2",
      "description": "Description for product 2",
      "vendor": "Mr Vendor",
      "taxable": "1",
      "price": "500,99",
      "discountprice": "449,99",
      "discounted": "0",
      "minbuy": "1",
      "maxbuy": "5",
      "sku": "ABCD",
      "barcode": "12345",
      "type": "PHYSICAL",
      "quantity": "99",
      "allowbuynostock": "1",
      "weight": "10,65",
      "visible": "1",
      "seopagetitle": "SEO page title",
      "seopagedescription": "SEO META description",
      "seometakeywords": "SEO META keywords",
      "size": "0",
      "nbsold": "0",
      "categories": [
         {
            "id": "381b456b-cce3-4920-ae97-c36f833962d3",
            "name": "category-1"
         },
         {
            "id": "622e6b55-ffa6-4149-9993-a44cf7f9cc9f",
            "name": "category-2"
         }
      ],
      "collections": [
         {
            "id": "1a602ece-e91c-46c1-8316-669bac1aa739",
            "name": "collection-1"
         },
         {
            "id": "1c54200b-8049-47c0-931d-2795467970cc",
            "name": "collection-2"
         }
      ],
      "images": [],
      "reviews": [],
      "tags": [
         {
            "tag": "tag-product-1"
         },
         {
            "tag": "tag-product-2"
         }
      ],
      "variants": [],
      "author": "Mr Example",
      "createdon": "2016-09-17 13:53:56"
   }
]

UPDATE

URL

POST https://your-secured-store-url:443/api/v1/products/update

Data properties

Mandatory
Property Type
id GUID
name String (max 255 chars)
slug String (max 255 chars)
vendor String (max 255 chars)
price Decimal (max 8 digits and 2 decimals)
taxable Boolean
discountprice Decimal (max 8 digits and 2 decimals)
discounted Boolean
minbuy Integer (max 11 digits)
maxbuy Integer (max 11 digits)
sku String (max 255 chars)
barcode String (max 255 chars)
type String (Predefined values)
quantity Integer (max 11 digits)
allowbuynostock Boolean
weight Decimal (max 2 digits and 2 decimals)
visible Boolean
size Integer (max 11 digits)
seopagetitle String (max 255 chars)
seopagedescription String (max 255 chars)
seometakeywords String (max 255 chars)
categoryid Array of GUID (need to be a valid category id)
collectionid Array of GUID (need to be a valid collection id)
tags Array of String (max 255 chars)

Request

Most complete request

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
	'data' : [
		{
			'id' : 'd8d222b3-3b3d-4a18-b123-55fb84ba8f9b',
			'name' : 'Product 2 UPDATE',
			'slug' : 'product-2-update',
			'description' : 'Description for product 2 UPDATE',
			'vendor' : 'Mr Vendor',
			'price' : '500.99',
			'taxable' : 'true',
			'discountprice' : '449.99',
			'discounted' : 'false',
			'minbuy' : '1',
			'maxbuy' : '5',
			'sku' : 'ABCD',
			'barcode' : '12345',
			'type' : 'PHYSICAL',
			'quantity' : '99',
			'allowbuynostock' : 'true',
			'fileid' : '40d9e788-b556-4733-8cf9-fe53dabf75c6',
			'weight' : '10.65',
			'visible' : 'true',
			'size' : '1',
			'seopagetitle' : 'SEO page title',
			'seopagedescription' : 'SEO META description',
			'seometakeywords' : 'SEO META keywords',
			'categoryid' : ['381b456b-cce3-4920-ae97-c36f833962d3','622e6b55-ffa6-4149-9993-a44cf7f9cc9f'],
			'collectionid' : ['1a602ece-e91c-46c1-8316-669bac1aa739','1c54200b-8049-47c0-931d-2795467970cc'],
			'tags' : ["tag-product-1","tag-product-2"]
		}]
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "d8d222b3-3b3d-4a18-b123-55fb84ba8f9b",
      "name": "Product 2 UPDATE",
      "slug": "product-2-update",
      "description": "Description for product 2 UPDATE",
      "vendor": "Mr Vendor",
      "taxable": "1",
      "price": "500,99",
      "discountprice": "449,99",
      "discounted": "0",
      "minbuy": "1",
      "maxbuy": "5",
      "sku": "ABCD",
      "barcode": "12345",
      "type": "PHYSICAL",
      "quantity": "99",
      "allowbuynostock": "1",
      "weight": "10,65",
      "visible": "1",
      "seopagetitle": "SEO page title",
      "seopagedescription": "SEO META description",
      "seometakeywords": "SEO META keywords",
      "size": "0",
      "nbsold": "0",
      "categories": [
         {
            "id": "381b456b-cce3-4920-ae97-c36f833962d3",
            "name": "category-1"
         },
         {
            "id": "622e6b55-ffa6-4149-9993-a44cf7f9cc9f",
            "name": "category-2"
         }
      ],
      "collections": [
         {
            "id": "1a602ece-e91c-46c1-8316-669bac1aa739",
            "name": "collection-1"
         },
         {
            "id": "1c54200b-8049-47c0-931d-2795467970cc",
            "name": "collection-2"
         }
      ],
      "images": [],
      "reviews": [],
      "tags": [
         {
            "tag": "tag-product-1"
         },
         {
            "tag": "tag-product-2"
         }
      ],
      "variants": [],
      "author": "",
      "createdon": "2016-09-17 13:53:56"
   }
]

DELETE

URL

POST https://your-secured-store-url:443/api/v1/products/delete

Filters

Filter Type
id GUID

Request

Normal request

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
    'filter' : [{
        'id': ['d8d222b3-3b3d-4a18-b123-55fb84ba8f9b']
    }]
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

{
   "success": "true"
}