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

ActiveLibrary[API Development](/categories/api)

ecomphp/lazada-php
==================

A powerful, lightweight, and developer-friendly Lazada API PHP SDK designed to integrate Lazada Open Platform into vanilla PHP applications, Laravel, or Symfony projects.

v1.0.1(1mo ago)41392Apache-2.0PHPPHP &gt;=7.4CI passing

Since Oct 6Pushed 1mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (10)Used By (0)

Lazada API PHP SDK — Modern PHP Client for Lazada Open Platform
===============================================================

[](#lazada-api-php-sdk--modern-php-client-for-lazada-open-platform)

[![Total Downloads](https://camo.githubusercontent.com/09ac5000377f48feb9cc435d9e41ee49a91de75b36b3c62a55be29e6d7b8851d/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f6c617a6164612d7068702f646f776e6c6f616473)](https://packagist.org/packages/ecomphp/lazada-php)[![Latest Stable Version](https://camo.githubusercontent.com/0f75ffb2a6ae1c3579a279e215fc1002ab35030f81a2a366a89774de19c3af8b/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f6c617a6164612d7068702f762f737461626c65)](https://packagist.org/packages/ecomphp/lazada-php)[![Latest Unstable Version](https://camo.githubusercontent.com/da906305d7a5fab27a7e264acc6f554217873db838a153ccfc65c53d8b0f668d/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f6c617a6164612d7068702f762f756e737461626c65)](https://packagist.org/packages/ecomphp/lazada-php)[![License](https://camo.githubusercontent.com/7595535494cc008069689bcf8e66875fc068e576880f8fbc5664e84b30293787/68747470733a2f2f706f7365722e707567782e6f72672f65636f6d7068702f6c617a6164612d7068702f6c6963656e7365)](https://packagist.org/packages/ecomphp/lazada-php)

A powerful, lightweight, and developer-friendly **Lazada API PHP SDK** designed to integrate **Lazada Open Platform** into vanilla PHP applications, Laravel, or Symfony projects.

Easily manage Lazada OAuth authentication, automate access token generation, refresh tokens, sync products, fetch orders, and call seller APIs with minimal configuration.

---

📦 Installation
--------------

[](#-installation)

Install the **Lazada PHP Client** via [Composer](https://getcomposer.org/):

```
composer require ecomphp/lazada-php
```

---

🛠️ Configuration &amp; Setup
----------------------------

[](#️-configuration--setup)

Initialize the **Lazada Client** using your app credentials provided by the Lazada Open Platform Console:

```
use EcomPHP\Lazada\Client;

$app_key = 'your_app_key_here';
$app_secret = 'your_app_secret_here';
$callback_url = 'https://your-app.com/lazada/callback';

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

The SDK supports Lazada regions: `vn`, `sg`, `my`, `th`, `ph`, and `id`.

---

🔐 Lazada API OAuth Authentication
---------------------------------

[](#-lazada-api-oauth-authentication)

The SDK provides a dedicated `Auth` class to handle Lazada's OAuth authorization flow, access tokens, and refresh tokens.

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

### Step 1: Create the Authentication Request URL

[](#step-1-create-the-authentication-request-url)

Generate the authorization redirect URL for the seller to grant permissions:

```
$state = 'your-csrf-or-tracking-state';
$country = 'vn'; // Optional: vn, sg, my, th, ph, id

// Returns the Lazada authentication URL instead of auto-redirecting
$authUrl = $auth->createAuthRequest($state, $country, true);

// Redirect user to Lazada Authorization page
header('Location: ' . $authUrl);
exit;
```

### Step 2: Handle Redirect Callback &amp; Fetch Access Token

[](#step-2-handle-redirect-callback--fetch-access-token)

Once authorized, Lazada redirects the user back to your callback URL with an authorization code. Exchange it for your API tokens:

```
$authorization_code = $_GET['code'];

// Exchange code for Access Token & Refresh Token
$token = $auth->getToken($authorization_code);

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

// IMPORTANT: Save your access_token, refresh_token, and seller region to your database for later use
```

### Step 3: Set Authorized Seller Credentials

[](#step-3-set-authorized-seller-credentials)

To make authorized calls on behalf of a specific seller, attach the access token and region to your client instance:

```
$access_token = 'your_stored_access_token';
$region = 'vn';

$client->setAccessToken($access_token, $region);
```

---

🔄 Refreshing Expired Access Tokens
----------------------------------

[](#-refreshing-expired-access-tokens)

Lazada access tokens expire. Automate token renewal using your persistent `refresh_token`:

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

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

---

🚀 Lazada API Usage Examples
---------------------------

[](#-lazada-api-usage-examples)

> **Note:** A valid `access_token` and seller `region` are required to interact with seller-level data.

### 1. Get Product List

[](#1-get-product-list)

Fetch product information from your Lazada store:

```
$products = $client->Product->GetProducts([
    'offset' => 0,
    'limit' => 50,
    'filter' => 'all',
]);
```

### 2. Get Product Item

[](#2-get-product-item)

Retrieve a single product by Lazada item ID:

```
$product = $client->Product->GetProductItem('123456789');
```

### 3. Get Order List &amp; Order Items

[](#3-get-order-list--order-items)

Retrieve recent orders and their order items:

```
$orders = $client->Order->GetOrders([
    'created_after' => '2026-07-01T00:00:00+0800',
    'status' => 'pending',
]);

$orderItems = $client->Order->GetOrderItems('123456789');
```

### 4. Update Order Status to Ready to Ship

[](#4-update-order-status-to-ready-to-ship)

Set order items as ready to ship:

```
$result = $client->Order->SetStatusToReadyToShip(
    ['123456789'],
    'Dropshipping Provider',
    'TRACKING_NUMBER'
);
```

---

🧩 Available API Resources
-------------------------

[](#-available-api-resources)

The client exposes Lazada API groups as resource properties, including:

- `System`
- `Seller`
- `Order`
- `Finance`
- `Product`
- `ProductReview`
- `StoreDecoration`
- `MediaCenter`
- `Flexicombo`
- `SellerVoucher`
- `FreeShipping`
- `ReturnAndRefund`
- `Fulfillment`
- `Logistic`
- `LazadaLogistics`
- `Wallet`
- `SponsoredSolutions`
- `ServiceMarket`
- `LazLive`
- `Content`

Example:

```
$categoryTree = $client->Product->GetCategoryTree();
$sellerInfo = $client->Seller->GetSeller();
```

---

🧪 Testing
---------

[](#-testing)

Run the test suite with Composer:

```
composer test
```

---

🤝 Contributing
--------------

[](#-contributing)

Contributions, feature suggestions, and bug reports for the **ecomphp/lazada-php** client are highly appreciated. Feel free to open issues or submit Pull Requests!

📄 License
---------

[](#-license)

This project is open-source software licensed under the [Apache License 2.0](LICENSE).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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 ~172 days

Recently: every ~338 days

Total

9

Last Release

32d ago

Major Versions

v0.2.0 → v1.0.02026-07-09

PHP version history (2 changes)v0.1.0PHP &gt;=7.2

v1.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/54855446?v=4)[nVuln](/maintainers/nVuln)[@nVuln](https://github.com/nVuln)

---

Tags

apiapi-clientlazadalazada-apilazada-sdkphpsdk

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k55](/packages/neuron-core-neuron-ai)[files.com/files-php-sdk

Files.com PHP SDK

2482.9k](/packages/filescom-files-php-sdk)[volcengine/volcengine-php-sdk

119.5k](/packages/volcengine-volcengine-php-sdk)

PHPackages © 2026

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