Marketplace Web Services API For Magento 2 is a multi-vendor Marketplace add-on which exposes the Web Services API of Marketplace module with REST API so that marketplace functions can be used by other application like ERP, Mobile application (iOS, Windows, etc).
Please Note – This module is an add-on to Magento 2 Marketplace Module. To use this module you must have installed Webkul’s Magento 2 Marketplace Module first.
Features
- Standard REST API support found.
- This module exposes several marketplace resources to web API including create/become sellers, get sellers list, invoice, credit memo, cancel seller orders, landing page data and many more.
- Admin and customer level authentication for resources.
- Search criteria for seller list and seller’s order.
- The consumer can authenticate by any of these methods token, oAuth or session.
- JSON format return can be used in mobile and ERP devices including OPENERP. we have built world best Openerp Magento Connector.
- Using this add-on marketplace can be managed very easily from other applications as well.
- Added Graphql implementation feature as per suggested by Magento 2.3.
Installation
Customers will get a zip folder and they have to extract the contents of this zip folder on their system. The extracted folder has an src folder, inside the src folder you have the app folder. You need to transfer this app folder into the Magento2 root directory on the server as shown below.

After the successful installation, you have to run the command on Magento2 root directory-“php bin/magento setup:upgrade”

Now run this command into the Magento2 root – “php bin/magento setup:di:compile”

Also, run this command into the Magento2 Root- “php bin/magento setup:static-content:deploy” You can refer the below screenshot.

After running the commands, you have to flush the cache from Magento2 admin panel by navigating through->System->Cache management as shown below.

How To Use – Rest API
Admin API Calls: needs admin Authorization
Admin has to Integrate admin-level access from the back-end i.e. admin panel.
Note: Click here to know more about how to search using REST API’s.
Example:

