syscage / sdk-shopee-php
Framework-independent PHP SDK for the Shopee Open Platform.
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
Requires (Dev)
- illuminate/contracts: ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0
- orchestra/testbench: ^8.0 || ^9.0 || ^10.0
- phpunit/phpunit: ^10.5
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.0 || ^8.0
Suggests
- illuminate/support: Required to use the optional Laravel integration (Syscage\Sdk\Shopee\Laravel\ShopeeServiceProvider, Facade).
- symfony/config: Required to use the optional Symfony integration (Syscage\Sdk\Shopee\Symfony\ShopeeBundle).
- symfony/dependency-injection: Required to use the optional Symfony integration (Syscage\Sdk\Shopee\Symfony\ShopeeBundle).
- symfony/http-kernel: Required to use the optional Symfony integration (Syscage\Sdk\Shopee\Symfony\ShopeeBundle).
This package is auto-updated.
Last update: 2026-08-10 12:10:29 UTC
README
A framework-independent PHP SDK for the Shopee Open Platform.
Key Features
- Full coverage of the Shopee Open Platform API (Product, Order, Logistics, Payment, Ads, Livestream, and every other published API domain)
- Partner authentication, request signing, and the OAuth authorization flow
- A clean, typed HTTP client and consistent per-domain API clients
- Push Mechanism support (webhook signature verification and event parsing)
- A framework-independent Core SDK, usable in plain PHP
- Optional Laravel integration (Service Provider + Facade)
- Optional Symfony integration (Bundle + Dependency Injection)
Requirements
- PHP
^8.1 - A PSR-18 HTTP client (the SDK depends on
guzzlehttp/guzzleby default)
Installation
composer require syscage/sdk-shopee-php
Configuration
use Syscage\Sdk\Shopee\Core\Http\Auth\Credentials; $credentials = new Credentials( partnerId: 2001887, partnerKey: getenv('SHOPEE_PARTNER_KEY'), apiUrl: 'https://partner.shopeemobile.com', authUrl: 'https://open.shopee.com', );
Never hard-code your Partner Key — load it from the environment or a secrets manager.
Usage
use Syscage\Sdk\Shopee\Core\Shopee; $shopee = new Shopee($credentials); // 1. Send the seller to this URL to authorize your app. $authorizationUrl = $shopee->oauth()->getAuthorizationUrl('https://your-app.test/callback'); // 2. Once the seller is redirected back with ?code=...&shop_id=..., exchange it. $token = $shopee->oauth()->getAccessTokenForShop($code, $shopId); // 3. Persist $token yourself, then scope the client to it for API calls. $shopee = $shopee->withAccessToken($token); $info = $shopee->shop()->getShopInfo();
Frameworks
Laravel
Laravel integration is included (Service Provider, container bindings, and
a Shopee Facade), auto-discovered via Composer.
See the documentation for installation and configuration.
Symfony
Symfony integration is included (a Bundle and Dependency Injection extension — no static Facade, by design).
See the documentation for installation and configuration.
Documentation
For installation, configuration, authentication, the full API reference, Push Mechanism, Laravel, Symfony, sandbox usage, testing, and advanced usage:
Security
Never commit Partner Keys, Access Tokens, Refresh Tokens, or other secrets to source control.
License
MIT