How PurpleTree Opencart Multivendor API Works

Purpletree Multivendor provides lots of features with it. Among of them one is API for Purpletree Multivendor data. Just use the API calls to get seller data and use it anywhere on the mobile application or any other usage.

API provided with Opencart multivendor provides mostly all the information which is being used in Purpletree multivendor by the seller. One can easily call the API and get a response with seller data.

Setting up your Opencart store for API is an easy step. Just follow the simple steps as explained below and your store is set up to use Purpletree Multivendor API.

  • Login to Admin Panel.
  • Go to System  > Users > API
  • Create New API.
  • Enter API Username as “purpletreemultivendor”.
  • Generate API Key.
  • Set Status to Enable.
  • In IP Address Tab, enter your IP address. This is just a required field. We are not using this IP Address in calling API  as anyone can access API data only with API Username and API KEY
1 api

2 api
  • Click on the Save button on the top right.
  • Now with each request from mobile. This username as key and API Key as value must be passed in Header request.
  • Send Data in header request as below in each request– Value will be your API Key generated

Example:

Key: purpletreemultivendor

Value: ”knO27Zf3bcX8HSAdUla56g8BMN16zSyPedPVlUIqn5pHULrF3alckyoCPUqatiZM5OsKZED

RRSkS2ElU6gZMdkFq3ord1rylvSf4iLnBCcHK85nbmDgLkUhCReZtH23J2ZRSyL8rV1ec7WGHcN

e6gnJpfsxQD7gBEa6QIxSQpegLyfdfdfdfgdyO6uem7YJ1IrIaCkX67oXz6XxwYkwn4adZDPm7kk8Z

8H4O2m7hboyMKdCo0XG6dBr6PfaQMGNPSQpb”

Important Notes

 

  • This API provides data for customer and seller accounts.

For customer and seller, the API assumes that the Opencart session is available with the seller/customer logged in. Values from Opencart sessions are used to fetch corresponding data wherever required

Url to call API is different in both Opencart 3.x and 2.3.x. So below is the example with parameters to pass and response gets from the API. Please note for all the API calls please refer to API Documentation which is available on purchase of PurpleTree Multivendor for Opencart extension.

Get all sellers API Call Example (Brows sellers) REQUEST URL

<BASE_BASE_URL> - It is the Url for your website for example: https://www.example.com

OPENCART3X:-

<BASE_BASE_URL>/ index.php?route= extension/account/purpletree_multivendor/api/sellers

OPENCART 2X:-

<BASE_BASE_URL>/ index.php?route=account/purpletree_multivendor/api/sellers

HEADER PARAMETERS:

purpletreemultivendor: ”knO27Zf3bcX8HSAdUla56g8BMN16zSyPedPVlUIqn5pHULrF3alckyoCPUqatiZM5OsKZEDRRSk

S2ElU6gZMdkFq3ord1rylvSf4iLnBCcHK85nbmDgLkUhCReZtH23J2ZR

SyL8rV1ec7WGHcNe6gnJpfsxQD7gBEa6QIxSQpegLyfdfdfdfgdyO6ue

m7YJ1IrIaCkX67oXz6XxwYkwn4adZDPm7kk8Z8H4O2m7hboyMKdCo

0XG6dBr6PfaQMGNPSQpb”

PARAMETERS:

GET request:

     Page: 1           (Enter page Number)  

     Limit: 15       (Enter Number of Items)

 

NORMAL RESPONSE:

{
  "data": {
    "sellers": [
   {
  "seller_thumb": "<BASE_URL>/image/cache/placeholder-100x100.png",( Image of seller store.)
  "seller_name": "dsdsds", (Name of Seller)
  "seller_address": "fdsf dfsf1221", (Address of Seller)
  "seller_country": "Argentina",(Country of seller.)
  "seller_id": "15",  (ID of Seller )
 "product_total": "2", (Total Number of products)
  "products": [
          {
            "thumb": "<BASE_URL>/image/cache/catalog/sony_vaio_1-60x60.jpg",
            "product_id": "46"
          },
          {
            "thumb": "<BASE_URL>/image/cache/catalog/sony_vaio_1-60x60.jpg",
            "product_id": "43"
          }
        ]
      },…………
 
    ],
    "sorts": [(Type of Sort Order.)
      {
        "text": "Name (A - Z)",(Text of sort order(A-Z ,  Z-A).)
        "value": "seller-ASC"(Type of Sorts value(ASC ,  DESC))
      },
      {
        "text": "Name (Z - A)",
        "value": "seller-DESC"
      }
    ],
    "limits": [ (How Many Sellers Do You Wants To See On a Single Page).
      {
        "text": "15",  text of limit like (I want to see 15 seller on my page).
        "value": "15"(Value of limits.)
      },…………..
 
    ],
    "pagination": { (No data.)
      "total": 4,
      "page": 1,
      "limit": 20
    },
    "results": "Showing 1 to 4 of 4 (1 Pages)",(Number Of  Pages (Result of Pagination).)
    "sort": "seller",

    "order": "ASC",(Order like ASC or DESC)

    "filter": "",(Filter Data.)
    "limit": 20
  },
  "status": "success"
}
 

ERROR RESPONSE:-

 

status = error (API)

message = Permission Error. Check API credentials

 

status = error (Login)

message = Seller Not Logged In

 

status = error ( Is Seller)

message = Seller Not Approved

 

status = error (License)

message = Invalid License

More details of Purpletree Opencart Multivendor marketplace can be found here.