来自 TikTok Shop 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 Shop connection lifecycle
A TikTok Shop connection is the relationship between a local customer account in your system and a TikTok Shop seller authorization. This guide covers the disconnect stage of the lifecycle. Read it together with:
Lifecycle overview:
Connect shop -> Store tokens and shop identifiers -> Refresh or reauthorize before expiration -> Disconnect locally or handle TikTok-side deauthorization -> Reconnect if access is needed again
Use this page for two different scenarios:
| Scenario | Trigger source | Primary signal | What your system should do | Reconnect path |
|---|---|---|---|---|
| Customer-requested disconnect | Your application or connector UI | Customer clicks a disconnect action in your product | Stop local access, delete or deactivate stored credentials, remove scheduled jobs, and clean up retained shop data according to your retention policy | Send the customer through the Seller authorization flow again |
| TikTok-side deauthorization | TikTok Shop authorization management | SELLER_DEAUTHORIZATION webhook | Mark the shop connection inactive, stop API calls for that shop, delete or deactivate stored credentials, and notify the customer if reconnection is needed | Send the customer through the Seller authorization flow again |
Do not treat these scenarios as the same event. A customer can disconnect a shop in your product without revoking the app authorization in TikTok Shop. A seller can also revoke authorization in TikTok Shop without clicking anything in your product.
§3 Customer-requested disconnect
In this use case, the customer asks to disconnect one or more TikTok Shops from your application or connector. Image Recommended flow:
- Authenticate the customer and confirm which TikTok Shop connection should be disconnected.
- Identify the local connection record by your customer identifier and the TikTok Shop identifier, such as
shop_id,shop_cipher, or the composite key used by your data model. - Mark the connection as
disconnectingorinactiveso background jobs stop using it. - Stop scheduled sync jobs, webhook processing, retries, queue consumers, and API polling for that shop.
- Delete or deactivate the stored
access_token,refresh_token, token expiration timestamps, and token-derived secrets from secret storage, caches, logs, and job payloads. - Delete, anonymize, or retain customer and shop data according to your documented data retention policy and applicable law.
- Show the customer that the shop is disconnected in your product.
- If the customer wants to connect the shop again later, route them through the Seller authorization flow as a new authorization. Do not reuse old tokens.
§6 Data cleanup checklist
Clean up data based on the scenario and the legal basis for retaining it.
| Data item | Customer-requested disconnect | TikTok-side deauthorization | Recommended handling |
|---|---|---|---|
access_token | Delete or deactivate immediately | Delete or deactivate immediately | Remove from secret stores, caches, queues, and retry payloads. |
refresh_token | Delete or deactivate immediately | Delete or deactivate immediately | Treat as highly sensitive. Do not keep it after access is no longer required. |
| Token expiration timestamps | Delete or retain only as audit metadata | Delete or retain only as audit metadata | Keep only if needed for compliance, fraud prevention, or support audit. |
shop_id | Delete, anonymize, or keep minimal audit record | Delete, anonymize, or keep minimal audit record | If retained, do not use it for API calls after disconnect. |
shop_cipher | Delete or deactivate with the connection | Delete or deactivate with the connection | Required for many shop-scoped calls; keeping it active after disconnect creates avoidable risk. |
| Shop metadata, such as shop name, region, and seller type | Delete or anonymize when no longer needed | Delete or anonymize when no longer needed | Retain only what is required for invoices, support, audit, or legal obligations. |
| API-derived customer data | Delete or anonymize according to your data retention policy | Delete or anonymize according to your data retention policy | Remove product, order, fulfillment, finance, or customer-service data when there is no valid business or legal need to retain it. |
| Scheduled jobs and queues | Stop and purge pending work for the disconnected shop | Stop and purge pending work for the deauthorized shop | Prevent retries from using stale credentials. |
| Webhook state | Keep the shared listener, but ignore or reject events for inactive shops | Keep deauthorization handling active | Webhook endpoint configuration may be shared across shops; do not remove shared infrastructure accidentally. |
§7 Data retention and deletion timing
At minimum, deactivate local API access immediately after disconnect or deauthorization so your system stops using the credentials. For stored customer data:
- Follow your published privacy policy, seller agreement, applicable law, and TikTok Shop platform requirements.
- For GDPR-covered personal data, apply data minimization and erasure obligations where applicable. See the European Commission's data protection overview.
- Define an internal deletion SLA before launch. A practical default is to delete or anonymize data that is no longer needed within 30 days after disconnect, unless a shorter period is required by law, platform policy, or your agreement with the customer.
- If you must retain limited records for tax, invoicing, fraud prevention, security, or legal defense, retain only the minimum fields needed and block them from operational API use.
§8 Reconnect after disconnect
If the customer wants to reconnect the shop, use the same Seller authorization flow as a first-time connection:
- Send the customer to the appropriate Seller authorization entry point.
- Receive a new authorization
codeat your callback URL. - Exchange the
codefor a newaccess_tokenandrefresh_token. - Call Get Authorized Shops to refresh shop identifiers, including
shop_idandshop_cipher. - Store the new token response,
granted_scopes, and shop metadata against the local customer connection. - Restart only the jobs and integrations that the customer has enabled.
Never reactivate a disconnected connection by reusing old tokens.
§9 Recommended documentation structure
For lower cross-page jumping, the shop connection docs can be organized as one lifecycle guide:
| Chapter | What it should cover |
|---|---|
| Connect | Seller authorization link, callback code, token exchange, Get Authorized Shops, single-shop and multi-shop data model. |
| Maintain | Access-token refresh, refresh-token expiration, UPCOMING_AUTHORIZATION_EXPIRATION webhook, and reauthorization UX. |
| Disconnect | Customer-requested disconnect, TikTok-side deauthorization, local credential deletion, data retention, and reconnect path. |
Until the lifecycle guide is consolidated, keep cross-links between the three pages so developers can move from connect to reauthorize to disconnect without guessing which page owns each state transition.
