Skip to main content

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

1

Access Partners Portal

Go to partners.loyalty.lt and log in.
2

Navigate to API Credentials

Click API Credentials in the sidebar.
3

Generate Credentials

Click Generate New Credentials.
4

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