# TikTok Shop (prebuilt connector)

## Description

**TikTok Shop** is an eCommerce solution integrated within TikTok, enabling merchants and creators to showcase and sell products for the TikTok community to discover and purchase directly through the TikTok app.

## API documentation

TikTok Shop's API documentation (used to build this connector) can be found via the link below:

{% embed url="<https://partner.tiktokshop.com/docv2/page/tts-developer-guide>" %}

## TikTok custom app creation

Before installing the Patchworks TikTok connector, you need to create a custom 'Patchworks' app in the **app & service** section of your TikTok partner portal:&#x20;

<figure><img src="/files/gO58VXCVntA0ZABudIvU" alt=""><figcaption></figcaption></figure>

We advise naming your app 'Patchworks Integration' or similar. As part of the creation process you need to **enable API** and define a **redirect URL**:

<figure><img src="/files/H75lklBvlQNfso5srKK0" alt=""><figcaption></figcaption></figure>

Ensure that your **redirect URL** is set as follows:

```
https://app.wearepatchworks.com/oauth/authenticate
```

Having created your custom app, an **app Key** and **app secret** will be available - add these to your password manager for later use in your [Patchworks connector setup](#authentication).

## Authentication&#x20;

When adding connector instances for TikTok, the following authentication methods are supported:

* [TTS auth](#tts-authentication)

### TTS authentication

When a user chooses to [add a connector instance](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md) using **TTS auth** authentication, the credentials below are prompted:

<table><thead><tr><th width="210">Credential</th><th width="174" data-type="checkbox">Required?</th><th>Notes</th></tr></thead><tbody><tr><td><code>App key</code></td><td>true</td><td>Enter the key provided for your <a href="#tiktok-custom-app-creation">TikTok custom app</a>.</td></tr><tr><td><code>App secret</code></td><td>true</td><td>Enter the secret provided for your <a href="#tiktok-custom-app-creation">TikTok custom app</a>.</td></tr></tbody></table>

#### Advanced credentials

Advanced credentials should not need to be updated under typical circumstances.&#x20;

<table><thead><tr><th>Credential</th><th data-type="checkbox">Required?</th><th>Notes</th></tr></thead><tbody><tr><td><code>OAuth authorised code</code></td><td>true</td><td>This setting is used internally - under normal circumstances it should not need to be updated.</td></tr><tr><td><code>Authentication URL</code></td><td>true</td><td>Set to <a href="https://auth.tiktok-shops.com"><code>https://auth.tiktok-shops.com</code></a>.</td></tr><tr><td><code>Endpoint URL</code></td><td>true</td><td>Set to <a href="https://open-api.tiktokglobalshop.com"><code>https://open-api.tiktokglobalshop.com</code></a>.</td></tr><tr><td><code>State length</code></td><td>true</td><td>This is a numeric value which determines the length of a random string generated (behind the scenes) during the OAuth process, for verification purposes. Our suggested setting is <code>15</code>.</td></tr><tr><td><code>Response type key</code></td><td>true</td><td>Set to <code>code</code>.</td></tr><tr><td><code>Grant type</code></td><td>true</td><td>Set to <code>authorization_code</code>.</td></tr><tr><td><code>Response access token key</code></td><td>true</td><td>Set to <code>data.access_token</code>.</td></tr><tr><td><code>Response refresh token key</code></td><td>true</td><td>Set to <code>data.refresh_token</code>.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/patchworks-connectors/tiktok-shop-prebuilt-connector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