Where:
field
is an attribute name.value
specifies the value to search for.condition_type
can be of the type – lt(less than), ltet(less than or equal). For more details check the above link for reference.
1.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers?searchCriteria
Note: Required Search Criteria
Request Type:
GET
Description: This is used to get all seller’s data.
Return Type:
JSON
2.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:id
Request Type:
GET
Description: This is used to get sellers by their id.
Return Type: JSON
.
3.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:id/product
Request Type:
GET
Description: This use to get sellers’ wise products.
Return Type:
JSON
4.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:id/order?searchCriteria
Note: Required Search Criteria
Request Type:
GET
Description: This is used to get the seller’s wise orders.
Return Type:
JSON
5.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:id/order/sales
Request Type:
GET
Description: This use to get sellers with wise sales details.
Return Type:
JSON
6.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:id/paytoseller
Request Type : POST
Params: { seller_pay_reason <string> <reason to pay> entity_id <int> order entity id }
Description: This use to pay the seller his amount after deducting the commission.
Return Type: JSON
6.Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:sellerId/assign
method: POST
post data: { productIds <int> product(s) ids %productIds% }
Description: This use to assign the product(s) to the seller.
Return Type: JSON
8. Methods & Parameters
magentohost*1/rest/V1/mpapi/admin/sellers/:sellerId/unassign
method: POST
post data: productIds <int> product(s) ids %productIds%
}
Description: This is used to unassign the product(s) to the seller.
Return Type: JSON
Seller API Calls: needs customer Authorization
1.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me
Request Type: GET
Description: This is used to get self profile details.
Return Type: JSON
2.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/product
Request Type: GET
Description: This use to get self product details.
Return Type: JSON
3.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order?searchCriteria
Note: Required Search Criteria
Request Type: GET
Description: This use to get self-order details.
Return Type: JSON
4.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/sales
Request Type: GET
Description: This is used to get self order sales details.
Return Type: JSON
5.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/:orderId/invoice
Request Type: POST
Description:This is used to create invoice for seller order.
Return Type: JSON
6.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/:orderId/invoice/:invoiceId
Request Type: GET
Description: This is used to get invoice data.
Return Type: JSON
7.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/:orderId/cancel
Request Type : POST
Description: This is used to cancel the order.
Return Type: JSON
8.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/:orderId/invoice/:invoiceId/creditmemo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
<!-- wp:paragraph --> <p><strong>Params:</strong> {</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>creditmemo <array> credit memo fields</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>example: array(</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>creditmemo => array(</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>items => array(</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>%itemIds1%=> array(qty => %itemQty1%),</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>%itemIds2%=>array(qty=>%itemQty2%...)</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>...),</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>shipping_amount => %shipping_amount%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>adjustment_positive => %adjustment_positive%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>adjustment_negative => %adjustment_negative%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>do_offline => %do_offline%</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>)</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>)</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><code>}</code></p> <!-- /wp:paragraph --> |
Request Type : POST
Description: This is used to create a credit memo for the seller order.
Return Type: JSON
9.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/:orderId/creditmemo/:creditmemoId
Request Type: GET
Description: This is used to get credit memo details.
Return Type: JSON
10. Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/mailtoadmin
Request Type : POST
Params: query <string> message %query%, subject <string> message subject %subject%)}
Description: This is used to ask questions to admin.
Return Type: JSON
11. Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/mailtoseller
Request Type : POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Param: <!-- wp:paragraph --> <p>Params: {customer_email <string> valid email %customer_email%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>customer_name <string> customer name %customer_name%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>product_id <int> product (optional) %product_id%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>query <string> message %query%,</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>subject <string> message subject %subject%</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>)</p> <!-- /wp:paragraph --> |
}
Description: This use to contact seller.
Return Type: JSON
12.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/becomepartner
Request Type : POST
Params: {shop_url <string> store identifier %shop_url%,is_seller <int> 1 if want to be seller else 0 %is_seller%)}
Description: This use to request to become a partner.
Return Type: JSON
13.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/me/order/:orderId/ship
Method: POST
Post data: {tracking_number <string> tracking number of the shipment %tracking_number%, carrier <string> name of the shipiing carrier %carrier%)}
Description: This use to request to create a shipment.
Return Type: JSON
Guest User Accessible resources: no Authorization needed
1.Methods & Parameters
magentohost*1/rest/V1/mpapi/marketplace
Request Type: GET
Description: This returns Marketplace Landing Page details.
Return Type: JSON
2.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers?searchCriteria
Note: Required Search Criteria
Request Type: POST
Description: This is used to get all sellers list.
Return Type: JSON
3.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/:id/reviews
Request Type : GET
Description: This use to get reviews of the seller.
Return Type: JSON
4.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/:id/reviews
method: POST
post data: {
feed_price <int> ratings on price
feed_quality <int> ratings on quality
feed_value <int> ratings on value
feed_nickname <string> reviewer nick name
feed_summary <string> review summary
feed_review <string> review
buyer_emai <string> valid buyer email
buyer_id <int> buyer id}
Note: The value of feed_price, feed_quality and feed_value is anyone from 20, 40, 60, 80 and 100
20 – 1 star
40 – 2 star
60 – 3 star
80 – 4 star
100 – 5 star
Description: This is used to make seller review.
Return Type: JSON
5.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/:review_id/review
Request Type : GET
Description: This is used to get review details by review id.
Return Type: JSON
5.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/:review_id/review
Request Type : GET
Description: This is used to get review details by review id.
Return Type: JSON
6.Methods & Parameters
magentohost*1/rest/V1/mpapi/sellers/create
method: POST
post data:{
“customer”:{
“email” <string> seller email,
“firstname” <string> seller firstname,
“lastname” <string> seller lastname,
“storeId” <int> store Id,
“websiteId” <int> website Id
},
“is_seller” <int> 1 for customer aggreed to become seller,
“profileurl” <string> shop url of seller,
“password” <string> password for seller profile,
“registered” <int> 0/1 0->new registration 1->already registered now becoming seller
}
Description: This is used to create a seller.
Return Type: JSON
Note: *1 = magento host base url
1.Methods & Parameters
query {
marketplaceLangingPage}
Description: This returns the Marketplace Landing Page details.
Return Type: JSON
2.Methods & Parameters
query {
sellersList(
filter:{
entity_id:{
eq: "1"
}
}
)
}
Description: This is used to get all sellers list.
Return Type: JSON
3.Methods & Parameters
query {
getSellerReview(id:1 <Seller Id>)}
Description: This is used to get reviews of the seller.
Return Type: JSON
4.Methods & Parameters
query {
getSellerReviewDetails(id:1<review id>)}
Description: This is used to get review details by review Id.
Return Type: JSON
Note: *1 = magento host base url
Graphql Implementation
Graphql is a traditional way to expose the data in a more declarative format, basically it is a query language for the API and it has an only single API endpoint that will serve all your data request needs, however, you have to pre-explained all the data that the server can present in a GraphQL schema.
In additional Graphql allows the client to simplify what exactly data structure they want from the server and helps to resolve the over-fetching or under-fetching of data.
Graphql introduced in Magento 2.3.0 having Hierarchical, Introspective nature that gives explanatory error information before executing a query.
How to Use – Graphql
To add Graphql implementation in Marketplace Web Services API For Magento 2 have to follow below steps
Step 1 – A client may get your GraphQL query response by installing chrome extension ChromeiQL.
Note – In order to get more information about GraphQl implementation in Magento2 refer this link or you may read previous blog How to use GraphQL in php.
Step 2 – To manage all predefined or custom GraphQL queries in Marketplace Web Services API For Magento 2 you have to set endpoint.
API Resource : magentohost*1/graphql
Step 3 -Once you have set endpoint you will get all Preset API list under docs->> document explorer->>query section (from the right side of the ChromeiQL extension)
Step 4 – To access the specific data you need to type queries into left side of the screen, let’s consider an example for marketplaceLangingPage:
After entering the query you have to hit the “play” button then you will see it returns accurate query of of the marketpalce landing page, you could look given screenshot for further reference.
Now you will get back exactly structured API data and descriptive error message which you wish to display, nothing more and nothing less in form of type and field.
Guest User Accessible resources: no authorization needed
1.Methods & Parameters
query {
marketplaceLangingPage}
Description: This returns the Marketplace Landing Page details.
Return Type: JSON
2.Methods & Parameters
query {
sellersList(
filter:{
entity_id:{
eq: "1"
}
}
)
}
Description: This is used to get all sellers list.
Return Type: JSON
3.Methods & Parameters
query {
getSellerReview(id:1 <Seller Id>) }
Description: This is used to get reviews of the seller.
Return Type: JSON
4.Methods & Parameters
query {
getSellerReviewDetails(id:1<review id>) }
Description: This is used to get review details by review Id.
Return Type: JSON
Seller API Calls: needs customer Authorization
API resource: magentohost*1/graphql
1.Methods & Parameters
query
{
sellerSelf}
Description: This is used to get self profile details.
Return Type: JSON
2.Methods & Parameters
query
{
sellerSelfProduct}
Description: This returns the Marketplace Landing Page details.
Return Type: JSON
3.Methods & Parameters
query
{
sellerOrderList(filter:{
entity_id:{
eq: "1"}})}
Description: This is used to get self-order details.
Return Type: JSON
4.Methods & Parameters
query
{
sellerOrderSales}
Description: This is used to get self-order sales details.
Return Type: JSON
5.Methods & Parameters
query
{
sellerCreateInvoice(orderid:<Int>)}
Description: This is used to create an invoice for the seller order.
Return Type: JSON
6.Methods & Parameters
query
{
sellerGetInvoiceDetails(orderid:<Int>, invoiceid:<Int>)}
Description: This is used to get invoice data.
Return Type: JSON
7.Methods & Parameters
query
{
seller sellerCancelOrder(orderid:<Int>)}
Description: This is used to cancel the order.
Return Type: JSON
8.Methods & Parameters
query
{
sellerCreateCreditmemo(orderid:<Int> , invoiceid:<Int>, creditmemo:{
shipping_amount:<Int>
adjustment_positive:<Int>
adjustment_negative:<Int>
do_offline: <Int>
items: {
itemid:<Int>
qty:<Int>
}})
}
Description: This use to create a credit memo for the seller order.
Return Type: JSON
9.Methods & Parameters
query
{
sellerCreateCreditmemo(orderid: <Int>, creditmemoid: <Int>)}
Description: This use to get credit memo details.
Return Type: JSON
10.Methods & Parameters
query
{
sellerMailToAdmin(query:<String>, subject:<string>)}
Description: This use to ask questions to admin.
Return Type: JSON
11.Methods & Parameters
1 2 3 4 5 6 7 |
query { sellerMailToSeller(customer_name:<String>, customer_email: <String>, query: <String>, subject: <String>) } |
Description: This use to contact the seller.
Return Type:JSON
12.Methods & Parameters
1 2 3 4 5 6 |
query { sellerBecomePartner(shop_url: <<a>String>, </a>is_seller: <<a>Int></a>) } |
Description: This use to request to become a partner.
Return Type:JSON
13.Methods & Parameters
1 2 3 4 5 |
query { sellerCreateShipment( orderid: <<a>Int></a> tracking_number: <<a>String></a> carrier: <<a>String></a>) } |
Description: This uses to request to create a shipment.
Return Type: JSON
For more information about Magento Web APIs you can check http://devdocs.magento.com/guides/v2.0/get-started/bk-get-started-api.html
Admin Management – Access To Admin Level Resources
Admin has to go to System > Integration > Add New Integration. Here admin can add new integration.
Here admin has to fill up all the information such as name, email, Callback URL and Identity link URL.
Then admin has to select the resources which he wants to give access to the new admin member. Admin can select all the resources or can choose some particular resources which the admin wants to give access to the new admin member.
That’s all for Marketplace Web Services API For Magento 2, if you still have any issue feel free to add a ticket and let us know your views to make the module bet
Current Product Version - 2.1.0
Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x
17 comments
This is an addon for performing mp actions through API from the other website/app. To specify the APIs can be used for- ERP, Mobile application (iOS, Windows, etc).
Thanks and Regards.
Can you please share the snapshot of the same. So that we can look into it.
Further, you can email your query at support@webkul.com so that we can assist you better. Thanks
No, currently this is not possible with the help of this module. If you want the same then you can contact us at support@webkul.com.
In Marketplace, there is nothing like real sellers. Either they are sellers or not. So when API is called for seller information then the information of all the sellers is returned. For more information, you can email us at support@webkul.com. Thanks.
The seller login account API is not available in this module. If you want the same then we can develop it through customization.
Kindly email your requirements at support@webkul.com for better assistance. Thank You
Please contact us at support@webkul.com if you are looking for the API of a feature that is currently not available.
Thanks
I can create a seller, but i cant edit ?
it does not make any sense, would you have any sugestion to edit a seller info like “company_description” ?
In the current module, the seller account registration API is not included. And you can not edit details of a seller as well. Please contact us at support@webkul.com to assist you better.
Thanks
Thanks for the recommendation. We will forward the same to the concerned team. The respective team will proceed further accordingly.
Thanks