您的浏览器不支持JavaScript,请启用JavaScript以获得最佳体验。

LINGTU AI OpenAPI

Creator authorization flow

Commerce publishing, product queries and showcase management all depend on TikTok Shop creator authorization. This page covers authorization only: generate the URL on the server, let the creator open it or scan the QR code, after confirming it must redirect to the callback page and show “SUCCESS/成功” (authorization successful), then list usable accounts. Both video and photo publishing start here.

Authorization flow

Failure
Get authorization URL
Generate the url or QR code on the server for the selected oauthRegion
Authorize by QR code or browser
Scan the QR code with a phone, or open the url in a browser
No API (manual step)
Grant permissions
Select the permissions on the TikTok authorization page; photo posts also need the photo permission
No API (manual step)
Confirm authorization
Confirm with the TikTok account that has commerce permission and will publish content
No API (manual step)
Callback redirect (must happen)
After confirming, the page must redirect to the callback URL; open it in a browser or inside the TikTok app
Callback page: https://app.ailingtu.com/oauth/tiktokshop
Authorization successful
Only when the callback page shows “SUCCESS/成功” does the authorization count as successful
Confirm the result first
List authorized creators
authSource=TIKTOK_SHOP_CREATOR; add hasPhotoPermission=true for photo posts
Account ready
Use the account id for product queries and creatorId for publishing tasks
Continue to video or photo publishing
Failure: no redirect or no success page
The page must redirect after confirming. If it stays on the authorization page, check that the link was opened in a browser or the TikTok app, then generate a new link and authorize again.
TikTok Shop creator authorization flow: get the authorization URL, scan the QR code or open it in a browser, grant permissions, confirm, return through the callback link in a browser or the TikTok app, see authorization successful, then list authorized creators.

Callback link example: https://app.ailingtu.com/oauth/tiktokshop

What each step does

01

Step 1 · Get the authorization URL

Generate the authorization link on the server for the market and shop type.

  • oauthRegion combines the market and shop type, such as us_local, us_cross, gb_local or id_cross
  • Call the authorization endpoint from the server so x-api-key never reaches the browser
  • Open the returned url directly, or turn it into a QR code for the creator
02

Step 2 · QR code or browser

The creator scans the QR code or opens the link in a browser and enters the TikTok authorization page.

  • Scan the QR code with a phone, or open the url in a browser
  • Both entries lead to the same TikTok authorization page
  • One QR code is valid for one account only; do not let several creators scan it
No API (manual step)
03

Step 3 · Grant permissions

Select the required permissions on the TikTok authorization page.

  • Grant the permissions your publishing scenario needs
  • Photo posts also need the photo publishing permission; ask for it during authorization
  • Missing permission is not an expired token: ask the creator to grant it first
No API (manual step)
04

Step 4 · Confirm authorization

The creator confirms with the TikTok account that will publish content.

  • Use the same TikTok account that has commerce permission and will publish content
  • The account itself is a TikTok account whose commerce permission allows publishing
  • Check the account before confirming so authorization does not land on the wrong creator
No API (manual step)
05

Step 5 · Callback redirect (must happen)

After confirming, the page must redirect to the callback URL; staying on the authorization page is a failure.

  • Clicking confirm must automatically redirect to the callback URL
  • Callback link example: https://app.ailingtu.com/oauth/tiktokshop
  • Open the callback link in a browser or inside the TikTok app
  • No redirect, or a callback page that fails to load, must be treated as failure
  • Do not use an embedded WebView; the redirect may not complete
No API (callback page)
06

Step 6 · Authorization successful

After the redirect, the authorization succeeds only when the callback page shows “SUCCESS/成功”.

  • A creator-side hint without the success page is not enough
  • Continue only after the callback page shows “SUCCESS/成功”
  • If no success page appears, treat it as a failure and generate a new link
No API (callback page)
07

Step 7 · List authorized creators

Query the account after success and keep account id and creatorId.

  • Pass authSource=TIKTOK_SHOP_CREATOR to list commerce publishing accounts
  • Add hasPhotoPermission=true when the account is used for commerce photo posts
  • Use id for product queries and creatorId for publishing tasks; do not mix them
08

Step 8 · Manage authorization

Recover expired authorization or missing permissions by cause.

  • Expired authorization returns “授权过期,请重新授权” and marks the account invalid
  • Ask the creator to authorize again with the same oauthRegion, then query accounts again
  • Revoke access when the creator should no longer publish
  • Missing scope is not an expired token: guide the creator to grant permissions first

Key branches

Redirect and confirmation

Confirming must redirect to the callback URL, and only then does “SUCCESS/成功” count; no redirect or no success page is a failure.

One QR code, one account

The QR code or authorization URL binds a single account; generate a new one for every creator account.

Expired authorization

The account is marked invalid and the API returns “授权过期,请重新授权”. Authorize again and re-query accounts.

Missing photo permission

Photo posts require PHOTO_SHOPPABLE_PERMISSION_PRODUCT or PHOTO_SHOPPABLE_PERMISSION_SHOP in permissions; without either, the account cannot publish commerce photos.

Permission refresh

Use sync to refresh creator permissions when they change; it does not change the authorization state.

Revoke access

Revoke when the creator should no longer publish; later publishing attempts fail until authorized again.

Integration notes

  • Authorization URLs are generated per oauthRegion; pick the market and shop type that match the TikTok account being authorized.
  • The authorized entity is a TikTok account; what makes it usable here is its commerce permission.
  • Confirming must redirect to the callback URL, and the page must show “SUCCESS/成功” before listing accounts; no redirect or no success page is a failure.
  • A QR code or authorization URL binds a single account; never let several creators scan the same code.
  • Generate the URL on the server and never expose the API key in browser code, QR codes or logs.
  • Photo posts need an extra permission; check it during authorization instead of failing at publish time.
  • The authorized account id and creatorId serve different endpoints; store both after listing accounts.