Loyalty.lt
SDKsPHP

Installation

Install the official Loyalty.lt PHP SDK

Installation

The official Loyalty.lt PHP SDK for Shop API integration.

Composer

composer require loyaltylt/sdk

Requirements

  • 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

OptionTypeDefaultDescription
apiKeystringrequiredAPI Key
apiSecretstringrequiredAPI Secret
environmentstringproductionproduction or staging
localestringltAPI locale (lt, en)
timeoutint30Request timeout in seconds
retriesint3Number of retry attempts
debugboolfalseEnable 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

On this page