Loyalty.lt
SDKsPHP

Installation

Install and configure the PHP SDK

Installation

composer require loyaltylt/sdk

Requires 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();
KeyTypeDefaultDescription
apiKeystring—API key, lty_... (required)
apiSecretstring—API secret (required)
environmentstring'production'production or staging
localestring'lt'lt or en
timeoutint30Request timeout, seconds
retriesint3Retry attempts for 429 and 5xx
debugboolfalseLog 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

On this page