Skip to content

API Documentation and Python SDK Release ​

September 19, 2025

Overview ​

We're excited to announce the release of our comprehensive API documentation and official Python SDK, making it easier to integrate SellerLegend into your workflows and build automation tools.

What's New ​

Comprehensive API Documentation ​

Our new API documentation is now available at dashboard.sellerlegend.com/api-docs, featuring:

  • Complete endpoint reference for all API resources
  • Interactive examples with request/response samples
  • Authentication guides covering OAuth 2.0 Authorization Code flow
  • Error handling documentation with status codes and messages

Official Python SDK ​

In addition to our PHP SDK, we've now released our official Python SDK to simplify API integration:

  • Full API coverage -- Access all SellerLegend API endpoints
  • Type hints -- Full typing support for better IDE integration
  • Built-in retry logic -- HTTP retry mechanisms for network resilience
  • Comprehensive error handling -- Detailed exception classes for different error scenarios
  • Token management helpers -- Methods to check token validity and handle refresh

Installation

bash
pip install sellerlegend-api

Quick Start

python
from sellerlegend_api import SellerLegendClient

# Initialize the client with existing tokens
client = SellerLegendClient(
    client_id="your_client_id",
    client_secret="your_client_secret",
    base_url="https://app.sellerlegend.com",
    access_token="your_access_token",    # Optional: if you have existing tokens
    refresh_token="your_refresh_token"   # Optional: if you have existing tokens
)

# Or use OAuth 2.0 Authorization Code flow
auth_url, state = client.get_authorization_url()
# Redirect user to auth_url...
# After user authorizes and you get the code:
token_info = client.authenticate_with_code(code, state)

# Check if token needs refresh
if not client.is_authenticated():
    new_tokens = client.refresh_token()

# Get user information
user = client.user.get_me()

# Fetch orders
orders = client.sales.get_orders(per_page=100)

# Generate reports
report = client.reports.request_report(
    report_type="inventory",
    start_date="2025-09-01",
    end_date="2025-09-19"
)

API Resources ​

The SellerLegend API provides programmatic access to:

  • Sales & Orders -- Retrieve order data, statistics, and transactions
  • Inventory Management -- Track inventory levels and movements
  • Cost Analysis -- Access COGS data and cost periods
  • Reports -- Generate and download custom reports
  • Connections -- Manage marketplace connections
  • Warehouse Operations -- Handle inbound shipments and warehouse data
  • Supply Chain -- Get restock suggestions and supply chain insights
  • Notifications -- Access system notifications

Authentication ​

The API uses OAuth 2.0 for authentication:

  • Authorization Code Grant -- For user-authorized applications where users grant permission to access their SellerLegend account
  • Refresh Token Flow -- For maintaining long-lived sessions

To get started:

  1. Register your application to receive OAuth client credentials
  2. Direct users to the authorization URL
  3. Exchange the authorization code for access and refresh tokens
  4. Store the tokens securely and refresh when needed

Getting Started ​

  1. Get API Credentials: Contact support to obtain your OAuth client credentials
  2. Review Documentation: Visit dashboard.sellerlegend.com/api-docs
  3. Install SDK: pip install sellerlegend-api
  4. Start Building: Use the SDK to integrate SellerLegend into your applications

Support ​

For API support and questions: