SDKsPHP
Installation
Install and configure the PHP SDK
Installation
composer require loyaltylt/sdkRequires PHP 8.1 or newer and ext-json. Guzzle 7 is pulled in as a dependency.
Configure
use LoyaltyLt\SDK\LoyaltySDK;
$sdk = new LoyaltySDK([
'apiKey' => getenv('LOYALTY_API_KEY'),
'apiSecret' => getenv('LOYALTY_API_SECRET'),
'environment' => 'staging',
'locale' => 'lt',
]);
$sdk->validateCredentials();| Key | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | API key, lty_... (required) |
apiSecret | string | — | API secret (required) |
environment | string | 'production' | production or staging |
locale | string | 'lt' | lt or en |
timeout | int | 30 | Request timeout, seconds |
retries | int | 3 | Retry attempts for 429 and 5xx |
debug | bool | false | Log each request and response |
The base URL follows environment and cannot be set directly.
Get credentials from the Partners Portal → API Credentials. Staging and production credentials are separate.
Laravel
Register it as a singleton:
// app/Providers/AppServiceProvider.php
$this->app->singleton(LoyaltySDK::class, fn () => new LoyaltySDK([
'apiKey' => config('services.loyalty.key'),
'apiSecret' => config('services.loyalty.secret'),
'environment' => config('services.loyalty.env', 'production'),
]));Next
Points, cards, coupons, games
QR login and QR card scan