Skip to main content

Authentication

Initiate Authorization

GET /auth/tiktok
Initiate TikTok Shop authorization flow

Parameters

userId
string
required
The ID of the user

Response

Redirects to TikTok auth page or error page with the following URL structure:
https://auth.tiktok-shop.com/oauth/authorize?app_key=YOUR_APP_KEY&state=USER_ID_RANDOM_STRING

Authorization Callback

GET /tiktok/callback
Callback endpoint for TikTok Shop authorization

Parameters

code
string
required
Authorization code from TikTok
state
string
required
State parameter containing userId and random string for security verification
error
string
Optional error message from TikTok if authorization fails

Response

Redirects to one of:
  • Success page: /auth/success?platform=tiktok
  • Error page: /auth/error?platform=tiktok&error=ERROR_MESSAGE

Refresh Token

POST /auth/tiktok/refresh
Refresh TikTok Shop access token

Parameters

userId
string
required
The ID of the user

Response

message
string
Success or error message
expiresAt
string
New token expiration timestamp
{
  "message": "Token refreshed successfully",
  "expiresAt": "2024-04-14T12:00:00Z"
}

Shop Operations

Get Shop Info

GET /tiktok/shop-info
Get TikTok Shop information

Parameters

userId
string
required
The ID of the user

Response

shopId
string
TikTok Shop ID
region
string
Shop region code
status
string
Shop status (active/inactive)
{
  "shopId": "shop123",
  "region": "US",
  "status": "active",
  "name": "My TikTok Shop",
  "createdAt": "2024-01-01T00:00:00Z"
}

Search Creators

Search for TikTok creators

Parameters

userId
string
required
The ID of the user
page_token
string
Token for pagination

Response

creators
array
List of creator profiles
next_page_token
string
Token for the next page of results
{
  "creators": [
    {
      "id": "creator123",
      "username": "@creator",
      "followers": 100000,
      "engagement_rate": 0.05,
      "region": "US"
    }
  ],
  "next_page_token": "token123"
}
POST /tiktok/creator/search
Advanced search for TikTok creators with filters

Parameters

userId
string
required
The ID of the user
page_token
string
Token for pagination

Request Body

{
  "filters": {
    "minFollowers": 10000,
    "maxFollowers": 1000000,
    "minEngagementRate": 0.02,
    "regions": ["US", "CA"],
    "categories": ["fashion", "beauty"]
  }
}

Response

creators
array
List of filtered creator profiles
next_page_token
string
Token for the next page of results
{
  "creators": [
    {
      "id": "creator123",
      "username": "@creator",
      "followers": 100000,
      "engagement_rate": 0.05,
      "region": "US",
      "categories": ["fashion"]
    }
  ],
  "next_page_token": "token123"
}