快工助手跨境电商知识与商机助手

Reauthorize shops

TikTok Shop 官方资料 · TikTok Shop Partner Center 开发者文档 · 适合开发者

stable本次发布有变化全部展示

来自 TikTok Shop 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
TikTok Shop / profile.tiktok.docs_api
语言
en-US
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/tiktok_shopaudience/developercategory/api_doctopic/compliancetopic/developer

资料正文

§1 Notify sellers before authorization expires

Once you have connected one or more TikTok Shops, your client application or connector should remind sellers before their authorization expires and guide them through reauthorization so access to TikTok Shop Seller data can continue. This guide focuses on upcoming authorization expiration. It assumes you already store token and shop connection data as described in Connecting shops.

#

§2 Event scope

Event scope

Do not treat upcoming authorization expiration and deauthorization as the same event.

EventEvent typeMeaningDeveloper actionReference
Upcoming authorization expirationUPCOMING_AUTHORIZATION_EXPIRATIONThe seller authorization is still active, but it will expire soon. TikTok Shop sends this event 30 days before expiration and then daily at 00:00 until reauthorization is completed.Notify the seller and route them to reauthorize before access is lost.Upcoming authorization expiration
Seller deauthorizationSELLER_DEAUTHORIZATIONThe seller has already deauthorized the app, or authorization is no longer valid.Mark the connection inactive, stop using existing tokens for that shop, and ask the seller to connect again if access is still required.Seller deauthorization
#

§3 Reminder strategy

Reminder strategy

Use the webhook as the primary signal, and keep a local fallback based on refresh_token_expire_in in case webhook delivery fails. Recommended reminder timing:

Time before expirationSuggested action
30 daysStart showing a low-friction in-app reminder. This aligns with the first UPCOMING_AUTHORIZATION_EXPIRATION webhook.
14 daysShow a persistent banner or task in the seller-facing dashboard.
7 daysEscalate the reminder through email, notification center, or your customer-success workflow.
1 dayShow an urgent reminder and make reauthorization the primary action.
Expired or deauthorizedStop calling seller-scoped APIs for that shop and route the seller through the authorization flow again.

If your product has low-frequency seller logins, start external reminders earlier, such as 30 or 14 days before expiration. If the seller logs in daily, in-product reminders at 14 and 7 days may be enough.

#

§4 Configure the webhook

Configure the webhook

You can configure shop webhooks in Partner Center or by API. In Partner Center, open your app or service and go to the webhook or event subscription settings:

Partner Center Console
  -> App & Service
  -> Select your app or service
  -> Webhooks / Event subscriptions
  -> Add or update UPCOMING_AUTHORIZATION_EXPIRATION

Console labels may vary by Partner Center version. The important part is that the webhook topic must be UPCOMING_AUTHORIZATION_EXPIRATION and the callback URL must be your HTTPS webhook listener. To configure the same event programmatically, call Update Shop Webhook:

PUT https://open-api.tiktokglobalshop.com/event/202309/webhooks?app_key={app_key}&timestamp={timestamp}&sign={sign}&shop_cipher={shop_cipher}
Content-Type: application/json
x-tts-access-token: {access_token}

{
  "address": "https://example.com/tiktok-shop/webhooks",
  "event_type": "UPCOMING_AUTHORIZATION_EXPIRATION"
}

Use the exact endpoint reference for the latest required query parameters. For shop-scoped webhook configuration, include shop_cipher when the endpoint requires it.

#

§5 Webhook payload

Webhook payload

When your listener receives UPCOMING_AUTHORIZATION_EXPIRATION, validate the event type and map the payload to the local customer and shop connection. Example payload:

{
  "event_type": "UPCOMING_AUTHORIZATION_EXPIRATION",
  "shop_id": "7495355150342452340",
  "timestamp": 1696909648,
  "data": {
    "message": "Authorization for this TikTok Shop will expire soon.",
    "expiration_time": 1699501648
  }
}

Payload field quick reference:

FieldTypeMeaningUnit / format
event_typestringWebhook topic. For this guide, the value is UPCOMING_AUTHORIZATION_EXPIRATION.String enum
shop_idstringTikTok Shop ID associated with the expiring authorization. Use this to find the local customer connection.String
timestampintegerTime when the webhook event was generated.Unix epoch seconds
dataobjectEvent-specific payload.JSON object
data.messagestringHuman-readable message describing the upcoming authorization expiration.String
data.expiration_timeintegerTime when the seller authorization expires.Unix epoch seconds

Store the latest expiration reminder state against the local customer and shop connection. Do not treat data.message as the source of truth for business logic; use data.expiration_time and your stored token metadata.

#

§6 Reauthorization flow

Reauthorization flow

Reauthorization uses the same Seller authorization flow as the first connection. The seller must authorize your app again, your callback receives a new code, and your backend exchanges that code for a new access_token and refresh_token. Use the Seller authorization entry that matches the seller region. You can find service_id in Partner Center:

Partner Center Console
  -> App & Service
  -> Select your app or service
  -> Basic Information
  -> Service ID
Seller regionAuthorization entry
United Stateshttps://services.us.tiktokshop.com/open/authorize?service_id={service_id}&state={state}
Non-UShttps://services.tiktokshop.com/open/authorize?service_id={service_id}&state={state}

Use the same authorization-link parameters as your first-time connection flow. The redirect URL is the callback URL configured for the app in Partner Center. state is strongly recommended so you can map the callback back to the local customer and shop connection; validate it before exchanging the returned code for new tokens. The reauthorization flow is:

  1. Receive UPCOMING_AUTHORIZATION_EXPIRATION or detect that refresh_token_expire_in is approaching.
  2. Mark the shop connection as reauthorization_required or an equivalent internal status.
  3. Show the seller a clear reauthorization action.
  4. Send the seller through the same Seller authorization link used by Connecting shops.
  5. Receive the callback code.
  6. Exchange the code for new tokens through the token endpoint.
  7. Replace the stored token values and clear the reminder state for that shop connection.
#

§7 Listener behavior

Listener behavior

Your webhook listener should be idempotent. TikTok Shop may send the upcoming-expiration notification repeatedly, so receiving the same reminder more than once should update the existing reminder state instead of creating duplicate customer tasks. Recommended behavior:

SituationAction
UPCOMING_AUTHORIZATION_EXPIRATION received for a known shopUpdate the expiration reminder state and show or refresh seller-facing reminders.
UPCOMING_AUTHORIZATION_EXPIRATION received for an unknown shopLog the event with shop_id and timestamp, then investigate whether the shop mapping is missing or stale.
Seller completes reauthorizationUpdate stored tokens, refresh authorized shop data, and clear the reminder.
SELLER_DEAUTHORIZATION receivedMark the connection inactive and stop calling seller-scoped APIs for that shop until the seller connects again.
#

§8 Next steps

Next steps

After you have implemented the upcoming authorization expiration listener, add functionality to disconnect a shop and handle seller deauthorization as a separate lifecycle event.

#