来自 TikTok Shop 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§2 Domain usage
This getting-started flow uses several TikTok Shop domains. They serve different purposes:
| Domain | Purpose |
|---|---|
| https://partner.tiktokshop.com | TikTok Shop Partner Center and developer documentation entry point. |
| https://partner-sso.tiktok.com/account/login | Partner Center Console sign-in page. After signing in, use the Console to manage apps, development shops, and app credentials. |
| https://auth.tiktok-shops.com | TikTok Shop Authorization Server for token APIs, including /api/v2/token/get and /api/v2/token/refresh. |
| https://open-api.tiktokglobalshop.com | TikTok Shop Open API resource server. Use this domain to call APIs such as GET /authorization/202309/shops. |
§3 App credential location
You can find your app credentials in the Partner Center Console:
Partner Center Console
-> App & Service
-> Select your app
-> App credentials / Developing section
-> App Key and App Secret
Some app creation guides mention that App Key and App Secret are shown on the confirmation page when the app is created. If you need to look them up later, use the Partner Center Console path above.
§4 Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
app_key | Query | string | The App Key generated for your TikTok Shop App. |
sign | Query | string | The cryptographic hash that you created in Create a hash to sign your test API call. |
timestamp | Query | Unix timestamp | The Unix epoch timestamp used to generate the sign parameter. The timestamp used for the signature and the timestamp sent in this API call must match the same signing attempt and must be within five minutes of the request time. If more than five minutes have passed, generate a new timestamp and a new sign value together. |
x-tts-access-token | Header | string | The test access token you created when you generated a test access token. |
§5 Example request
If you're not creating the request programmatically in code using an HTTP library, you can use cURL:
curl --location --request GET 'https://open-api.tiktokglobalshop.com/authorization/202309/shops?app_key=<your_app_key>&sign=<your_cryptographic_hash>×tamp=<timestamp_used_for_this_sign>' \
--header 'Content-Type: application/json' \
--header 'x-tts-access-token: <your_access_token>'
§6 Example successful response
If your request is successful, you'll receive a response like this:
{
"code": 0,
"data": {
"shops": [
{
"cipher": "<the shop cipher for your test TikTok Shop>",
"code": "<the shop code for your test TikTok Shop>",
"id": "<the identifier for your test TikTok Shop>",
"name": "<the name of your test TikTok Shop>",
"region": "<the region of your test TikTok Shop>",
"seller_type": "<your seller type>"
}
]
},
"message": "Success",
"request_id": "<the request identifier generated by the TikTok Shop server>"
}
§7 `seller_type` and `user_type`
seller_type and user_type
The seller_type field in this API response is not the same as the user_type field returned by the token API.
| Field | Returned by | Meaning |
|---|---|---|
user_type | Token APIs such as https://auth.tiktok-shops.com/api/v2/token/get | The type of user or authorization principal that generated the token, such as seller, creator, partner, or global-selling related types. |
seller_type | GET /authorization/202309/shops | The type of seller/shop returned in the authorized shop list. Possible values include LOCAL and CROSS_BORDER. |
Use seller_type to understand the shop model returned by Get Authorized Shops. Use user_type only when interpreting the token response from Generate a test access token.
§8 Troubleshooting
The three most common issues are related to the access_token, the sign value, or an expired timestamp/signature pair.
If your request fails due to an authentication issue, check the x-tts-access-token header and ensure that you've followed all the steps in Generate a test access token. If you still encounter authentication issues, you may have a problem with either your TikTok Shop App or your test TikTok Shop Seller account. You can reach out to technical support for help.
If your request fails because of an invalid sign parameter, review Sign your API request, which contains the complete signing rules. Make sure the API path, sorted query parameters, request body if any, and App Secret are exactly the same values used to create the signature.
If your request fails because the timestamp or signature has expired, generate a fresh Unix timestamp and recreate the sign value with that same timestamp. Do not reuse an old signature with a new timestamp, and do not reuse a new signature with an old timestamp. Also check your local machine's clock if you continue to see timestamp-related errors.
If you still experience issues after checking the access token, signature, and timestamp, reach out to technical support for assistance.
§9 Next steps
After you've successfully made your first API call, you're ready to start working on your TikTok Shop App. Head over to the developer guide to learn about:
- TikTok Shop API concepts,
- How to develop a public TikTok Shop App and launch it in the TikTok Shop App Store and the requirements for listing in the App development process overview,
- Our developer tools to help you with application development and testing.
