Unofficial PHP Wrapper for Lazada API
- Wraps Lazada API in PHP according to example shown here
- For complete API reference, including how to obtain API key, please go to the official documentation
~$ composer require zuragan/lazada-api-php
- GET
//Create API instance
$api = new LazadaAPI($baseUrl);
//Create action using factory, get or post action is supported
$factory = new ActionFactory($userEmail, $userAPIKey);
$action = $factory->getAction('ActionName', [ 'Parameter' => 'ParamValue' ]);
//Execute API Command
$response = $api->get($action);
//debug: dump response
var_dump($response);
- POST
//Create API instance
$api = new LazadaAPI($baseUrl);
//Create action using factory, get or post action is supported
$factory = new ActionFactory($userEmail, $userAPIKey);
$payload = [
"Attributes" => [
"name" => "Example",
"description" => "Short description",
],
];
$action = $factory->postAction('ActionName', [ 'Parameter' => 'ParamValue' ], $payload);
//Execute API Command
$response = $api->post($action);
//debug: dump response
var_dump($response);
- Due to PHP array limitation used in post payload when converting to XML format, multiple child element with same name cannot be generated (because PHP array keys must be unique)
- This is not an official SDK from Lazada
- This library may be changed without notice to keep it updated with Lazada's API
- This library is provided as is, without any warranty and can be broken anytime Lazada create breaking changes in their API.
- Error reporting/issues
- Use Github's issue tracker
- Code contribution
- Fork this repository
- Create pull request
- MIT