PHP code example of timothydc / laravel-lightspeed-ecom-api

1. Go to this page and download the library: Download timothydc/laravel-lightspeed-ecom-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

timothydc / laravel-lightspeed-ecom-api example snippets

bash
php artisan vendor:publish --tag=lightspeed-ecom-api:config 
 php
// change API language
LightspeedEcomApi::setLanguage('en');

// change API key and secret
LightspeedEcomApi::setCredentials('key', 'secret');
 php
// get products
LightspeedEcomApi::products()->get();

// get single product
LightspeedEcomApi::products()->get(123456789);

// get filtered products
LightspeedEcomApi::products()->get(null, ['limit' => 250, 'page' => 1, 'since_id' => 123]);

// create product
LightspeedEcomApi::products()->create(['title' => 'my product']);

// update product
LightspeedEcomApi::products()->update(123456789, ['title' => 'my other product']);