Skip to content

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/authorize using 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/token with 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 ​

What to Do Next ​