You are on page 1of 9

Qairus Coorporation

E-Commerse_API_Interface_1.6

Document
Revision

Author

Modification
Date

Description of Changes

1.0

Mazhar Ahmed

August 17th 2015

Initial API Specification

1.1

Naveed Ahmad

August 26th 2015

1.2

Naveed Ahmad

August 26th 2015

1.3

Naveed Ahmad

December 4th 2015

1.4
1.5

Naveed Ahmad
Naveed Ahmad

December 7th 2015


December 10th 2015

1.6

Mazhar and Naveed

December 11, 2015

Complete API Specification with


division in different Interfaces
Feedback by Usman Sb.
Incorporated.
Feedback on schema to use separate
databases for enterprises. Relevant
changes to the API are made here.
Feedback from Mazhar incorporated.
API was modified for adding an item
to multiple branches.
1. There would a seprate
country table in the ecomm
db. From which country_id
would be picked up.
2. There would be a seprate
table for repository, type and
subtypes. UI would also be
populated from these tables.
3. The list of branch_ids in the
API
add_item_branch_repository
could be empty. If its empty
then only items table would
be updated. Otherwise, both
tables would be updated.
4. Category name changed to
repository.

Contents
Enterprise Management Interface ........................................................................................................... 3
add_enterprise () ................................................................................................................................. 3
remove_enterprise ()........................................................................................................................... 3
add branch () ....................................................................................................................................... 3
remove_branch () ................................................................................................................................ 4
Enterprise Stock Interface ....................................................................................................................... 4
add_item_branch_category ().............................................................................................................. 4
remove_item_branch_category() ........................................................................................................ 4
add_item_quantity_branch_category()................................................................................................ 5
subtract_item_quantity_branch_category()......................................................................................... 5
order_enterprise_for_items() .............................................................................................................. 5
get _order_for_branch() ...................................................................................................................... 6
Enterprise Stock/Purchase Analytics Interface ......................................................................................... 6
get_item_stock_status() ...................................................................................................................... 6
Enterprise Returns Interface .................................................................................................................... 7
process_return_on_enterprise () ......................................................................................................... 7
Service Interface...................................................................................................................................... 7
set_enterprise_customer_credit_limit ().............................................................................................. 7
get_enterprise_customer_credit_limit () ............................................................................................. 7
set_enterprise_customer_subscription_time () ................................................................................... 8
get_enterprise_customer_subscription_time () ................................................................................... 8

E-Commerce API Interface


Following are the functions available to interface E-Commerce API

Enterprise Management Interface


add_enterprise ()
This function add/register a new enterprise

Parameters
Input
enterprise_name (varchar)
enterpise_website_address (varchar)
enterprise_address (varchar)
enterprise_telephone (varchar)
enterpise_country (int)
Output
enterprise_id (int)

remove_enterprise ()
This function will remove/unregister an enterprise

Parameters
Input
enterprise_id (int)
Output
0 or 1 for failure or success respectively

add branch ()
This function will add/register a branch for an enterprise.

Parameters
Input
branch_name (varchar)
branch_address (varchar)
branch_telephone (varchar)
Output

branch_id (int)

remove_branch ()
This function will remove/unregister a branch for an enterprise

Parameters
Input
branch_id (int)
Output
0 or 1 for failure or success respectively

select_database_for_enterprise_operation()
This function will select an enterprise database for enterprise/branch level operations.

Parameters
Input
enterprise_id(int)
Output
Database connection handler.

Enterprise Stock Interface


add_item_branch_repository ()
This function will add an item to a repository of an enterprise in a particular branch

Parameters
Input
branch_ids (array of [int])
item_name (varchar)
item_category (boolean): 0 or 1 for physical or digital
category_id (int)
item_type (int)
item_sub_type (int)
item_sales_price (int)
Output
item_id (int)

remove_item_branch_repository()
This function will remove an item from a repository of an enterprise in a particular branch
4

Parameters
Input
branch_id (int)
item_id (int)
Output
0 or 1 for failure or success respectively

add_item_quantity_branch_repository()
This function will add to the quantity of an item in the repository of an enterprise in a particular branch

Parameters
Input
branch_id (int)
item_id (int)
quantity_to_add (int)
Output
0 or 1 for failure or success respectively

subtract_item_quantity_branch_category()
This function will subtract from the quantity of an item in the repository of an enterprise in a particular
branch

Parameters
Input
branch_id (int)
item_id (int)
quantity_to_subtract (int)
Output
0 or 1 for failure or success respectively

order_enterprise_for_items()
This function will be used to
1. Place an order for the customer for home delivery on credit through mobile
2. Place an order for the customer based for home delivery on credit through web
3. Place an order for the customer for home delivery on payment through mobile
4. Place an order for the customer for home delivery on payment through web
5. Place an order for the customer for picking at the shop on credit through mobile
6. Place an order for the customer for picking at the shop on credit through web
5

7. Place an order for the customer for picking at the shop on payment through mobile
8. Place an order for the customer for picking at the shop on payment through web

Parameters
Input
branch_id (int)
qairus_id (int)
payment_type (boolean): 0 or 1 for credit or cash
delivery_type (boolean): 0 or 1 for shipment or pick-from-shop
order_type (boolean): 0 or 1 for product or service
order_source (boolean): 0 for mobile and 1 for web
item_list (list of items): Each item contains item_id (int) and item_quantity (int)
delivery_info (varchar): Will contain shop_address for pick from shop and home address for home
delivery
subscription_info (boolean): monthly or yearly subscription if order_type is service
Output
order_id (int)

get _order_for_branch()
This function will search the order of a customer based upon customer id and order id from the pick
from shop queue of a particular branch

Parameters
Input
branch_id (int)
qairus_id (int)
order_id (int)
Output
payment_type (boolean): 0 or 1 for credit or cash
item_list (list of items): Each item contains item_id (int) and item_quantity (int)

Enterprise Stock/Purchase Analytics Interface


get_item_stock_status()
This function will check if the ordered item is in stock or not at a particular branch for an enterprise
branch

Parameters
Input
branch_id (int)
item_id (int)
item_quantity (int)

Output
0 or 1 for failure or success respectively

Enterprise Returns Interface


process_return_on_enterprise ()
This function will process the return of an enterprise, by customer id and order id at a particular branch

Parameters
Input
branch_id (int)
qairus_id (int)
order_id (int)
Output
0 or 1 for failure or success respectively

Service Interface
set_enterprise_customer_credit_limit ()
This functions will specify the credit limit for the customer of an enterprise

Parameters
Input
qairus_id (int)
credit_limit (int)
Output
0 or 1 for failure or success respectively

get_enterprise_customer_credit_limit ()
This function will get the remaining credit limit for the customer of an enterprise

Parameters
Input
qairus_id (int)
Output
credit_limit (int)

set_enterprise_customer_subscription_time ()
This function will set the subscription time

Parameters
Input
qairus_id (int)
subscription_start_date (date)
subscription_end_date (date)

Output
0 or 1 for failure or success respectively

get_enterprise_customer_subscription_time ()
This function will get the subscription time

Parameters
Input
qairus_id (int)

Output
subscription_start_date (date)
subscription_end_date (date)

You might also like