来自 TikTok Shop 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§2 Event scope
Event scope
Do not treat upcoming authorization expiration and deauthorization as the same event.
| Event | Event type | Meaning | Developer action | Reference |
|---|---|---|---|---|
| Upcoming authorization expiration | UPCOMING_AUTHORIZATION_EXPIRATION | The 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 deauthorization | SELLER_DEAUTHORIZATION | The 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 expiration | Suggested action |
|---|---|
| 30 days | Start showing a low-friction in-app reminder. This aligns with the first UPCOMING_AUTHORIZATION_EXPIRATION webhook. |
| 14 days | Show a persistent banner or task in the seller-facing dashboard. |
| 7 days | Escalate the reminder through email, notification center, or your customer-success workflow. |
| 1 day | Show an urgent reminder and make reauthorization the primary action. |
| Expired or deauthorized | Stop 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}×tamp={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:
| Field | Type | Meaning | Unit / format |
|---|---|---|---|
event_type | string | Webhook topic. For this guide, the value is UPCOMING_AUTHORIZATION_EXPIRATION. | String enum |
shop_id | string | TikTok Shop ID associated with the expiring authorization. Use this to find the local customer connection. | String |
timestamp | integer | Time when the webhook event was generated. | Unix epoch seconds |
data | object | Event-specific payload. | JSON object |
data.message | string | Human-readable message describing the upcoming authorization expiration. | String |
data.expiration_time | integer | Time 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.
§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:
| Situation | Action |
|---|---|
UPCOMING_AUTHORIZATION_EXPIRATION received for a known shop | Update the expiration reminder state and show or refresh seller-facing reminders. |
UPCOMING_AUTHORIZATION_EXPIRATION received for an unknown shop | Log the event with shop_id and timestamp, then investigate whether the shop mapping is missing or stale. |
| Seller completes reauthorization | Update stored tokens, refresh authorized shop data, and clear the reminder. |
SELLER_DEAUTHORIZATION received | Mark 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.
