PHPackages                             trongprot1/lazada - 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. trongprot1/lazada

ActiveLibrary[API Development](/categories/api)

trongprot1/lazada
=================

Laravel package for interacting with Lazada API.

00PHP

Since Jan 14Pushed 5mo agoCompare

[ Source](https://github.com/trongprot1/lazada)[ Packagist](https://packagist.org/packages/trongprot1/lazada)[ RSS](/packages/trongprot1-lazada/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Laravel Wallet](./Banner.png)](./Banner.png)

Laravel Lazada
==============

[](#laravel-lazada)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bca0ec169bb071da07c68e82a3ff371eccdcd6b3f022a00fa160b5463b3ef3dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172616469747a2f6c617a6164612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/lazada)[![Total Downloads](https://camo.githubusercontent.com/a2c0e759e0657ff07e0077edb1446549d65a465e143967511f3072357d80b02d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172616469747a2f6c617a6164612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/lazada)[![GitHub Actions](https://github.com/laraditz/lazada/actions/workflows/main.yml/badge.svg)](https://github.com/laraditz/lazada/actions/workflows/main.yml/badge.svg)

Laravel package for interacting with Lazada API.

Requirements
------------

[](#requirements)

- PHP 8.1 and above.
- Laravel 9 and above.

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

[](#installation)

You can install the package via composer:

```
composer require laraditz/lazada
```

Before Start
------------

[](#before-start)

Configure your variables in your `.env` (recommended) or you can publish the config file and change it there.

```
LAZADA_APP_KEY=
LAZADA_APP_SECRET=
LAZADA_SELLER_ID=MYXXXXXXXX

```

(Optional) You can publish the config file via this command:

```
php artisan vendor:publish --provider="Laraditz\Lazada\LazadaServiceProvider" --tag="config"
```

Run the migration command to create the necessary database table.

```
php artisan migrate
```

On Lazada Open Platform, configure this **App Callback URL** on your App Management section. Once seller has authorized the app, it will redirect to this URL. Under the hood, it will call API to generate access token so that you do not have to call it manually. If you want to use your own **App Callback URL**, you may specify `LAZADA_APP_CALLBACK_URL` in your `.env`, but you need to manually call the `accessToken()` API to update the access token in your record.

```
// App Callback URL
https://your-app-url.com/lazada/seller/authorized

```

Available Methods
-----------------

[](#available-methods)

Below are all methods available under this package. Parameters for all method calls will follow exactly as in [Lazada Open Platform Documentation](https://open.lazada.com/apps/doc/api).

Service nameMethod nameDescriptionauth()authorizationUrl()Get the authorization URL for seller. Seller needs to login and authorized the app.accessToken()Generate access token for API call.refreshToken()Refresh access token before it expired.accessTokenWithOpenId()Generate access token with openId for API call.seller()get()Get seller information by current seller ID.pickUpStoreList()Return the list of pick up store infomation for requested Seller.order()list()Get an order list from specified date range.get()Get single order detail by order ID.items()Get the item information of an order.finance()payoutStatus()Get your transaction statements created after the provided date.accountTransactions()Query Account Transactions.logisticsFeeDetail()Query logistics fee details from slb.transactionDetail()Query seller transaction details within specific date range.Usage
-----

[](#usage)

You can use service container to make an api call

```
app('lazada')->auth()->authorizationUrl(); // give URL to seller to authorize app
app('lazada')->order()->get(order_id: '16090'); // get specific order
```

or you can use facade

```
use Lazada;
use Laraditz\Lazada\Exceptions\LazadaAPIError;

try {
    // Generate access token. Get the code after seller has authorized the app.
    $accessToken = Lazada::auth()->accessToken(code: '0_123456_XxxXXXXxxXXxxXXXXxxxxxxXXXXxx');
} catch (LazadaAPIError $e) {
    // Catch API Error
    // $e->getMessage()
    // $e->getMessageCode()
    // $e->getRequestId()
    // $e->getResult() // raw response
    throw $e;
} catch (\Throwable $th) {
    throw $th;
}

// Get order list
Lazada::order()->list(created_after: '2023-11-17T00:00:00+08:00');
```

Event
-----

[](#event)

This package also provide an event to allow your application to listen for Lazada web push. You can create your listener and register it under event below.

EventDescriptionLaraditz\\Lazada\\Events\\WebPushReceivedReceive a push content from Lazada.Read more about Lazada Push Mechanism (LPM) [here](https://open.lazada.com/apps/doc/doc?nodeId=29526&docId=120168).

Webhook URL
-----------

[](#webhook-url)

You may setup the Callback URL below on Lazada Open API dashboard, under the Push Mecahnism section so that Lazada will push all content update to this url and trigger the `WebPushReceived` event above.

```
https://your-app-url.com/lazada/webhooks

```

Commands
--------

[](#commands)

```
lazada:flush-expired-token    Flush expired access token.
lazada:refresh-token          Refresh existing access token before it expired.
```

As Lazada access token has an expired date, you may want to set `lazada:refresh-token` on scheduler and run it before it expires to refresh the access token. Otherwise, you need the seller to reauthorize and generate a new access token.

#### Token Duration

[](#token-duration)

Live

- Access token: 30 days
- Refresh token: 180 days

Testing

- Access token: 7 days
- Refresh token: 30 days

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Raditz Farhan](https://github.com/laraditz)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance48

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1205d00fd614b7301908befe0e23868495ee802e7d5db015d2b3fcbfbd7b9e94?d=identicon)[trongprot1](/maintainers/trongprot1)

---

Top Contributors

[![raditzfarhan](https://avatars.githubusercontent.com/u/1203676?v=4)](https://github.com/raditzfarhan "raditzfarhan (12 commits)")[![trongprot1](https://avatars.githubusercontent.com/u/11588670?v=4)](https://github.com/trongprot1 "trongprot1 (3 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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