CATALOG Endpoints
CATALOG ENDPOINTS (httpS://<server>/CATALOG/<FUNCTION>/,GET)
The catalog endpoints require no input, and return various components of the catalog required for an external web shop to display product information. These end points are provided by ICCS.
The four end points are:
- PRODUCTS – returns a full list of products with information about each product
- STOCK – returns a list of products with current stock levels and recent sales
- NAV – returns a hierarchy used for a user interface element to select products by general groupings.
- INSTRUCTIONS – (not yet implemented) returns information to allow a user interface element to select instructions and modifiers for products (e.g. Steak rare, or onion sauce etc).
PRODUCTS ENDPOINT FUNCTION
The products function returns a JSON array of product objects as follows:
- id – the product id of the product used to pass into the transaction API
- name – the display name of the product
- navigator – the point that this product appears on the navigator
- displayprice – the nominal sell price of the product (which will be altered by surcharges and discounts)
- tags – a JSON object containing tag name/value pairs (e.g. brand = FOSTERS)
Sample product object:
{
"id": "1020",
"name": "Beez Neez Stub Carton",
"navigator": "40104",
"displayprice": "59.99",
"tags": {
"department": "PACKAGED LOCAL",
"brand": "FOSTERS"
}
}
Note that the names returned by the transaction end point will be internal receipt friendly names (all caps etc) not the names used to display on the user interface.
STOCK ENDPOINT FUNCTION
The stocks function returns a JSON array of stock objects as follows:
- id – the product id of the product as per the catalog
- qty – the currently available quantity
- recent – recent sales to allow for a determination of low stock, check in store statuses.
Sample stock object:
{
"id": "1020",
"qty": "10",
"recent": "0"
}
NAV ENDPOINT FUNCTION
The nav end point returns a hierarchical JSON array of JSON objects each either containing a child list, or if a leaf node of the tree containing a navigator id uses to determine which produces appear.
Each JSON object contains two of the following three JSON name/value pairs:
- name – all objects have a name which is displayed on the user interface in the hierarchy
- children – a normal node will have a children value which itself is a JSON array of further node objects
- id – a leaf node (no children) contains a nav id which can be matched with the navigator value of each product to determine what products appear at this point.
A sample of a small navigator is:
{
"name": "Imported Beer",
"children": [
{
"name": "Mid-Strength",
"id": "40202"
},
{
"name": "Low/Non Alcoholic",
"id": "40203"
},
{
"name": "Full-Strength",
"id": "40201"
}
]
}