How Do I Use The SellerLegend API?
What Is The SL API Used For?
- An API (Application Programming Interface) enables communication between applications.
- SellerLegend's API lets your app connect directly to SellerLegend, allowing you to download SL data for custom use.
Step-by-Step Setup Guide
1. Register Client on SellerLegend
- Go to SellerLegend → Admin → Developers and register your application.
- Click on Create New Client
- This generates a Client ID and Client Secret — credentials required for API access.
WARNING
Guest users cannot register clients or make API calls.
2. Redirect for Authorization
- SellerLegend uses the OAuth 2.0 authorization pattern.
- The consuming application is supposed to request an authorization code from SellerLegend.
- The consuming application should make a redirect request to SellerLegend.
- Redirect users to:
https://app.sellerlegend.com/oauth/authorizeusing your Client ID, secret, and redirect URI.
3. Approving The Request
- When the SL application receives these authorization requests, it automatically displays a template to the user allowing them to approve or deny the authorization request.
- If approved, they'll be redirected to your application's redirect URI (must match what you registered).
4. Converting Authorization Codes To Access Tokens
- Verify that the returned state parameter matches your original request.
- Send a POST request to
/oauth/tokenwith the authorization code. - The request should include the authorization code that was issued by SellerLegend when the user approved the authorization request.
- Response includes:
- access_token (expires in ~15 days)
- refresh_token (expires in ~30 days)
- expires_in (time in seconds before expiry)
WARNING
The auth code is single-use and expires in 10 minutes.
API Endpoint Reference
- API Reference - Complete API reference overview
- OAuth Token Management - Definitive guide to token management
- Sales - Sales endpoints
- COGS - Cost of Goods endpoints
- Inventory - Inventory endpoints
- Connections - Connections endpoints
- Reports - Reports endpoints
- Notifications - Notifications endpoints
- Supply Chain - Supply chain endpoints
- User - User endpoints
- Warehouse - Warehouse endpoints
- Service Status - Service status endpoint
What to Do Next
- Explore all available endpoints in the API Reference
- Install the official SellerLegend Python SDK to simplify integration:bash
pip install sellerlegend-api - Browse usage examples covering basic usage, cost management, and report downloads
- Download the OpenAPI spec or Postman collection for quick testing