ProductsFindAll Endpoint

Overview

This endpoint allows you to find all of the products that are in your store catalog.  This allows you to list them and parse them for any number of reasons or purposes.

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of REST and API’s
  • Understanding of C# and/or JavaScript
  • Visual Studio 2012 or newer

Getting Started

You should already have a project open and ready to accept code to allow you to use this REST API endpoint.  You should also have one or more products created so that you can successfully find them.

ProductsFindAll

This REST API endpoint allows you to find all of the products in your store. 

Example URL

This is what the REST endpoint will look like if you are calling it using JavaScript.  See our REST API URL documentation for more information.

http://yourdomain.com/DesktopModules/Hotcakes/API/rest/v1/products

HTTP Method

GET

Parameters

There are no parameters for this endpoint.

Returns

If successful, this endpoint will return a populated list of the ProductDTO object in JSON format.  Otherwise, you should have one or more errors returned.  

Example Code

The following code will allow you to successfully call this endpoint, provided that you have enabled it.

Project References

  • Hotcakes.CommerceDTO

Import Namespaces

  • Hotcakes.CommerceDTO.v1
  • Hotcakes.CommerceDTO.v1.Catalog
  • Hotcakes.CommerceDTO.v1.Client

 

string url = "http://YOURDOMAIN.COM";
string key = "YOUR-API-KEY";

Api proxy = new Api(url, key);

// find all categories in the store
ApiResponse<List<ProductDTO>> response = proxy.ProductsFindAll();
// your domain name
var url = "http://YOURDOMAIN.COM"; 
// the path where the API is
var apiPath = "/DesktopModules/Hotcakes/API/rest/v1/";  
// endpoint as shown in the documentation
var endPoint = "products";  
// get this from the store admin
var apiKey = "YOUR-API-KEY";

