SDKs overview

The Shopee Open Platform provides a suite of APIs designed to allow sellers and partners to integrate their systems with Shopee's e-commerce ecosystem. These APIs facilitate programmatic access to functionalities such as product listing, order management, logistics tracking, and shop administration. Unlike some platforms that offer official Software Development Kits (SDKs) to abstract API interactions, Shopee's approach requires developers to interact directly with its RESTful API endpoints using standard HTTP clients. This means developers must implement the logic for authentication, request construction, response parsing, and error handling themselves.

Direct API integration, while requiring more initial development effort, offers several advantages. It provides maximum flexibility, allowing developers to use any programming language or framework that supports HTTP requests. It also ensures that integrations are always compatible with the latest API specifications without waiting for an SDK update. However, it places the responsibility on the developer to manage API versioning, signature generation, and rate limiting according to the Shopee Open Platform API documentation.

Developers commonly utilize general-purpose HTTP client libraries available in their chosen programming language. For instance, Python developers might use requests, Java developers OkHttp or Apache HttpClient, and Node.js developers axios or the built-in fetch API. These libraries streamline the process of making HTTP requests but do not provide Shopee-specific abstractions for API endpoints or data models.

Official SDKs by language

As of 2026, Shopee does not officially provide SDKs for its Open Platform APIs. The platform's documentation emphasizes direct integration via its RESTful API endpoints. This means there are no official client libraries maintained by Shopee in languages like Python, Java, Node.js, PHP, or Go. Developers are expected to build their API clients from scratch, adhering to the specified request formats and authentication mechanisms outlined in the official documentation.

The absence of official SDKs means that developers must implement the entire API interaction layer, including:

  • Authentication: Implementing the OAuth 2.0 flow to obtain and refresh access tokens, as described in Shopee's authentication guide.
  • Request Signing: Generating the necessary API signatures for each request, which typically involves hashing request parameters with a secret key.
  • HTTP Requests: Constructing HTTP GET, POST, PUT, and DELETE requests with appropriate headers and body payloads.
  • Response Parsing: Deserializing JSON responses into usable data structures.
  • Error Handling: Interpreting API error codes and messages to manage failures gracefully.
  • Rate Limiting: Implementing logic to respect Shopee's API rate limits to prevent service interruptions.

The table below, therefore, reflects the absence of official SDKs:

Language Package/Library Install Command Maturity
Python None (use requests) pip install requests N/A (direct API)
Java None (use OkHttp/HttpClient) (Add dependency via Maven/Gradle) N/A (direct API)
Node.js None (use axios/node-fetch) npm install axios N/A (direct API)
PHP None (use GuzzleHttp/guzzle) composer require guzzlehttp/guzzle N/A (direct API)
Go None (use net/http) (Built-in) N/A (direct API)

Installation

Since Shopee does not provide official SDKs, installation primarily involves setting up a suitable HTTP client library for your chosen programming language. The specific installation steps depend on the language and package manager used.

Python (using requests)

The requests library is a popular choice for making HTTP requests in Python due to its user-friendly API. To install it:

pip install requests

Java (using OkHttp)

OkHttp is a modern, efficient HTTP client for Java and Android. If you are using Maven, add the following to your pom.xml:

<dependency>
    <groupId>com.squareup.okhttp3</groupId>
    <artifactId>okhttp</artifactId>
    <version>4.12.0</version> <!-- Use the latest version -->
</dependency>

For Gradle, add to your build.gradle:

implementation 'com.squareup.okhttp3:okhttp:4.12.0' <!-- Use the latest version -->

Node.js (using axios)

axios is a promise-based HTTP client for the browser and Node.js. Install it via npm:

npm install axios

PHP (using GuzzleHttp/guzzle)

Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Install it via Composer:

composer require guzzlehttp/guzzle

Go (using built-in net/http)

Go's standard library includes a robust net/http package for making HTTP requests, requiring no external installation:

import (
    "net/http"
    "io/ioutil"
)

func main() {
    // HTTP client example
}

Quickstart example

This quickstart example demonstrates how to make a simple API call to the Shopee Open Platform using Python's requests library. This example focuses on fetching shop information, assuming you have already completed the OAuth 2.0 authorization flow and possess a valid access_token, partner_id, partner_key, and shop_id. For detailed authentication steps, refer to the Shopee Open Platform authentication guide.

The Shopee API requires each request to be signed with a unique signature, generated using an HMAC-SHA256 algorithm. This signature ensures the integrity and authenticity of the request. The signature calculation typically involves concatenating the API endpoint path, access token, partner ID, timestamp, and shop ID, then hashing the result with the partner key.

