来自 TikTok Shop 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§2 This guide is intended for
This guide is intended for
- apps that need to call Affiliate Creator APIs
- integrations that need creator-side affiliate data or capabilities
§4 Core concept
Core concept
Creator authorization means:a creator grants your TikTok Shop app access to creator-side data and capabilities, so that your app can call the relevant Creator Open APIs. At its core, the flow is still OAuth-based:
- Build an authorization link
- Let the user log in and approve authorization
- Receive a callback with
code - Exchange the
codefor tokens - Use the token to call Creator APIs
Creator authorization is different from Seller authorization. A creator token and a seller token are different credentials and must not be reused interchangeably.
§5 Prerequisites
Prerequisites
Before starting Creator authorization, make sure the following are ready:
§6 App-side prerequisites
App-side prerequisites
- the app is created
- API access is enabled
- a valid Redirect URL is configured
- the required creator scopes are enabled or approved
- if the creator capability is still beta / allowlist based, the app is approved for that rollout
§7 Creator-side prerequisites
Creator-side prerequisites
the user is a real TikTok Shop creator, not just a regular TikTok account. The creator can enroll as a TikTok Shop creator by following the guides for the respective countries:
The creator's selection region must be one of the app's target markets:
Image
If your app is in development, please contact your App Store Manager for a Creator testing account. Creator test accounts are only available to members of our beta phase today.
§9 Step 1: Prepare the app
Step 1: Prepare the app
In Partner Center, make sure you have:
- created the app / service
- enabled API access
- configured the Redirect URL
- obtained
app_key/app_secret - enabled the required creator scopes in Manage API
The Redirect URL is the callback destination after successful authorization. In production, it should be a real server-side endpoint that can validate the callback parameters, especially state.
§10 Step 2: Enable creator scopes
Step 2: Enable creator scopes
These are the creator scopes enabled or approved in Partner Center.
Go to APP & Service -> Manage API, then look for scope keys prefixed with creator (for example, creator.xxx). The available creator scope keys are listed on this page:
Image
§12 Step 4: Let the creator sign in and authorize
Step 4: Let the creator sign in and authorize
After opening the authorization link, the creator typically:
- signs in with the TikTok account
- enters the creator authorization page
- reviews the requested scopes
- if the authorization page supports partial authorization, the creator may toggle some scopes on or off
- clicks Authorize
§14 Step 5: Handle the callback and retrieve the auth code
Step 5: Handle the callback and retrieve the auth code
After the creator approves authorization, the platform redirects back to your Redirect URL with a temporary code. Here code is the parameter name returned in the callback URL; when you call Get Access Token, pass that same value as auth_code.
A typical callback looks like this:
PLAIN
Word Wrap
{redirect_url}?code={CODE_FROM_CALLBACK}&state={state}
§15 Recommended handling
Recommended handling
Your callback handler should:
- read
code - read and validate
state - detect callback errors if the user denied authorization
- stop the flow if no valid
codeis returned
The auth_code should be treated as short-lived and usually single-use. Exchange it for tokens as soon as possible.
§16 Step 6: Exchange the auth code for tokens
Step 6: Exchange the auth code for tokens
Use the Get Access Token endpoint: PLAIN Word Wrap
GET https://auth.tiktok-shops.com/api/v2/token/get
§17 Required parameters
Required parameters
app_keyapp_secretauth_code(use thecodereturned by the callback URL)grant_type=authorized_code
§18 Key response fields
Key response fields
access_tokenrefresh_tokenopen_iduser_typegranted_scopes
§19 Validate immediately after token exchange
Validate immediately after token exchange
Always verify:
code == 0user_type == 1(a value of1indicates a creator identity)granted_scopescovers the minimum scopes required by your business
If these checks fail, do not move directly into business API calls.
§20 Step 7: Refresh the token
Step 7: Refresh the token
When the access token expires, refresh it with: PLAIN Word Wrap
GET https://auth.tiktok-shops.com/api/v2/token/refresh
§21 Required parameters
Required parameters
app_keyapp_secretrefresh_tokengrant_type=refresh_token
§22 After refreshing, re-check key fields
After refreshing, re-check key fields
user_typeopen_idgranted_scopes
For safety, it is better not to assume the refreshed token behaves identically to the previous token. A safer engineering practice is to revalidate key fields whenever a new token is issued.
§23 How to use granted_scopes properly
How to use granted_scopes properly
granted_scopes is one of the most important fields in Creator authorization.
Use it at two levels:
§25 Level 2: before feature execution
Level 2: before feature execution
Before calling an endpoint, confirm that the required scope is included in granted_scopes.
§26 Recommended uses
Recommended uses
- if authorization succeeded but scopes are incomplete, prompt the creator to reauthorize
- if the API returns
105005, check both app scopes and tokengranted_scopes - if your product has multiple modules, maintain a scope-to-feature mapping
§29 The creator removes all access
The creator removes all access
Result:
- the old token becomes invalid
- future API calls fail with token invalid / deauthorized style errors
§30 The creator disables some scopes
The creator disables some scopes
Result:
- APIs under those scopes will start failing with permission errors
- a common error is
105005
§31 Recommended handling
Recommended handling
Your app should therefore provide:
- a clear way back to the authorization page
- an understandable reauthorization flow
- clear error messages for invalid tokens and missing scopes
§32 Common errors and troubleshooting
Common errors and troubleshooting
| Error / scenario | Meaning | Suggested action |
|---|---|---|
| 105005 | Missing required scope at app level or token level | Check app scopes, then check the token's granted_scopes, then ask the creator to reauthorize if needed |
| 105002 | Access token expired | Refresh the token |
| 105001 / token invalid | Token invalid, revoked, or user removed all access | Reauthorize if needed |
| 101000 | Wrong token identity or wrong API-token pairing | Make sure you are not using a seller token against a creator API |
| A practical rule of thumb:If a newly enabled scope still does not work, the first thing to inspect is usually the token's granted_scopes from the creator's latest authorization, not the app version number. |
§33 Best practices
Best practices
- generate and validate
stateon the server side - persist
granted_scopes - store creator tokens separately from seller tokens
- exchange the auth code as soon as possible after callback
- request only the minimum necessary scopes
- provide a clear reauthorization entry in the product
- check scope capability before calling an API
§34 FAQ
FAQ
§35 Can a creator token and a seller token be reused interchangeably?
Can a creator token and a seller token be reused interchangeably?
No. They represent different user identities and should not be mixed.
§37 After refreshing a token, is it recommended to keep checking `granted_scopes`?
After refreshing a token, is it recommended to keep checking granted_scopes?
For safety, yes. A safer engineering practice is to revalidate key capability fields whenever a new token is issued.
§38 What should I do if the creator granted only part of the requested scopes?
What should I do if the creator granted only part of the requested scopes?
Use granted_scopes to control feature availability, and reauthorize if a missing scope blocks critical business flows.
§39 Missing parameter: The URL must include the "state" parameter for creators to authorize this app. Please contact the developer for assistance.
Missing parameter: The URL must include the "state" parameter for creators to authorize this app. Please contact the developer for assistance.
For creator authorization links, you are required to manually add a state parameter for extra security. The state is an unguessable random string that can help protect cross-site request forgery attacks, and is not automatically included in the basic authorization link.
§40 No data retrieved: The requested API list is empty. Please contact the app developer for more information.
No data retrieved: The requested API list is empty. Please contact the app developer for more information.
APP must open creator api scopes. APP & Service -> Manage API, look for scope keys that begin with creator.
