SDKsPHP
Installation
Install the official Loyalty.lt PHP SDK
Installation
The official Loyalty.lt PHP SDK for Shop API integration.
Composer
composer require loyaltylt/sdkRequirements
- PHP 8.1 or higher
- ext-json
- Guzzle HTTP client (installed automatically)
Quick Start
<?php
require_once 'vendor/autoload.php';
use LoyaltyLt\SDK\LoyaltySDK;
$sdk = new LoyaltySDK([
'apiKey' => 'lty_your_api_key',
'apiSecret' => 'your_api_secret',
'environment' => 'production', // or 'staging'
'locale' => 'lt',
]);
// Test connection
$shops = $sdk->getShops();
print_r($shops['data']);Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | API Key |
apiSecret | string | required | API Secret |
environment | string | production | production or staging |
locale | string | lt | API locale (lt, en) |
timeout | int | 30 | Request timeout in seconds |
retries | int | 3 | Number of retry attempts |
debug | bool | false | Enable debug logging |
Getting API Credentials
Access Partners Portal
Go to partners.loyalty.lt and log in.
Navigate to API Credentials
Click API Credentials in the sidebar.
Generate Credentials
Click Generate New Credentials.
Copy Credentials
Copy API Key (lty_...) and API Secret. Store securely!
Never expose your API Secret in client-side code. The SDK is designed for server-to-server communication.
Next Steps
Learn common SDK operations
QR Login and Card Scan