import requests
import time
import hmac
import hashlib
import json

# --- Configuration --- General notes: Replace placeholders with your actual credentials.
PARTNER_ID = 1234567 # Replace with your Partner ID
PARTNER_KEY = "your_partner_key" # Replace with your Partner Key
SHOP_ID = 7654321 # Replace with your Shop ID
ACCESS_TOKEN = "your_access_token" # Replace with your obtained access token

BASE_URL = "https://partner.shopeemobile.com" # Base URL for API requests
API_PATH = "/api/v2/shop/get_shop_info" # Specific API endpoint

# --- Signature Generation Function ---
def generate_signature(api_path, access_token, partner_id, shop_id, timestamp, partner_key):
    base_string = f"{api_path}|{access_token}|{partner_id}|{shop_id}|{timestamp}"
    # For endpoints that do not require an access_token or shop_id, adjust the base_string accordingly.
    # Refer to Shopee's API documentation for specific signature requirements for each API.
    
    h = hmac.new(partner_key.encode('utf-8'), base_string.encode('utf-8'), hashlib.sha256)
    return h.hexdigest()

# --- Main API Call Logic ---
def get_shop_info():
    timestamp = int(time.time())
    
    # Generate the signature
    signature = generate_signature(API_PATH, ACCESS_TOKEN, PARTNER_ID, SHOP_ID, timestamp, PARTNER_KEY)

    # Construct request headers
    headers = {
        "Content-Type": "application/json"
    }

    # Construct request parameters
    params = {
        "partner_id": PARTNER_ID,
        "shop_id": SHOP_ID,
        "timestamp": timestamp,
        "access_token": ACCESS_TOKEN,
        "sign": signature
    }

    # Make the GET request
    try:
        response = requests.get(f"{BASE_URL}{API_PATH}", params=params, headers=headers)
        response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
        
        shop_info = response.json()
        print("Shop Info:", json.dumps(shop_info, indent=2))

    except requests.exceptions.HTTPError as http_err:
        print(f"HTTP error occurred: {http_err}")  # Python 3.6+
        print("Response content:", response.text)
    except requests.exceptions.RequestException as req_err:
        print(f"Request error occurred: {req_err}")
    except Exception as e:
        print(f"An unexpected error occurred: {e}")

if __name__ == "__main__":
    get_shop_info()

This example demonstrates the fundamental steps: setting up configurations, generating a request signature, constructing headers and parameters, and sending an HTTP GET request. For more complex operations like product uploads (which often involve POST requests with JSON bodies), the structure would be similar, but the request body and signature generation might differ. Always consult the official Shopee API documentation for the specific requirements of each endpoint.

Community libraries

Given the absence of official SDKs from Shopee, the developer community has created various unofficial libraries and wrappers to simplify interactions with the Shopee Open Platform API. These community-contributed tools are typically found on platforms like GitHub and may vary widely in terms of language support, features, documentation quality, and maintenance status. Developers considering using a community library should perform due diligence:

  • Maturity and Maintenance: Check the project's activity (last commit, issue tracker, pull requests) to assess if it's actively maintained.
  • Completeness: Verify if the library covers the specific API endpoints and functionalities required for your integration. Some libraries might only implement a subset of the Shopee API.
  • Documentation: Good documentation, including installation instructions, usage examples, and API coverage, is crucial for effective use.
  • Security: Review the code for any potential security vulnerabilities, especially concerning how API keys and tokens are handled.
  • Licensing: Understand the licensing terms of the library.

Examples of common languages for which community libraries might exist include Python, JavaScript/Node.js, and PHP. These libraries often aim to abstract away the signature generation, token management, and HTTP request details, providing a more object-oriented or function-based interface for interacting with the Shopee API. For instance, a community Python library might offer a class with methods like shopee_client.get_orders() or shopee_client.upload_product(), simplifying the underlying HTTP requests and signature logic.

While specific community libraries are not endorsed by Shopee, they can be valuable resources for accelerating development. Developers can search GitHub or other package repositories (e.g., PyPI for Python, npm for Node.js, Packagist for PHP) using terms like "Shopee API" or "Shopee Open Platform" to discover available options. When evaluating such libraries, it's also beneficial to cross-reference their implementation against the official Shopee API specifications to ensure accuracy and compliance.

For example, a developer might find community-maintained repositories that offer wrappers for Shopee's API in Python. These often handle the complex signature generation and OAuth processes, which are critical for secure API interactions, as detailed in the OAuth 2.0 specification. However, the reliability and up-to-dateness of these wrappers are solely dependent on their maintainers. Developers should always be prepared to debug and potentially extend community libraries if they encounter issues or require functionalities not yet implemented.