PHPackages                             ecomphp/shopee-php - 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. ecomphp/shopee-php

ActiveLibrary[API Development](/categories/api)

ecomphp/shopee-php
==================

Unofficial Shopee API Client in PHP

v1.5.0(4mo ago)907.4k↓31.4%18[1 issues](https://github.com/EcomPHP/shopee-php/issues)Apache-2.0PHPPHP ^7.2|^8.0CI passing

Since Nov 20Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/EcomPHP/shopee-php)[ Packagist](https://packagist.org/packages/ecomphp/shopee-php)[ RSS](/packages/ecomphp-shopee-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (35)Used By (0)

Unofficial Shopee API Client in PHP
===================================

[](#unofficial-shopee-api-client-in-php)

[![Total Downloads](https://camo.githubusercontent.com/d1ab187e4bfc05999049367f56f5195c007c3ebb2de77b1d73587ebf185a07fb/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f73686f7065652d7068702f646f776e6c6f616473)](https://packagist.org/packages/ecomphp/https://github.com/EcomPHP/shopee-php)[![Latest Stable Version](https://camo.githubusercontent.com/30240b4048a80b925ed5d9da47d2db7327b4b5bcb446cb1e88f0a6dc7c261a7b/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f73686f7065652d7068702f762f737461626c65)](https://packagist.org/packages/ecomphp/shopee-php)[![Latest Unstable Version](https://camo.githubusercontent.com/6a740161443bb9c257dff8a0a7b0a0d1fd89bef53f8feadd19a87f237e0ae236/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f73686f7065652d7068702f762f756e737461626c65)](https://packagist.org/packages/ecomphp/shopee-php)[![Build Status](https://camo.githubusercontent.com/9bfda415d6ee7b664d25c303e64624d18e698fc94bac41f868447a049e38b8b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65636f6d7068702f73686f7065652d7068702f63692e796d6c3f6272616e63683d6d6173746572266c6162656c3d63692532306275696c64267374796c653d666c61742d737175617265)](https://github.com/ecomphp/shopee-php/actions?query=workflow%3ATest)[![License](https://camo.githubusercontent.com/410466ea2117b328da95fc58525560eb7386f3cba16ff7548a9ae36a3ba57239/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f73686f7065652d7068702f6c6963656e7365)](https://packagist.org/packages/ecomphp/shopee-php)

Shopee Client is a simple SDK implementation of Shopee API.

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

[](#installation)

Install with Composer

```
composer require ecomphp/shopee-php
```

Configure Shopee PHP Client
---------------------------

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

```
use EcomPHP\Shopee\Client;

$partner_id = 'your partner id';
$partner_key = 'your partner key';

$client = new Client($partner_id, $partner_key);
```

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

```
$redirect_uri = 'http://your-redirect-url.com';
$auth->createAuthRequest($redirect_uri);
```

> 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($redirect_uri, 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'];
$shop_id = $_GET['shop_id'];
$token = $auth->getToken($authorization_code, $shop_id);

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

// save your access_token & refresh_token & shop_id for later use
```

3. Get authorized Shop cipher

```
$access_token = 'your access token';
$shop_id = 'your shop id';
$client->setAccessToken($shop_id, $access_token);
```

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, $shop_id);

$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_id` to start using Shopee API

```
$client = new Client($partner_id, $partner_key);
$client->setAccessToken($shop_id, $access_token);
```

- Get item list: [api document](https://open.shopee.com/documents/v2/v2.product.get_item_list?module=89&type=1)

```
$products = $client->Product->getItemList([
    'offset' => 0,
    'page_size' => 50,
    'item_status' => 'NORMAL',
]);
```

- Get order list: [api document](https://open.shopee.com/documents/v2/v2.order.get_order_list?module=94&type=1)

```
$orders = $client->Order->getOrderList([
    'order_status' => 'READY_TO_SHIP',
    'page_size' => 50,
]);
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance73

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 81.8% 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 ~35 days

Recently: every ~56 days

Total

33

Last Release

144d ago

Major Versions

v0.4.0 → v1.0.02024-05-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/7086b3bf4e8970e697e84056b9eff99021a395697375cc1f03b3bafea63f3972?d=identicon)[nVuln](/maintainers/nVuln)

---

Top Contributors

[![nVuln](https://avatars.githubusercontent.com/u/54855446?v=4)](https://github.com/nVuln "nVuln (18 commits)")[![Lishijie0](https://avatars.githubusercontent.com/u/51392302?v=4)](https://github.com/Lishijie0 "Lishijie0 (2 commits)")[![arffsaad](https://avatars.githubusercontent.com/u/80538339?v=4)](https://github.com/arffsaad "arffsaad (1 commits)")[![zt-pro](https://avatars.githubusercontent.com/u/21299738?v=4)](https://github.com/zt-pro "zt-pro (1 commits)")

---

Tags

shopeeshopee-apishopee-partners-apishopee-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ecomphp-shopee-php/health.svg)

```
[![Health](https://phpackages.com/badges/ecomphp-shopee-php/health.svg)](https://phpackages.com/packages/ecomphp-shopee-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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