Often category names differ between a POS/Inventory System and a client’s website. The job of this API is to maintain a list of the categories in the POS System. Once the category list exists, the client will be able to go into SiteManager and map each POS category to the corresponding website category.
Once categories are mapped, requests to the Product Import API can specify POS/Inventory System category names, and imported products will automatically be categorized into the appropriate website categories.
The basic functionality of the POS Category API is “delete all”, “recreate all”, “delete”, “get”, and “insert”.
All endpoints for this API follow this format:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_cats&a={ACTION}&authKey={AUTHKEY}
where {ACTION} is one of the below actions
Description: Insert records representing categories in the POS/Inventory System.
categories
: A JSON array of one or more category objects, each with a numeric catID
and a string catName
representing the category’s name inside the POS system.
Type: POST Variable
Datatype: JSON
Example value:
[{"catID":1, "catName":"cat1"},{"catID":2,"catName":"cat2"},{"catID":3,"catName":"cat3"}] |
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_cats&a=insert_pos_cats&authKey={AUTHKEY} |
Description: Delete all existing POS cats, and recreate based on given JSON array of new categories. Note: to prevent the website owner from having to re-map, this should only be called the first time.
categories
: A JSON array of one or more category objects, each with a numeric catID
representing the category’s ID and a string catName
representing the category’s name inside the POS system.
Type: POST Variable
Datatype: JSON
Example value:
[{"catID":1, "catName":"cat1"},{"catID":2,"catName":"cat2"},{"catID":3,"catName":"cat3"}] |
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_cats&a=recreate_all_pos_cats&authKey={AUTHKEY} |
Description: Delete all existing POS category records. Note: to prevent the website owner from having to re-map, this should only be called the first time.
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_cats&a=delete_all_pos_cats&authKey={AUTHKEY} |
Description: Delete a single POS cat, and recreate based on given JSON array of new categories. This can be used to maintain cohesion between the categories in the POS system and the website.
catID
: A numeric value representing the category’s ID inside the POS system.
Type: POST Variable
Datatype: Integer
Example value:
100 |
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_cats&a=delete_pos_cat&authKey={AUTHKEY} |
Description: List all existing POS category records. This can be used to synchronize the records between the POS System and the POS category records inside the website.
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_cats&a=get_all_pos_cats&authKey={AUTHKEY} |
The API will return JSON in the format
{
”success”:true|false,
”error”:true|false
}
The return value for success will contain true
in the success property.
{ "success": true, "error": false, "msg": "4 rows created", "rowsCreated": 4 } |
If the “error” property is true
, a msg
property will be included with clues as to what the error is.
{ "success": false, "error": true, "msg": "Missing parameter." } |