POS Vendor API
Often vendor/brand names differ between a POS/Inventory System and a client’s website. The job of this API is to maintain a list of the vendor/brand names from the POS/Inventory System. Once the brand list exists, the client will be able to go into SiteManager and map each POS brand to the corresponding website brand.
Once vendors are mapped, requests to the Product Import API can specify POS/Inventory System vendor names, and imported products will automatically be attributed to the appropriate website brands.
The basic functionality of POS vendors is “delete all”, “recreate all”, “delete”, “get”, and “insert”.
The job of this API is to maintain a list of the vendors in the POS System. Once the vendor list exists, the client will be able to go in to SiteManager and map each POS vendor to the corresponding website brand.
Endpoints
All endpoints for this API follow this format:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_vendors&a={ACTION}&authKey={AUTHKEY}
where {ACTION} is one of the below actions
ACTIONS
insert_pos_vendors:
Description: Insert records representing vendors from the POS/Inventory System.
Parameters
vendors
: A JSON array of one or more vendor IDs that can be used to distinguish vendors inside the POS system.
Type: POST Variable
Datatype: JSON
Example value:
["ASHI", "TACOR", "ALEXANI"]
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_vendors&a=insert_pos_vendors&authKey={AUTHKEY}
recreate_all_pos_vendors:
Description: Delete all existing POS vendors, and recreate based on given JSON array of new vendors. Note: to prevent the website owner from having to re-map, this should only be called the first time.
Parameters
vendors
: A JSON array of one or more vendor IDs that can be used to distinguish vendors inside the POS system.
Type: POST Variable
Datatype: JSON
Example value:
["ASHI", "TACOR", "ALEXANI"]
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_vendors&a=recreate_all_pos_vendors&authKey={AUTHKEY}
delete_all_pos_vendors:
Description: Delete all existing POS vendor records. Note: to prevent the website owner from having to re-map, this should only be called the first time.
Parameters: None
Call Type: POST
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_vendors&a=delete_all_pos_vendors&authKey={AUTHKEY}
delete_pos_vendor:
Description: Delete a single POS vendor, and recreate based on given JSON array of new vendors. This can be used to maintain cohesion between the vendors in the POS system and the POS vendors stored in the website.
Parameters
vendorID
: A numeric value representing the vendor’s ID inside the POS system.
Type: POST Variable
Datatype: Integer/String
Example value:
ALEXANI
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_vendors&a=delete_pos_vendor&authKey={AUTHKEY}
get_all_pos_vendors:
Description: List all existing POS vendor records. This can be used to synchronize the records between the POS System and the POS vendor records inside the website.
Parameters: None
Call Type: GET
Example Call:
https://{DOMAIN}/api/async.php?t=sitemanager&m=pos_vendors&a=get_all_pos_vendors&authKey={AUTHKEY}
Return Values
The API will return JSON in the format
{
”success”:true|false,
”error”:true|false
}
SUCCESS
The return value for success will contain true
in the success property.
Example
{
"success": true,
"error": false,
"msg": "4 rows created",
"rowsCreated": 4
}
ERRORS
If the “error” property is true
, a msg
property will be included with clues as to what the error is.
Example
{
"success": false,
"error": true,
"msg": "Missing parameter."
}