Opencart Marketplace Web Services API Module will provide REST API. Thus, by which you can use functions of Opencart Marketplace in other applications like mobile applications and ERP.
Thus, allowing the developer to implement many functionalities of Opencart Marketplace. Likewise, seller dashboard, seller orders, etc. to another platform like Android and iOS.
So, post implementing the API of Opencart Marketplace, the store owner can manage their store from other applications.
Since it’s an add-on for the Marketplace Module. So, OpenCart marketplace module must be installed before installing the Opencart Marketplace Web Services API.
Features
- Easy to customize the module.
- This module uses the standard Opencart API key.
- Opencart marketplace functions included seller-profile, seller-order, seller dashboard, write a review, add history, sell page, and contact seller.
- Get the seller’s product list.
- Add/ Edit/ Delete the seller’s products.
- To get the seller’s list.
- Sellers can Add/ Edit/ Delete Reviews.
- Also, they can view transactions, the latest products.
- The sellers can get product data for various tabs.
- Also, the sellers can set product data for various tabs.
- Sellers can upload a product image.
- View product categories auto-complete list.
- Get auto-complete list for product tabs.
Installation
Thus, the admin can find the catalog folder in the zip file. The admin needs to move the catalog folder into the root directory of your Opencart website.
How To Generate API Key
Thus, the admin can add a new API by navigating through System=>API.

Hence, on clicking on the add new API button, the admin can set the name of API and can generate an API key. So, the admin can also set the IP addresses and can see the session from here.

