Differences in Seller Login API Routes for Purpletree Multivendor in OpenCart 3.x vs 4.x

When working with the Purpletree Multivendor API in OpenCart, it’s essential to understand how the API route structure changes between versions 3.x and 4.x. These differences can affect how developers implement the seller login process and other multivendor-related API functionalities.

Understanding the API Scope

The Purpletree Multivendor API primarily provides functions for customer and seller accounts, and not for admin-level access. While this API doesn’t cover all the extension’s features, it handles basic functionality, including seller login, which is necessary for other seller APIs to work.

One key point is that most seller-related APIs require the seller to log in first. After successful login, the seller session remains active until the session times out, enabling subsequent API calls to function without interruption. However, the URL for accessing the seller login API has changed between OpenCart versions 3.x and 4.x, which needs to be noted.

Seller Login API Route in OpenCart 3.x

In OpenCart 3.x, the URL structure for the seller login API follows this format:

/index.php?route=extension/account/purpletree_multivendor/api/sellerlogin
 

Here’s a breakdown of the URL components:

  • extension/account/purpletree_multivendor/api/sellerlogin: The path includes account, followed by purpletree_multivendor and the API endpoint for seller login.

This route structure is essential when working with OpenCart 3.x installations.

Seller Login API Route in OpenCart 4.x

In OpenCart 4.x, the URL structure has been streamlined, as follows:

 

/index.php?route=extension/purpletree_multivendor/multivendor/api/sellerlogin

 

Notable changes in the URL components:

  • The account part of the path has been removed.
  • The path is now purpletree_multivendor/multivendor, simplifying the route for API calls.

Key Differences Between OpenCart 3.x and 4.x API Routes

  • OpenCart 3.x: The URL structure includes the path account/purpletree_multivendor, making the route slightly longer and more specific.
  • OpenCart 4.x: The account part is dropped, and the route is simplified to purpletree_multivendor/multivendor.

Summary

While the functionality of the Purpletree Multivendor API remains the same between OpenCart 3.x and 4.x, the URL structure has been simplified in OpenCart 4.x. The removal of the account path reflects a more concise route format, making API calls slightly easier to manage.

For developers working with both versions of OpenCart, understanding these differences ensures smoother implementation of seller login and other API functionalities, helping maintain compatibility across both platforms.

By adjusting the URLs according to the OpenCart version in use, you can ensure that your multivendor APIs function seamlessly without encountering route issues.