- Views: 4
- Report Article
- Articles
- Business & Careers
- Business Opportunities
How API for Multivendor Data Works on PurpleTree Opencart Multivendor
Posted: May 20, 2019
Purpletree Opencart Multivendor provides lots of features with it. Among 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 Extension 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.
- Log in to Admin Panel.
- Go to System> Users> API
- Create a New API.
- Enter API Username as "purpletreemultivendor".
- Generate API Key.
- Set Status to Enable.
- In the 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
- Click on the Save button on the top right.
- Now with each request from mobile. This username as key and API Key as the 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: "knO27Zf3bcX8HSAdUla56g8BMN16zSyPedPVlUIqn5pHULrF3alckyoCPUqatiZM5OsKZEDRRSkS2ElU6gZMdkFq3ord1rylvSf4iLnBCcHK85nbmDgLkUhCReZtH23J2ZRSyL8rV1ec7WGHcNe6gnJpfsxQD7gBEa6QIxSQpegLyfdfdfdfgdyO6uem7YJ1IrIaCkX67oXz6XxwYkwn4adZDPm7kk8Z8H4O2m7hboyMKdCo0XG6dBr6PfaQMGNPSQpb"
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:- It is the Url for your website for example: https://www.example.com
OPENCART3X:-
/ index.php?route= extension/account/purpletree_multivendor/api/sellers
OPENCART 2X:-
/ index.php?route=account/purpletree_multivendor/api/sellers
HEADER PARAMETERS:
purpletreemultivendor: "knO27Zf3bcX8HSAdUla56g8BMN16zSyPedPVlUIqn5pHULrF3alckyoCPUqatiZM5OsKZEDRRSkS2ElU6gZMdkFq3ord1rylvSf4iLnBCcHK85nbmDgLkUhCReZtH23J2ZRSyL8rV1ec7WGHcNe6gnJpfsxQD7gBEa6QIxSQpegLyfdfdfdfgdyO6uem7YJ1IrIaCkX67oXz6XxwYkwn4adZDPm7kk8Z8H4O2m7hboyMKdCo0XG6dBr6PfaQMGNPSQpb"
PARAMETERS:
GET request:
Page: 1 (Enter page Number)
Limit: 15 (Enter Number of Items)
NORMAL RESPONSE:
{ "data": { "sellers": [ { "seller_thumb": "/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": "/image/cache/catalog/sony_vaio_1-60x60.jpg", "product_id": "46" }, { "thumb": "/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
Contact
PurpleTree Software LLP
D-242, Sector 63,
Noida, India-201307
Call Us:+91-120-4123-135
Website: www.purpletreesoftware.com
Email: contact@purpletreesoftware.com
Connect With us: Linkedin | Twitter |Facebook
VynZ Research is a market research firm offering research, analytics, and consulting services on business strategies. The company focuses on providing valuable insights on various technology verticals.