All functions return a set of fields from database. An explanation of the fields is included below.

1) owner_id - Client Book CRM user_id or inventory id of the user who added the wish list item

2) date_entered - when the item was added (format: yyyy-mm-dd hh:ii:ss)

3) description - item description

4) item - item name of the wish list

5) id the primary key or the wish list item ID

6) price the price of the item

7) sku - stock keeping unit of the item

8) style_number style number of the item

9) update_date - the date of the last update (format: yyyy-mm-dd hh:ii:ss)

10) item_image - the item image server URL

11) client_id - Client Book CRM client_id of the client who the wish list belongs to

12) lead_id - Client Book CRM lead_id of the lead who the wish list belongs to

13) vendor_id - Client Book CRM vendor_id of the item's vendor

14) new_inventory_id - the primary key or ID in your database. (e.g database in user’s server that is synchronized or linked with the Client Book CRM database). Empty value indicates there is any changes in Client Book CRM database and need to be synchronized again, not empty indicates it has been synchronized.

15) Old_inventory_id the primary key or ID in your database, obtained after the first synchronization process (e.g database in user’s server that is synchronized or linked with the Client Book CRM database).

Note: if both new_inventory_id and old_inventory_id are empty, the purchase has not synchronized with other database. If old_inventory_id is not empty and new_inventory_id is empty, it means there are some changes on the purchase information, so it needs to be synchronized again.

Function List:

a. [GET] list

Retrieve all wish list

Return content in “data” field. “data” is in array format.

Parameters:

- order : to sort the result by specific value. Default is created.

Value: update | created

- limit : to set the number of the data displayed. If not set, it will return all data. In order to use this parameter, from must be set too.

- from : to set the number where to start displaying the data set (offset). If not set, it will return all data. In order to use this parameter, limit must be set too.

- sku : to search wish list with specific stock keeping unit.

- lid : get wish list from specific lead id.

- q : keyword to search. Search in item, price, sku, style_number

- cid : contains specific client id. Use either cid or cinvid, but not both

- cinvid : contains specific client inventory_id. Use either cid or cinvid, but not both

b. [GET] new

Retrieve all wish lists which are new and have not been synchronized with the third-party database.

Return content in “data” field. “data” is in array format.

Parameters:

- order : to sort the result by specific value. Default is created.

Value: update | created

- limit : to set the number of the data displayed. If not set, it will return all data. In order to use this parameter, from must be set too.

- from : to set the number where to start displaying the data set (offset). If not set, it will return all data. In order to use this parameter, limit must be set too.

- sku : to search wish list with specific stock keeping unit.

- lid : get wish list from specific lead id.

- q : keyword to search. Search in item, price, sku, style_number

- cid : contains specific client id. Use either cid or cinvid, but not both

- cinvid : contains specific client inventory_id. Use either cid or cinvid, but not both

c. [GET] edited

Retrieve all wish list which have been updated and have not been synchronized with the third-party database.

Return content in “data” field. “data” is in array format.

Parameters:

- order : to sort the result by specific value. Default is created.

Value: update | created

- limit : to set the number of the data displayed. If not set, it will return all data. In order to use this parameter, from must be set too.

- from : to set the number where to start displaying the data set (offset). If not set, it will return all data. In order to use this parameter, limit must be set too.

- sku : to search wish list with specific stock keeping unit.

- lid : get wish list from specific lead id.

- q : keyword to search. Search in item, price, sku, style_number

- cid : contains specific client id. Use either cid or cinvid, but not both

- cinvid : contains specific client inventory_id. Use either cid or cinvid, but not both

d. [POST] saveinventory

Save the inventory_id (ID got from the synchronization process, ID from third-party database) into Client Book CRM database.

Return content in “data” field. “data” is in string format, either error message or success message.

Parameters:

- inventory_id : ID got from the synchronization process (ID from third-party database, mandatory)

- id : local wish list ID which is being synchronized (mandatory)

e. [GET] view/:type/:id

Get specific wish list item by its’ ID.

Return content in “data” field. “data” is in array format.

Parameters:

:type : inventory | id

:id : the id or inventory_id of the specific wish list. id is an ID in Client Book CRM database, inventory_id is an ID got from synchronization process.

f. [GET] purchasewish/:id

Purchase a wish list item and move it into “purchase” table.

Return content in “data” field. “data” is in string format, either error message or success message.

Parameters:

:id : the id of the specific Client Book CRM wish list

g. [POST] delete

Delete a wish list item.

Return content in “data” field. “data” is in string format, either error message or success message.

Parameters:

- id : Client Book CRM wish list ID (mandatory)

- lead_id : Client Book CRM lead ID (mandatory)

- client_id : Client Book CRM client ID (mandatory)

note: only one of lead_id or client_id is required. If lead_id and client_id are used together, it will return an error message

h. [POST] add

Add a wish list into Client Book CRM database.

Return content in “data” field. “data” is in string format, either error message or success message.

Parameters:

- item (mandatory)

- client_id (mandatory)

- lead_id (mandatory)

- price

- sku

- style_number

- description

- vendor_id

- item_image

- inventory_id (if filled, it will add an inventory_id for the item)

- client_inventory_id : client’s inventory_id in Client Book CRM database

i. [POST] edit/:id

Update a wish list from Client Book CRM database

Return content in “data” field. “data” is in string format, either error message or success message.

Parameters:

- :id : Client Book CRM ID which is being updated (mandatory)

- item (mandatory, if edited)

- price

- sku

- style_number

- description

- vendor_id

- item_image