PHPackages                             kkgerry/tiktokshop-od-larevel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kkgerry/tiktokshop-od-larevel

ActiveLibrary[API Development](/categories/api)

kkgerry/tiktokshop-od-larevel
=============================

Unofficial Tiktok Shop API Client in Laravel

1.2(1y ago)018Apache-2.0PHPPHP ^7.2|^8.0

Since Apr 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kkgerry/tiktokshop-od-larevel)[ Packagist](https://packagist.org/packages/kkgerry/tiktokshop-od-larevel)[ RSS](/packages/kkgerry-tiktokshop-od-larevel/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Unofficial Tiktok Shop API Client in Laravel
============================================

[](#unofficial-tiktok-shop-api-client-in-laravel)

[![Total Downloads](https://camo.githubusercontent.com/bdb085ca3498ec9d92e27aa6bbe590ad500b80d237d2c762c13641dee6f04b7f/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f74696b746f6b73686f702d7068702f646f776e6c6f616473)](https://packagist.org/packages/ecomphp/tiktokshop-php)[![Latest Stable Version](https://camo.githubusercontent.com/d3d52e5139dd404760d4292e71feaf1ffc3f0d63c8fbf0913c8d34fad5474c0f/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f74696b746f6b73686f702d7068702f762f737461626c65)](https://packagist.org/packages/ecomphp/tiktokshop-php)[![Latest Unstable Version](https://camo.githubusercontent.com/979c313176dbba1ee4929ed730cdab0c8e68a1c2ae8a91dfd63716a2d2600128/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f74696b746f6b73686f702d7068702f762f756e737461626c65)](https://packagist.org/packages/ecomphp/tiktokshop-php)[![Build Status](https://camo.githubusercontent.com/38d0742abac62c71ac82f8a0711d8fa8358039777d23888061b40dd029948e42/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65636f6d7068702f74696b746f6b73686f702d7068702f63692e796d6c3f6272616e63683d6d6173746572266c6162656c3d63692532306275696c64267374796c653d666c61742d737175617265)](https://github.com/ecomphp/tiktokshop-php/actions?query=workflow%3ATest)[![License](https://camo.githubusercontent.com/6ed1038d8c960b1bd632ca6aeab0f7c82f2971123e63a222018f2311ddbb96ba/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f74696b746f6b73686f702d7068702f6c6963656e7365)](https://packagist.org/packages/ecomphp/tiktokshop-php)

Tiktok Shop API Client is a simple SDK implementation of Tiktok Shop API.

Since v2.x, library used API version 202309 and later. For older API version, please use v1.x

Installation
------------

[](#installation)

Install with Composer

```
composer require kkgerry/tiktokshop-od-larevel
```

Configure TiktokShop PHP Client
-------------------------------

[](#configure-tiktokshop-php-client)

```
use Kkgerry\TiktokShop\Client;

$app_key = 'your app key';
$app_secret = 'your app secret';

$client = new Client($app_key, $app_secret);
```

Grant token
-----------

[](#grant-token)

There is a Auth class to help you getting the token from the shop using oAuth.

```
$auth = $client->auth();
```

1. Create the authentication request

```
$_SESSION['state'] = $state = str_random(40); // random string
$auth->createAuthRequest($state);
```

> If you want the function to return the authentication url instead of auto-redirecting, you can set the argument $return (2nd argument) to true.

```
$authUrl = $auth->createAuthRequest($state, true);

// redirect user to auth url
header('Location: '.$authUrl);
```

2. Get authentication code when redirected back to `Redirect callback URL` after app authorization and exchange it for access token

```
$authorization_code = $_GET['code'];
$token = $auth->getToken($authorization_code);

$access_token = $token['access_token'];
$refresh_token = $token['refresh_token'];
```

3. Get authorized Shop cipher

```
$access_token = $token['access_token'];
$client->setAccessToken($access_token);

$authorizedShopList = $client->Authorization->getAuthorizedShop();

// extract shop_id & cipher from $authorizedShopList for use later
```

Refresh your access token
-------------------------

[](#refresh-your-access-token)

> Access token will be expired soon, so you need refresh new token by using `refresh_token`

```
$new_token = $auth->refreshNewToken($refresh_token);

$new_access_token = $new_token['access_token'];
$new_refresh_token = $new_token['refresh_token'];
```

Usage API Example
-----------------

[](#usage-api-example)

> You need `access_token` and `shop_cipher` to start using TiktokShop API

```
$client = new Client($app_key, $app_secret);
$client->setAccessToken($access_token);
$client->setShopCipher($shop_cipher);
```

- Get product list: [api document](https://developers.tiktok-shops.com/documents/document/237487)

```
$products = $client->Product->getProductList([
    'page_size' => 50,
]);
```

- Get order list: [api document](https://developers.tiktok-shops.com/documents/document/237434)

```
$orders = $client->Order->getOrderList([
    'order_status' => 100, // Unpaid order
    'page_size' => 50,
]);
```

Change API version
------------------

[](#change-api-version)

> As default, API version 202309 will be used in every api call. Use example below to change it

```
$products = $client->Product->useVersion('202312')->checkListingPrerequisites();
```

Webhook
-------

[](#webhook)

Use webhook to receive incoming notification from tiktok shop

```
$webhook = $client->webhook();
```

or manually configure the webhook receiver

```
use Kkgerry\TiktokShop\Webhook;
use Kkgerry\TiktokShop\Errors\TiktokShopException;

$webhook = new Webhook($client);
try {
    $webhook->verify();
    $webhook->capture($_POST);
} catch (TiktokShopException $e) {
    echo "webhook error: " . $e->getMessage() . "\n";
}
```

```
echo "Type: " . $webhook->getType() . "\n";
echo "Timestamp: " . $webhook->getTimestamp() . "\n";
echo "Shop ID: " . $webhook->getShopId() . "\n";
echo "Data: \n"; // data is array
print_r($webhook->getData());
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance46

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~190 days

Total

3

Last Release

415d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73852c3b696f93227ceca53499c19b3c42c000e473f33de184449110658cc5c8?d=identicon)[kkgerry](/maintainers/kkgerry)

---

Top Contributors

[![kkgerry](https://avatars.githubusercontent.com/u/8937585?v=4)](https://github.com/kkgerry "kkgerry (5 commits)")[![mimiui](https://avatars.githubusercontent.com/u/26623379?v=4)](https://github.com/mimiui "mimiui (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kkgerry-tiktokshop-od-larevel/health.svg)

```
[![Health](https://phpackages.com/badges/kkgerry-tiktokshop-od-larevel/health.svg)](https://phpackages.com/packages/kkgerry-tiktokshop-od-larevel)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M987](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M45](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
