Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    Marketplace Web Services API For Magento 2

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

    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 is used 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 is used 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 is used 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 is used 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 is used 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 is used 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

    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

    }

    Description: This is used 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 is used 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 is used 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 is used 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 is used to create a credit memo for the seller order.

    Return Type: JSON

    9.Methods & Parameters

    query
    {
    sellerCreateCreditmemo(orderid: <Int>, creditmemoid: <Int>)}

    Description: This is used to get credit memo details.

    Return Type: JSON

    10.Methods & Parameters

    query
    {
    sellerMailToAdmin(query:<String>, subject:<string>)}

    Description: This is used to ask questions to admin.

    Return Type: JSON

    11.Methods & Parameters

    Description: This is used to contact the seller.

    Return Type:JSON

    12.Methods & Parameters

    Description: This is used to request to become a partner.

    Return Type:JSON

    13.Methods & Parameters

    Description: This is used 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

    . . .

    Comments (17)

    Add Your Comment

  • vrushank
    what is this addon used for can you give some example to understand more
    • Zeba Hakim
      Hello There,
      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.

  • Yongqi Sun
    Is it possible to create products or change attributes by a seller?
    • Subhangi
      Hello,
      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.
  • Ajith
    I can find duplicate seller profiles in marketplace. And this api sends all the seller profiles. So, how can I identify which are the real profiles ?
    • Rajat Singh
      Hi Ajith,
      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.
  • Lomesh
    Where is seller login account API..?
    • Subhangi
      Hello Lomesh,
      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
  • Peter s
    where is seller account registration API
    • Suraj Kumar
      Hi Peter, seller account registration API is not included in this module. Further, we can customize the same. Please email your requirements at support@webkul.com so that we can assist you better. Thanks
      • Aman
        Well this is weird, this entire module is dedicated API package for for multi vendor marketplace module. Still you guys haven’t provided all the endpoints for the modules present in it. At lest we need exact same data on API that the module is providing on the web.
        • Suraj Kumar
          Hello There,

          Please contact us at support@webkul.com if you are looking for the API of a feature that is currently not available.

          Thanks

          • Lucas
            Hi
            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” ?
          • Suraj Kumar
            Hello There,

            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

          • Aman
            Suraj, many features are available but the documentations is not as user friendly. In any API documentation. There must be 1 example with request and response data in JSON format for all the endpoints. I’ve bought it, so I know the support guy will help me. But it would save a lot of time on both end if we had that.
          • Suraj Kumar
            Hello There,

            Thanks for the recommendation. We will forward the same to the concerned team. The respective team will proceed further accordingly.

            Thanks

  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close