timothydc / laravel-lightspeed-ecom-api
Connect with the Lightspeed eCom API
Installs: 1 342
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 1
Requires
- php: ^7.4|^8.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0|^11.0
- seoshop/seoshop-php: ^1.9.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- orchestra/testbench: *
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-11-04 16:12:08 UTC
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Installation
Via Composer:
composer require timothydc/laravel-lightspeed-ecom-api
Configuration
You can publish the config file with:
php artisan vendor:publish --tag=lightspeed-ecom-api:config
Usage
Interaction works the same as the Lightspeed API.
Authentication
// change API language LightspeedEcomApi::setLanguage('en'); // change API key and secret LightspeedEcomApi::setCredentials('key', 'secret');
Rate limits
By default, each API key caches its remaining calls and next reset time.
If you would like to disable this behavior, deactive this feature by setting save_remaining_calls_to_cache
to false
in config/lightspeed-ecom-api.php
.
// get max calls for your API keys LightspeedEcomApi::getMaxCalls(); // get Carbon with next reset time - from the cache LightspeedEcomApi::getResetTime(); // get Carbon with next reset time - from the last API response header LightspeedEcomApi::getResetTime(false); // get available API limits - from the cache LightspeedEcomApi::getRemainingCalls(); // get available API limits - from the last API response header LightspeedEcomApi::getRemainingCalls(false);
Calling resources
// 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']);
Testing
composer test
Security
If you discover any security related issues, please email mail@timothydc.be instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.