Products are the core of any e-commerce website since they are what merchants are trying to sell and customers are trying to buy. This area of the API allows you to manage your product catalog.
The following pre-requisites will be necessary to accomplish the goals of this article:
- General understanding of REST and API’s
If you haven’t already done so, you should probably have a development environment ready to development against, complete with Hotcakes installed and configured.
REST API Endpoints for Products
There are a handful of REST API endpoints that allow you to display or manage various aspects of products. Those endpoints are detailed below.
|ProductsBySlug||ProductDTO||Allows you to find a specific product in the catalog using the slug of the product.|
|ProductsClearAll||ClearProductsData||Permanently deletes all of the products in the store, provided that this has been allowed in the store admin API page.|
|ProductsCountOfAll||Long||Returns the total count of products in the store.|
|ProductsCreate||ProductDTO||Creates a new product in the store using the posted data.|
|ProductsDelete||Boolean||Permanently deletes the specified product from the catalog.|
|ProductsFind||ProductDTO||Allows you to find a specific product in the catalog using the products ID or Bvin.|
|ProductsFindAll||List of ProductDTO||Finds and returns all of the products in the catalog.|
|ProductsFindBySku||ProductDTO||Allows you to find a specific product in the catalog using the product SKU.|
|ProductsFindForCategory||PageOfProducts||Finds all of the products that are assigned to the specified category and returns the specific page.|
|ProductsFindPage||PageOfProducts||Finds all products in the store and returns only the requested page.|
|ProductsUpdate||ProductDTO||Updates an existing product in the catalog using the posted product object.|