$(document).ready(function() {

    // call the API to find all products in the store
    $.ajax({
        dataType: "json",
        url: url + apiPath + endPoint + "?key=" + apiKey,
        type: 'GET',
        success: function (data) {
            // do something
        },
        error: function (jqXHR, textStatus) {
           // do something else
        }
    });

});
{
   "Errors":[

   ],
   "Content":[
      {
         "Bvin":"142034eb-dc7b-4e20-989b-2efedca66150",
         "Sku":"SAMPLE001",
         "ProductName":"Blue Bracelet",
         "ProductTypeId":"",
         "CustomProperties":[
            {
               "DeveloperId":"hcc",
               "Key":"swatchpath",
               "Value":""
            }
         ],
         "ListPrice":0.0000000000,
         "SitePrice":42.9500000000,
         "SitePriceOverrideText":"",
         "SiteCost":0.0000000000,
         "MetaKeywords":"Blue,Bracelet,Sample,Demo",
         "MetaDescription":"Sample Blue Bracelet for Demonstration",
         "MetaTitle":"Sample Blue Bracelet",
         "TaxExempt":false,
         "TaxSchedule":-1,
         "ShippingDetails":{
            "IsNonShipping":false,
            "ExtraShipFee":0.0000000000,
            "Weight":2.0000000000,
            "Length":6.0000000000,
            "Width":6.0000000000,
            "Height":3.0000000000,
            "ShippingSource":1,
            "ShippingSourceId":"",
            "ShipSeparately":false
         },
         "ShippingMode":1,
         "Status":1,
         "ImageFileSmall":"BraceletBlue.png",
         "ImageFileSmallAlternateText":"Blue Bracelet SAMPLE001",
         "ImageFileMedium":"BraceletBlue.png",
         "ImageFileMediumAlternateText":"Blue Bracelet SAMPLE001",
         "CreationDateUtc":"\/Date(1398071723923)\/",
         "MinimumQty":1,
         "ShortDescription":"",
         "LongDescription":"An incredible blue bracelet sample product. This item is not actually for sale. It is a sample product to demonstrate how your store may look with products loaded",
         "ManufacturerId":"",
         "VendorId":"",
         "GiftWrapAllowed":false,
         "GiftWrapPrice":0.0000000000,
         "Keywords":"bracelett",
         "PreContentColumnId":"",
         "PostContentColumnId":"",
         "UrlSlug":"blue-bracelet",
         "InventoryMode":100,
         "IsAvailableForSale":true,
         "Featured":true,
         "AllowReviews":true,
         "Tabs":[
            {
               "Bvin":"711cbc90-0d7b-4682-a769-c8226b1db3b3",
               "TabTitle":"Sustainability",
               "HtmlData":"\u003cp\u003eAll of our jewelry products are recycled and made in sustainable eco-friendly environments\u003c/p\u003e",
               "SortOrder":1
            }
         ],
         "StoreId":1
      },
      {
         "Bvin":"e4ef52ac-086c-4986-856d-c17a054b69ca",
         "Sku":"SAMPLE004",
         "ProductName":"Brown Fedora",
         "ProductTypeId":"",
         "CustomProperties":[
            {
               "DeveloperId":"hcc",
               "Key":"swatchpath",
               "Value":""
            }
         ],
         "ListPrice":0.0000000000,
         "SitePrice":59.8700000000,
         "SitePriceOverrideText":"",
         "SiteCost":0.0000000000,
         "MetaKeywords":"",
         "MetaDescription":"",
         "MetaTitle":"",
         "TaxExempt":false,
         "TaxSchedule":-1,
         "ShippingDetails":{
            "IsNonShipping":false,
            "ExtraShipFee":0.0000000000,
            "Weight":20.0000000000,
            "Length":12.0000000000,
            "Width":12.0000000000,
            "Height":10.0000000000,
            "ShippingSource":1,
            "ShippingSourceId":"",
            "ShipSeparately":false
         },
         "ShippingMode":1,
         "Status":1,
         "ImageFileSmall":"indiana-jones-hat.jpg",
         "ImageFileSmallAlternateText":"Brown Fedora SAMPLE004",
         "ImageFileMedium":"indiana-jones-hat.jpg",
         "ImageFileMediumAlternateText":"Brown Fedora SAMPLE004",
         "CreationDateUtc":"\/Date(1398071726013)\/",
         "MinimumQty":1,
         "ShortDescription":"",
         "LongDescription":"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",
         "ManufacturerId":"",
         "VendorId":"",
         "GiftWrapAllowed":false,
         "GiftWrapPrice":0.0000000000,
         "Keywords":"",
         "PreContentColumnId":"",
         "PostContentColumnId":"",
         "UrlSlug":"brown-fedora",
         "InventoryMode":100,
         "IsAvailableForSale":true,
         "Featured":true,
         "AllowReviews":true,
         "Tabs":[

         ],
         "StoreId":1
      },
      {
         "Bvin":"d411ef86-4fd1-4218-8090-94bb97a0408e",
         "Sku":"SAMPLE006",
         "ProductName":"Butterfly Earings",
         "ProductTypeId":"",
         "CustomProperties":[
            {
               "DeveloperId":"hcc",
               "Key":"swatchpath",
               "Value":""
            }
         ],
         "ListPrice":0.0000000000,
         "SitePrice":29.9500000000,
         "SitePriceOverrideText":"",
         "SiteCost":0.0000000000,
         "MetaKeywords":"",
         "MetaDescription":"",
         "MetaTitle":"",
         "TaxExempt":false,
         "TaxSchedule":-1,
         "ShippingDetails":{
            "IsNonShipping":false,
            "ExtraShipFee":0.0000000000,
            "Weight":1.0000000000,
            "Length":4.0000000000,
            "Width":4.0000000000,
            "Height":2.0000000000,
            "ShippingSource":1,
            "ShippingSourceId":"",
            "ShipSeparately":false
         },
         "ShippingMode":1,
         "Status":1,
         "ImageFileSmall":"Earrings.jpg",
         "ImageFileSmallAlternateText":"Butterfly Earning SAMPLE006",
         "ImageFileMedium":"Earrings.jpg",
         "ImageFileMediumAlternateText":"Butterfly Earings SAMPLE006",
         "CreationDateUtc":"\/Date(1398071727087)\/",
         "MinimumQty":1,
         "ShortDescription":"",
         "LongDescription":"Sample Butterfly Earings Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",
         "ManufacturerId":"",
         "VendorId":"",
         "GiftWrapAllowed":false,
         "GiftWrapPrice":0.0000000000,
         "Keywords":"",
         "PreContentColumnId":"",
         "PostContentColumnId":"",
         "UrlSlug":"butterfly-earings",
         "InventoryMode":100,
         "IsAvailableForSale":true,
         "Featured":true,
         "AllowReviews":true,
         "Tabs":[

         ],
         "StoreId":1
      },
      {
         "Bvin":"21314568-2250-41e8-a2eb-eae87eb0b80d",
         "Sku":"SAMPLE002",
         "ProductName":"Cup Cake Sample",
         "ProductTypeId":"",
         "CustomProperties":[
            {
               "DeveloperId":"hcc",
               "Key":"swatchpath",
               "Value":""
            }
         ],
         "ListPrice":0.0000000000,
         "SitePrice":1.9900000000,
         "SitePriceOverrideText":"",
         "SiteCost":0.0000000000,
         "MetaKeywords":"cup,cake,cupcake,valentine,small,treats,baked goods",
         "MetaDescription":"Vanilla Cup Cake with Rich Frosting",
         "MetaTitle":"Vanilla Cup Cake with Rich Frosting",
         "TaxExempt":false,
         "TaxSchedule":-1,
         "ShippingDetails":{
            "IsNonShipping":false,
            "ExtraShipFee":0.0000000000,
            "Weight":1.0000000000,
            "Length":3.0000000000,
            "Width":3.0000000000,
            "Height":4.0000000000,
            "ShippingSource":1,
            "ShippingSourceId":"",
            "ShipSeparately":false
         },
         "ShippingMode":1,
         "Status":1,
         "ImageFileSmall":"CupCake.jpg",
         "ImageFileSmallAlternateText":"Cup Cake Sample SAMPLE002",
         "ImageFileMedium":"CupCake.jpg",
         "ImageFileMediumAlternateText":"Cup Cake Sample SAMPLE002",
         "CreationDateUtc":"\/Date(1398071728130)\/",
         "MinimumQty":1,
         "ShortDescription":"",
         "LongDescription":"Savor this sweet treat from our famous collection of sample items. This product is not for sale and is a demonstration of how items could appear in your store",
         "ManufacturerId":"",
         "VendorId":"",
         "GiftWrapAllowed":false,
         "GiftWrapPrice":0.0000000000,
         "Keywords":"",
         "PreContentColumnId":"",
         "PostContentColumnId":"",
         "UrlSlug":"cup-cake-sample",
         "InventoryMode":100,
         "IsAvailableForSale":true,
         "Featured":true,
         "AllowReviews":true,
         "Tabs":[

         ],
         "StoreId":1
      },
      {
         "Bvin":"5a85405f-1311-481f-b1e6-64e01c8714e7",
         "Sku":"SAMPLE005",
         "ProductName":"Laptop Computer Sample",
         "ProductTypeId":"1d883a38-143f-4bfc-b0d9-6ff3b410a95b",
         "CustomProperties":[
            {
               "DeveloperId":"hcc",
               "Key":"swatchpath",
               "Value":"Common-Colors"
            }
         ],
         "ListPrice":1999.0000000000,
         "SitePrice":1299.0000000000,
         "SitePriceOverrideText":"",
         "SiteCost":0.0000000000,
         "MetaKeywords":"",
         "MetaDescription":"",
         "MetaTitle":"Laptop Sample",
         "TaxExempt":false,
         "TaxSchedule":-1,
         "ShippingDetails":{
            "IsNonShipping":false,
            "ExtraShipFee":0.0000000000,
            "Weight":35.0000000000,
            "Length":28.0000000000,
            "Width":29.0000000000,
            "Height":35.0000000000,
            "ShippingSource":1,
            "ShippingSourceId":"",
            "ShipSeparately":false
         },
         "ShippingMode":1,
         "Status":1,
         "ImageFileSmall":"Laptop.png",
         "ImageFileSmallAlternateText":"Laptop Computer Sample SAMPLE005",
         "ImageFileMedium":"Laptop.png",
         "ImageFileMediumAlternateText":"Laptop Computer Sample SAMPLE005",
         "CreationDateUtc":"\/Date(1398071728740)\/",
         "MinimumQty":1,
         "ShortDescription":"",
         "LongDescription":"This is a sample laptop computer. It is not for sale and is a demonstration of what products could look like in your store",
         "ManufacturerId":"",
         "VendorId":"",
         "GiftWrapAllowed":false,
         "GiftWrapPrice":0.0000000000,
         "Keywords":"",
         "PreContentColumnId":"",
         "PostContentColumnId":"",
         "UrlSlug":"laptop-computer-sample",
         "InventoryMode":100,
         "IsAvailableForSale":true,
         "Featured":true,
         "AllowReviews":true,
         "Tabs":[

         ],
         "StoreId":1
      },
      {
         "Bvin":"e03f4def-b884-4f1b-b013-a0b830e6651f",
         "Sku":"SAMPLE003",
         "ProductName":"Purple Top",
         "ProductTypeId":"",
         "CustomProperties":[
            {
               "DeveloperId":"hcc",
               "Key":"swatchpath",
               "Value":""
            }
         ],
         "ListPrice":0.0000000000,
         "SitePrice":39.9500000000,
         "SitePriceOverrideText":"",
         "SiteCost":0.0000000000,
         "MetaKeywords":"",
         "MetaDescription":"",
         "MetaTitle":"Purple Top",
         "TaxExempt":false,
         "TaxSchedule":-1,
         "ShippingDetails":{
            "IsNonShipping":false,
            "ExtraShipFee":0.0000000000,
            "Weight":1.0000000000,
            "Length":6.0000000000,
            "Width":6.0000000000,
            "Height":1.0000000000,
            "ShippingSource":1,
            "ShippingSourceId":"",
            "ShipSeparately":false
         },
         "ShippingMode":1,
         "Status":1,
         "ImageFileSmall":"PurpleTop.jpg",
         "ImageFileSmallAlternateText":"Purple Top SAMPLE003",
         "ImageFileMedium":"PurpleTop.jpg",
         "ImageFileMediumAlternateText":"Purple Top SAMPLE003",
         "CreationDateUtc":"\/Date(1398071730093)\/",
         "MinimumQty":1,
         "ShortDescription":"",
         "LongDescription":"This sample purple top is made of 100% cotton and is made in the USA. Durable and easy to clean, this versatile top will be one of the best sample items not available for purchase you\u0027ve ever seen!",
         "ManufacturerId":"",
         "VendorId":"",
         "GiftWrapAllowed":false,
         "GiftWrapPrice":0.0000000000,
         "Keywords":"",
         "PreContentColumnId":"",
         "PostContentColumnId":"",
         "UrlSlug":"purple-top",
         "InventoryMode":100,
         "IsAvailableForSale":true,
         "Featured":true,
         "AllowReviews":true,
         "Tabs":[

         ],
         "StoreId":1
      }
   ]
}
Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.