Download the PHP package laraditz/lazada without Composer
On this page you can find all versions of the php package laraditz/lazada. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laraditz/lazada
More information about laraditz/lazada
Files in laraditz/lazada
Package lazada
Short Description Laravel package for interacting with Lazada API.
License MIT
Homepage https://github.com/laraditz/lazada
Informations about the package lazada
Laravel Lazada
A comprehensive Laravel package for seamless integration with the Lazada Open Platform API. This package provides a clean, intuitive interface for managing Lazada sellers, handling authentication, processing orders, managing products, and receiving webhooks.
Features
- 🔐 Complete Authentication Flow - Automatic token management with refresh capabilities
- 🏪 Multi-Seller Support - Manage multiple Lazada sellers within a single application
- 📦 Product Management - Retrieve products and update sellable stock quantities
- 🛒 Order Processing - Comprehensive order management and document retrieval
- 💰 Finance & Transactions - Query payout status, account transactions, and finance details
- 📡 Webhook Integration - Real-time push event handling with built-in endpoints
- 🗄️ Database Logging - Automatic request/response logging for debugging and monitoring
- 🔄 Auto Token Refresh - Scheduled token refresh to maintain API connectivity
Requirements
- PHP 8.2 and above.
- Laravel 10 and above.
Installation
You can install the package via composer:
Quick Start
1. Lazada App Setup
Before using this package, you need a Lazada Open Platform app:
- Visit Lazada Open Platform
- Create a new app or use an existing one
- Note your
App KeyandApp Secret - Configure the App Callback URL:
https://your-app-url.com/lazada/seller/authorized
2. Environment Configuration
Add your Lazada credentials to your .env file:
3. Publish Migration
4. Run Migration
5. Configuration (Optional)
6. Authorization Flow
To authorize a seller:
-
Generate and share the authorization URL with the seller:
- The seller logs in and authorizes your app
- Lazada redirects to
https://your-app-url.com/lazada/seller/authorized - The package automatically handles the token exchange and storage
- The seller is now ready for API calls
Note: Lazada rejects a url-encoded
redirect_uri, soauthorizationUrl()passes the callback URL as-is. Because of this, the callback URL (LAZADA_APP_CALLBACK_URLor the default/lazada/seller/authorizedroute) must not contain a query string. For example,https://your-app-url.com/callback?foo=1&bar=2would break the authorization URL, because&bar=2gets read as a separate parameter of the Lazada URL. Use a plain path instead, and make sure it exactly matches the App Callback URL configured in the Lazada Open Platform console.
Available Methods
Here's the full list of methods available in this package. Parameters follow the Lazada Open Platform Documentation exactly. Common parameters like app_key, sign, timestamp, and access_token are added automatically.
Authentication Service auth()
| Method | Description |
|---|---|
authorizationUrl() |
Get the authorization URL to share with the seller. |
accessToken() |
Exchange an authorization code for an access token. |
refreshToken() |
Refresh an access token before it expires. |
accessTokenWithOpenId() |
Generate an access token using an OpenID. |
Seller Service seller()
| Method | Description |
|---|---|
get() |
Fetch seller information from Lazada API and sync to DB. |
info() |
Return the resolved LazadaSeller model for the current context. |
pickUpStoreList() |
Return the list of pick-up store information for the seller. |
Order Service order()
| Method | Description |
|---|---|
list() |
Get an order list from a specified date range. |
get() |
Get single order detail by order ID. |
items() |
Get the item information of an order. |
document() |
Retrieve order-related documents (invoices, shipping labels). |
Finance Service finance()
| Method | Description |
|---|---|
payoutStatus() |
Get transaction statements created after the provided date. |
accountTransactions() |
Query account transactions. |
logisticsFeeDetail() |
Query logistics fee details. |
transactionDetail() |
Query seller transaction details within a specific date range. |
Product Service product()
| Method | Description |
|---|---|
get() |
Get the product list for the seller. |
item() |
Get a single product item by item ID. |
updateSellableQuantity() |
Update sellable stock quantity for a SKU. |
Usage Examples
Basic Usage
Authentication
Working with Orders
Working with Products
Working with Finance
Working with Sellers
Multi-Seller Support
By default the package uses LAZADA_SELLER_SHORT_CODE from your .env. For multi-seller applications, specify the seller per request:
Error Handling
Events & Webhooks
Webhook URL
Configure this URL in your Lazada Open Platform App Management under the Push Mechanism section so Lazada pushes content updates to your app:
Available Events
| Event | Description |
|---|---|
Laraditz\Lazada\Events\WebPushReceived |
Triggered when Lazada sends a web push. |
Creating Event Listeners
Register the listener in your EventServiceProvider (Laravel 10 and below):
Read more about the Lazada Push Mechanism (LPM) in the official documentation.
Token Management
Artisan Commands
Automated Token Refresh
Set up scheduled token refresh in your app/Console/Kernel.php:
Token Lifecycle
| Environment | Token Type | Duration |
|---|---|---|
| Live | Access Token | 30 days |
| Live | Refresh Token | 180 days |
| Testing | Access Token | 7 days |
| Testing | Refresh Token | 30 days |
Important: If both tokens expire, the seller must re-authorize your app to generate a new token pair.
Testing
Changelog
Please see CHANGELOG for more information about recent changes.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security vulnerabilities, please email [email protected] instead of using the issue tracker.
Support
Credits
- Raditz Farhan - Creator and maintainer
- All Contributors - Thank you for your contributions!
License
The MIT License (MIT). Please see License File for more information.
All versions of lazada with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
