Loyalty.lt API Reference

Welcome to the comprehensive Loyalty.lt API documentation. Our REST API enables you to integrate loyalty programs, manage customer relationships, and build powerful e-commerce experiences.
Interactive Documentation: All API endpoints below are automatically generated from our OpenAPI specification. You can test endpoints directly in your browser with real API responses.

API Overview

The Loyalty.lt API is organized into three main service layers, each designed for specific use cases and integration patterns:

Shop Integration APIs

Direct integration endpoints for e-commerce platforms, POS systems, and customer-facing applications. Primary Use Cases:
  • E-commerce platform integration (WooCommerce, Shopify, custom stores)
  • POS system connectivity
  • Mobile app backends
  • Customer loyalty portals
Key Features:
  • Phone + OTP authentication flow
  • Loyalty card management
  • Points earning and redemption
  • Offers and coupons system
  • Interactive games and gamification
  • Transaction history and analytics
  • XML import for data migration
Base Path: /{locale}/shop/

Partner APIs

Management endpoints for loyalty program partners, agencies, and multi-store operations. Primary Use Cases:
  • Partner dashboard management
  • Multi-store loyalty programs
  • White-label solutions
  • Agency client management
  • Enterprise analytics and reporting
Key Features:
  • Partner authentication and management
  • Store and location management
  • Staff and permissions system
  • Advanced analytics and reporting
  • White-label customization
  • Bulk operations and data export
Base Path: /{locale}/partners/

Base URLs

EnvironmentURLDescription
Staginghttps://staging-api.loyalty.ltDevelopment and testing
Productionhttps://api.loyalty.ltLive production environment
All endpoints require a locale parameter (e.g., en, lt) in the URL path.

Authentication Methods

Server-side authentication for backend integrations:
curl -X GET "https://staging-api.loyalty.lt/en/shop/loyalty-cards" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"
Use for:
  • E-commerce platform integrations
  • Server-to-server communication
  • Automated systems and cron jobs

Rate Limits

Authentication TypeRequests/HourBurst LimitNotes
API Credentials2,000100/minHigher limits for enterprise
JWT Tokens1,00060/minPer user session
Partner APIs5,000200/minAdvanced partner features
Rate limits are automatically managed. Use bulk endpoints for high-volume operations to optimize performance.

Response Format

All API endpoints return consistent JSON responses:
{
  "success": true,
  "message": "Operation completed successfully",
  "data": {
    // Response data object
  }
}
Error Response:
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR",
  "errors": {
    "field_name": ["Error message"]
  }
}

HTTP Status Codes

CodeMeaningUsage
200OKSuccessful GET, PUT, PATCH
201CreatedSuccessful POST (resource created)
400Bad RequestValidation errors, malformed requests
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions
404Not FoundResource doesn’t exist
422Unprocessable EntityBusiness logic validation failed
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer-side errors (rare)

Pagination

List endpoints use consistent pagination:
{
  "success": true,
  "data": {
    "data": [...],
    "current_page": 1,
    "per_page": 15,
    "total": 150,
    "last_page": 10
  }
}
Query Parameters:
  • page - Page number (default: 1)
  • per_page - Items per page (default: 15, max: 50)

Filtering and Sorting

Most list endpoints support filtering and sorting:
# Filter and sort examples
GET /en/shop/transactions?type=points&status=completed&sort=-created_at
GET /en/shop/offers?category=food&featured=true&page=2

Webhooks

Real-time event notifications for critical activities: Available Events:
  • customer.registered - New customer registration
  • points.awarded - Points added to account
  • coupon.redeemed - Coupon usage
  • game.completed - Game session finished
  • card.created - New loyalty card
Webhook Configuration: Configure webhooks through the Partner Dashboard or API.

Available SDKs

JavaScript/TypeScript

npm install @loyalty-lt/sdk

Python

pip install loyalty-lt

PHP

composer require loyalty-lt/sdk

Getting Started

1

Get API Credentials

  1. Sign up for a Partner account at partners.loyalty.lt
  2. Navigate to API Settings
  3. Generate your API credentials
2

Choose Your Integration

  • Shop APIs: For direct e-commerce integration
  • Partner APIs: For multi-store management
3

Test Authentication

curl -X GET "https://staging-api.loyalty.lt/shop/health" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"
4

Explore Endpoints

Use the interactive documentation below to test API endpoints and understand responses.

Support Resources


Interactive API Explorer: The sections below provide automatically generated, interactive documentation for all available endpoints. You can test requests directly and see real responses.