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

1) store_id - the store's primary key

2) store_name

3) update_date

4) store_street_address

5) store_city

6) store_state

7) store_zip

8) store_phone

Function List: 

a. [GET] list

Retrieve all stores within company

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

Parameters:

- 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.

- q : keyword to search. Search in store_name

b. [GET] detail/:id

Get specific store by its’ ID.

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

Parameters:

- :id : the Client Book CRM store id (mandatory)

c. [GET] delete/:id

Delete a store.

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

Parameters:

- :id : Client Book CRM store ID (mandatory)

d. [POST] add

Add a store into Client Book CRM database.

Return content in “data” field. “data” is an array of current inputted data or a empty string. “message” field contains either error message or success message.

Parameters:

- store_name (mandatory)

- store_street_address

- store_city

- store_state

- store_zip

- store_phone

e. [POST] edit/:id

Update a store from Client Book CRM database

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

Parameters:

- id : the store ID which is being updated (mandatory)

- store_name (mandatory, if edited)

- store_street_address

- store_city

- store_state

- store_zip

- store_phone