So, after generating the API key, the admin can use this key for their application or software.
How To Use – REST API
So, after the configuration of the Opencart Marketplace web services API. The admin needs to follow the given instructions.
Admin Level Operations:
1.Methods and Parameters
API URL: siteurl/index.php?route=api/wkrestapi/marketplace/apiLogin
Parameter: apiKey,
Request Type:POST
Description: To authenticate the user.Thus, if the login is successfully done then you will get the wk_token in response that will be used to call the rest of the APIs.
Return type: JSON
2.Methods and Parameters
API URL: siteurl/index.php?route=api/wkrestapi/marketplace/getSellerOrders
Parameters: wk_token, id(order_id)
Request Type: POST
Description: To get the seller orders.
Return type: JSON
3.Methods and Parameters
API URL: siteurl/index.php?route=api/wkrestapi/marketplace/getDashbordData
Parameters: wk_token
Request Type: POST
Description: To get the seller dashboard data.
Return type: JSON
4.Methods and Parameters
API URL: siteurl/index.php?route=api/wkrestapi/marketplace/addHistory
Parameters: wk_token, order_id, order_status_id, notifyadmin, comment
Request Type: POST
Description: To add the order history.
Return Type: JSON
5.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/productList
Parameters:wk_token, filter_name, filter_model, filter_price, filter_quantity, filter_status, sort, order, page, limit, width
Request Type: POST
Description: To get the seller’s product list.
Return Type: JSON
6.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/deleteProduct
Parameters: wk_token, product_id
Request Type: POST
Description: To delete the seller’s products.
Return Type: JSON
7.Methods and Parameters
API URL:siteUrl/index.php?route=api/wkrestapi/marketplace2/getTransactions
Parameters: wk_token, filter_id, filter_details, filter_date, filter_amount, sort, order, page, limit
Request Type: POST
Description: Get seller transactions.
Return Type: JSON
8.Methods and Parameters
API URL:siteUrl/index.php?route=api/wkrestapi/marketplace2/getSellerSubCategory
Parameters: wk_token, id, path
Request Type: POST
Description: Get seller Sub Category
Return Type: JSON
9.Methods and Parameters
API URL:siteUrl/index.php?route=api/wkrestapi/marketplace2/getreviewFields
Parameters: wk_token
Request Type: POST
Description: Get Review Fields.
Return Type: JSON
10.Methods and Parameters
API URL:siteUrl/index.php?route=api/wkrestapi/marketplace2/getReviews
Parameters: wk_token, filter_customer, filter_status, filter_createdate, sort, order, page , limit
Request Type: POST
Description: Get Reviews
Return Type: JSON
11.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getReviewDetails
Parameters: wk_token, review_id
Request Type: POST
Description: Get Review details
Return Type: JSON
12.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/editReview
Parameter: wk_token, review_attributes, customer, cust_id, text
Request Type: POST
Description: Add/ Edit seller review.
Return Type: JSON
13.Methods and Parameters
API URL:siteUrl/index.php?route=api/wkrestapi/marketplace2/deleteReviews
Parameters: wk_token, review_ids
Request Type: POST
Description: To delete seller reviews.
Return Type: JSON
14.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getProductTabs
Parameters: wk_token
Request Type: POST
Description: To get allowed product tabs.
Return Type: JSON
15.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getProductData
Parameters: wk_token,
function: general/data/links/attribute/options/discount/special/images, width: 700 image resize param only for "images" tab data
Request Type: POST
Description: So, to get product data for each tab general/data/links/attribute/options/discount/special/images
Return Type: JSON
16.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: wk_token,
'function': genral (tab name)
'product_description': [{"name":"mobikul test android","description":"mobikul test mobikul test mobikul test mobikul test","meta_title":"mobikul test","meta_description":"mobikul testmobikul test mobikul test","meta_keyword":"mobikul test","tag":"mobikul, test","language_id":"1"},{"name":"اختبار mobikul الروبوت","description":"اختبار mobikul الروبوت اختبار mobikul الروبوت اختبار mobikul الروبوت اختبار mobikul الروبوت","meta_title":"اختبار mobikul الروبوت اختبار mobikul الروبوت","meta_description":"اختبار mobikul الروبوت اختبار mobikul الروبوتtest","meta_keyword":"اختبار mobikul الروبوت اختبار mobikul الروبوت","tag":"اختبار mobikul الروبوت","language_id":"2"}]
Request Type
POST
Description: To set product general tab data.
Return Type: JSON
17.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: wk_token":"37451a69b210909e53a5aaccd3","function":"data","model":"Product 15","sku":"","upc":"","ean":"","jan":"","isbn":"","mpn":"","location":"","prevPrice":"100.0000","price":"100.00","tax_class_id":"9","quantity":"988","minimum":"2","subtract":"1","stock_status_id":"5","shipping":"1","keyword":"test","image":"catalog\/demo\/apple_cinema_30.jpg","date_available":"2009-02-04","length":"1.00000000","width":"2.00000000","height":"3.00000000","length_class_id":"1","weight":"12.50000000","weight_class_id":"1","sort_order":"0"
Request Type: POST
Description: To set product data tab data.
Return Type: JSON
18.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: "wk_token":"37451a69b210909e53a5aaccd3","function":"links","manufacturer":"Apple","manufacturer_id":"8","product_category":["20","28"],"filter":["22","29"],"download":["89","21"],"related":["1098","1898"],"product_related":["40","41"]
Request Type: POST
Description: To set product links tab data.
Return Type: JSON
19.Methods and Parameters
API URL:siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: "wk_token":"37451a69b210909e53a5aaccd3","function":"attribute","product_attribute":[{"name":"Clockspeed","attribute_id":"3","product_attribute_description":{"1":{"text":"100mhz"}}}]
Request Type: POST
Description: To set product attribute tab data.
Return Type: JSON
20.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: "wk_token":"37451a69b210909e53a5aaccd3","function":"options","product_option":[{"product_option_id":"234","name":"File","option_id":"7","type":"file","required":"1","option_value":""},{"product_option_id":"233","name":"Date","option_id":"8","type":"date","required":"1","option_value":"2011-02-20"},{"product_option_id":"232","name":"Text","option_id":"4","type":"text","required":"1","option_value":"test"},{"product_option_id":"231","name":"Radio","option_id":"1","type":"radio","required":"1","product_option_value":[{"option_value_id":"32","product_option_value_id":"28","quantity":"94","subtract":"1","price_prefix":"+","price":"10.00","points_prefix":"+","points":"1","weight_prefix":"+","weight":"10.00000000"},{"option_value_id":"43","product_option_value_id":"27","quantity":"300","subtract":"1","price_prefix":"+","price":"30.00","points_prefix":"+","points":"3","weight_prefix":"+","weight":"30.00000000"},{"option_value_id":"31","product_option_value_id":"26","quantity":"146","subtract":"1","price_prefix":"+","price":"20.00","points_prefix":"-","points":"2","weight_prefix":"+","weight":"20.00000000"}]},{"product_option_id":"230","name":"Textarea","option_id":"6","type":"textarea","required":"1","option_value":""},{"product_option_id":"229","name":"Select","option_id":"5","type":"select","required":"1","product_option_value":{"3":{"option_value_id":"40","product_option_value_id":"25","quantity":"300","subtract":"0","price_prefix":"+","price":"3.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"3.00000000"},"4":{"option_value_id":"42","product_option_value_id":"24","quantity":"200","subtract":"1","price_prefix":"+","price":"2.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"2.00000000"},"5":{"option_value_id":"39","product_option_value_id":"23","quantity":"90","subtract":"1","price_prefix":"+","price":"4.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"4.00000000"},"6":{"option_value_id":"41","product_option_value_id":"22","quantity":"100","subtract":"0","price_prefix":"+","price":"1.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"1.00000000"}}},{"product_option_id":"228","name":"Checkbox","option_id":"2","type":"checkbox","required":"1","product_option_value":{"7":{"option_value_id":"45","product_option_value_id":"21","quantity":"3998","subtract":"1","price_prefix":"+","price":"40.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"40.00000000"},"8":{"option_value_id":"24","product_option_value_id":"20","quantity":"192","subtract":"1","price_prefix":"+","price":"20.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"20.00000000"},"9":{"option_value_id":"44","product_option_value_id":"19","quantity":"2696","subtract":"1","price_prefix":"+","price":"30.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"30.00000000"},"10":{"option_value_id":"23","product_option_value_id":"18","quantity":"46","subtract":"1","price_prefix":"+","price":"10.00","points_prefix":"+","points":"0","weight_prefix":"+","weight":"10.00000000"}}},{"product_option_id":"235","name":"Time","option_id":"9","type":"time","required":"1","option_value":"22:25"},{"product_option_id":"236","name":"Date & Time","option_id":"10","type":"datetime","required":"1","option_value":"2011-02-20 22:25"}]
Request Type:POST
Description: To set product option tab data.
Return Type: JSON
21.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: "wk_token":"37451a69b210909e53a5aaccd3","function":"discount","product_discount":[{"customer_group_id":"1","quantity":"10","priority":"1","price":"88.00","date_start":"2020-06-29","date_end":"2020-06-29"},{"customer_group_id":"1","quantity":"20","priority":"1","price":"77.00","date_start":"2020-06-29","date_end":"2020-06-29"}]
Request Type: POST
Description: Thus, to set product discount tab data.
Return Type: JSON
22.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: “wk_token”:”37451a69b210909e53a5aaccd3″,”function”:”special”,”product_special”:[{“customer_group_id”:”1″,”priority”:”1″,”price”:”90.00″,”date_start”:”2020-06-29″,”date_end”:”2020-06-29″}]
Request Type: POST
Description: To set product special tab data.
Return Type: JSON
23.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/setProductData
Parameters: “wk_token”:”37451a69b210909e53a5aaccd3″,”function”:”images”,”product_image”:[{“image”:”catalog\/demo\/canon_eos_5d_1.jpg”,”sort_order”:”0″},{“image”:”catalog\/demo\/compaq_presario.jpg”,”sort_order”:”0″},{“image”:”catalog\/demo\/hp_1.jpg”,”sort_order”:”0″},{“image”:”catalog\/demo\/canon_logo.jpg”,”sort_order”:”0″},{“image”:”catalog\/demo\/canon_eos_5d_2.jpg”,”sort_order”:”0″}]
Request Type: POST
Description: To set product image tab data.
Return Type: JSON
24.Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/autocomplete
Parameters: “wk_token”:”37451a69b210909e53a5aaccd3″,
“function”:”manufacturer/filter/download/related/attribute/option”
“filter_name”
Request Type: POST
Description: To get product manufacturer/filter/download/related/attribute/option autocomplete list
Return Type: JSON
25.Methods and Parameters
API URL:siteUrl/index.php?route=account/customerpartner/addproduct/getcategories
Parameters: “category_id”
Request Type: GET
Description: So, to get product categories auto-complete list.
Return Type: JSON
26.Methods and Parameters
API URL: siteUrl/index.php?route=account/customerpartner/addproduct/upload
Parameters: wk_token, “wk_token”:”37451a69b210909e53a5aaccd3″,
“file”: multipart request
Request Type: POST
Description: To upload a product image.
Return Type: JSON
27. Methods and Parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/addProduct
Parameters: “wk_token”:”37451a69b210909e53a5aaccd3″,
“product_id”:”23″
Request Type: POST
Description: Thus, to add/ edit seller’s products.
Return Type: JSON
4.Methods and parameters
API URL: siteurl/index.php?route=api/wkrestapi/marketplace/getSellerProfile
Parameters: wk_token, id(seller_id), width(optional), sort(optional), order(optional), page(optional), limit(optional)
Request Type: POST
Params : array()
Description: To get the seller profile details.
Return type: JSON
5.Methods and parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getSellers
Parameters:wk_token, page, limit, width
Request Type: POST
Description: To get all the sellers on Sell Page.
Return type: JSON
6.Methods and parameters
API URL: siteUrl/index.phproute=api/wkrestapi/marketplace2/getLatestProducts
Parameters: wk_token, page, limit
Request Type: POST
Description: Get the Latest Products
Return type: JSON
7.Methods and parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getSellerProducts
Parameters: wk_token, id, path, sort, order, page, limit
Request Type: POST
Description: Get seller products
Return type: JSON
8.Methods and parameters
API URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getreviewFields
Parameters: wk_token
Request Type: POST
Description: Get Review Fields.
Return type: JSON
To Get Seller Profile Details: Marketplace Web Services
The Opencart seller profile looks like as shown in the image below. Thus, the profile of the same seller may be viewed through a mobile app with the help of API Key usage.
So, you can access the API URL: siteurl/index.php?route=api/wkrestapi/marketplace/getSellerProfile to view the seller profile.
Thus, under seller John Doe’s profile information, the user can see different tabs which include-
- “Profile tab”,
- “About Store tab”,
- “Collection tab”,
- “Reviews tab”,
- “Product Reviews tab”,
which displays various information details that the user might want to know about the seller.
So, the ratings and the contact details of the seller may be visible under the seller profile.
Thus, the same information shall be displayed when the same seller’s profile in the OpenCart mobile app.
Thus, the image below displays the profile of seller John Doe. This profile has been displayed through the mobile app using the API key-siteurl/index.php?route=api/wkrestapi/marketplace/getSellerProfile
So, the parameters- wk_token, id(seller_id), width(optional), sort(optional), order(optional), page(optional), limit(optional) are used to trigger the API key to display Seller Profile on the opencart mobile app.
Thus, the users can see that the mobile screen displays the seller, John Doe.
So, the seller’s profile detail is visible to the user.
Under the profile details, the user can see “Average Ratings” for John Doe. Thus, these ratings help the seller to gain goodwill amongst the sellers.
Hence, under “Make a Review”, four tabs are visible which are -“About tab”, “What’s New”, “Review”, “Policies”.
So, the “What’s New” tab is similar to the “Collection tab” of the Opencart Marketplace Seller Panel. The user can simply access the seller panel through the mobile app.
To Get The Seller Dashboard Data: Marketplace Web Services
So, the images below displays the dashboard of a seller. The customer can easily view the details of a seller under his dashboard.
Hence, the same seller profile can be displayed using the API key.
Thus, a specific API key URL- siteurl/index.php?route=api/wkrestapi/marketplace/getDashbordDataRequest.
The Parameters: wk_token is triggered to view the seller dashboard data on an Opencart mobile app.
Seller’s dashboard displays the “Total Orders”, “Total Sales”, “Total Buyers” under the seller profile. The Navigation menu displays the “My Profile”, “Dashboard”, “Order History”, “Transactions”, “Reward Points”, “Recurring Payments”, etc.
The “Order Completed”, “Order Processing” and “Order Canceled” are displayed using meter graphics.

Opencart mobile app
So, the images show the dashboard of a seller which is displayed through the Opencart mobile app.
API key which is used to display the seller dashboard data on the mobile app is siteurl/index.php?route=api/wkrestapi/marketplace/getDashbordDataRequest using the Parameters: wk_token.
The dashboard displays the “Total Orders”, “Total Sales”, “Total Buyers”. Thus, the Sales Statistics tab showing the orders and customer analysis are also visible to the user. The “Your Income Tab”, “World Map”, “Latest Order” tabs are visible at the mobile app page.
So, as it is very difficult to carry the desktop or laptop everywhere, the Opencart mobile app is very useful for the users as they can access the app anytime and anywhere.

To Write Review For The Seller: Marketplace Web Services
The image below displays the Seller John Doe’s Reviews Page. To display the review page for the seller on the Opencart mobile app, the API URL- siteurl/index.php?route=api/wkrestapi/marketplace/writeReview.
Thus, the parameters used for triggering the API to write the review for the seller are -: wk_token, seller_id, name, text, quality_rating, price_rating, value_rating.

Sellers can enable or disable reviews. If the seller does not find any review useful for the product, he can disable the review for the product.
Opencart mobile app
Using the API URL- siteurl/index.php?route=api/wkrestapi/marketplace/writeReview, the review page for any product of the seller can be viewed using the Opencart mobile app. The image below displays the Opencart mobile app displaying the reviews for the seller.
Before the user purchases the product, he may tend to view the reviews as they play an important role in helping the user decide if he should purchase the product or not.
Hence, the parameters that must be triggered to use the API URL key are- wk_token, seller_id, name, text, quality_rating, price_rating, value_rating.


To Get The Seller Product List
The seller will be able to view all the list of products added through the following API (URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/productList).
So, following parameters: wk_token, filter_name, filter_model, filter_price, filter_quantity, filter_status, sort, order, page, limit, the width will be triggered to view the complete details of the product in the seller’s product list on the mobile application.
On the Opencart website the following information like the product name, model, price, quantity, status, sold quantity, earned, and Action is displayed as shown in the image below.

Thus, when the API is implemented in the mobile application, you will be able to view the product name, model, price, quantity, sold, earned, and edit option as shown in the image below.

To Delete Seller’s Product
Further, on implementing the following API (URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/deleteProduct) the seller can delete the products from the mobile application. The parameters used for triggering the API to delete the seller’s products are wk_token and product_id.
With the parameter, wk_token used for accessing the API and Product_id containing the product’s id.
Subsequently, on the Opencart marketplace website, the seller can select the products that are needed to be deleted and select the delete option as shown in the image below.

When the API(URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/deleteProduct) is implemented in the mobile application, the seller will be able to delete the products from the product list as shown in the image below.

To Get the Sellers List
The admin will be able to get complete seller list by implementing the API(URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getSellers) and trigger the following parameters: wk_token, page, limit, width that will be needed to display the seller list on the mobile application.
So, on the marketplace website, the seller will be able to get the seller list on the Sell page as shown in the image below.

Thereafter implementing the API, the complete seller list will be displayed on the mobile application as mentioned in the image below.

To Get Seller Transactions
The sellers will find a complete list of seller transactions by implementing the API-
- URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/getTransactions
Thus, the parameters to display the seller transactions on a mobile app are as follows-
- wk_token, filter_id, filter_details, filter_date, filter_amount, sort, order, page, limit
Hence, for any seller, the list of transactions will be visible as shown in the image below.

Thus, on implementing the API, the seller transaction list will on the mobile application as shown in the image below.

Add/ Edit Seller Review
So, the seller can add or edit reviews in their respective panels by implementing the API-
- URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/editReview
Parameters to add/ edit reviews on a mobile app are as follows-
- wk_token, review_attributes, customer, cust_id, text
Thus, the seller will be able to add or edit any review as shown in the image below.

So, the mobile app view of adding/ editing seller reviews and its listing after implementing the API.
To Add New Product: Seller End
Thus, the seller can even add new products in their respective panels by implementing the API-
- URL: siteUrl/index.php?route=api/wkrestapi/marketplace2/addProduct
Hence, to add a new product on a mobile app, the parameters are given below-
- wk_token:”37451a69b210909e53a5aaccd3, product_id: 23
So, the seller will be able to add a new product as shown in the image below.

Thus, the Add New Product view on the mobile app on implementing the API will be as shown in the image below.
Hence, that’s all for the Opencart Marketplace web services API. If you still face any issue or require OpenCart API development, feel free to add a ticket and let us know your views to make the module better https://webkul.uvdesk.com/en
Current Product Version - 2.0.0.0
Supported Framework Version - 2.0.x.x, 2.1.x.x, 2.2.x.x, 2.3.x.x
With this module is it possible to synchronize the stock of products in the marketplace with an ERP?