Shop API Endpoints
The Shop APIs provide comprehensive endpoints for integrating loyalty programs with e-commerce platforms, POS systems, and online stores. These endpoints offer direct shop integration capabilities for customer-facing applications.All Shop API endpoints are automatically documented from the OpenAPI specification. The following provides an overview of available endpoint categories and their primary use cases.
Base URL
- Staging:
https://staging-api.loyalty.lt/{locale}/shop/
- Production:
https://api.loyalty.lt/{locale}/shop/
{locale}
is the language code (e.g., en
, lt
).
Authentication Categories
Customer Authentication
- Phone + OTP Login: Modern phone-based authentication flow
- User Registration: New customer onboarding with phone verification
- QR Code Login: Seamless mobile-to-desktop authentication
- Token Management: JWT refresh and session management
- Profile Management: User profile and preferences
POST /{locale}/shop/auth/request-otp
- Request OTP codePOST /{locale}/shop/auth/login
- Login with phone + OTPPOST /{locale}/shop/auth/register
- Register new userGET /{locale}/shop/auth/me
- Get current user detailsPUT /{locale}/shop/auth/profile
- Update user profile
Core Shop Features
Loyalty Cards Management
Complete loyalty card system for customer engagement and retention. Core Features:- Personal loyalty card creation and management
- Third-party card integration (existing store cards)
- Card balance tracking and history
- Digital card scanning and validation
GET /{locale}/shop/loyalty-cards
- List user’s loyalty cardsPOST /{locale}/shop/loyalty-cards
- Create new loyalty cardGET /{locale}/shop/loyalty-cards/{id}
- Get card detailsPOST /{locale}/shop/loyalty-cards/third-party
- Add existing store card
Points System
Flexible points management system for rewards and gamification. Core Features:- Points earning through purchases and activities
- Points redemption for rewards
- Bulk operations for high-volume scenarios
- Transaction history and balance tracking
- Points expiration management
GET /{locale}/shop/points
- List point transactionsPOST /{locale}/shop/points
- Award or deduct pointsGET /{locale}/shop/points/summary
- Points balance summaryPOST /{locale}/shop/points/bulk
- Bulk points operationsGET /{locale}/shop/points/card/{card_id}/balance
- Get card balance
Offers & Coupons System
Dynamic offer management with automated coupon generation. Offers Management:- Browse available offers by category
- Featured offers promotion
- Personalized offer recommendations
- Offer claiming and validation
- Active coupon tracking
- Expiration notifications
- Redemption processing
- Usage statistics and analytics
GET /{locale}/shop/offers
- List available offersGET /{locale}/shop/offers/featured
- Get featured offersPOST /{locale}/shop/offers/{id}/claim
- Claim offerGET /{locale}/shop/coupons
- List user couponsPOST /{locale}/shop/coupons/{id}/redeem
- Redeem coupon
Games & Gamification
Interactive games system for customer engagement and point earning. Game Types Supported:- Memory Games: Card matching and memory challenges
- Quiz Games: Knowledge-based point earning
- Spin Wheel: Random reward games
- Scratch Cards: Digital scratch-to-win games
- Stamp Collection: Visit-based loyalty games
- Real-time game sessions with WebSocket support
- Progress tracking and validation
- Reward claiming and distribution
- Game history and statistics
- Anti-cheat validation
GET /{locale}/shop/games
- List available gamesPOST /{locale}/shop/games/{id}/start
- Start game sessionPOST /{locale}/shop/games/sessions/{sessionKey}/progress
- Update progressPOST /{locale}/shop/games/sessions/{sessionKey}/claim-reward
- Claim rewardsGET /{locale}/shop/user/games/history
- Game history
Transaction History
Unified transaction tracking across all loyalty activities. Transaction Types:- Point transactions (earned/redeemed)
- Coupon activities (claimed/redeemed)
- Game rewards and achievements
- Offer interactions
- Card activities
- Comprehensive transaction history
- Export capabilities (CSV/JSON)
- Statistical summaries
- Advanced filtering and search
GET /{locale}/shop/transactions
- Get transaction historyGET /{locale}/shop/transactions/summary
- Transaction summaryPOST /{locale}/shop/transactions/export
- Export data
Shop Management
Tools for managing multiple store locations and analytics. Management Features:- Multi-store support
- Location-based services
- Store analytics and reporting
- Import/export capabilities
- Performance metrics
GET /{locale}/shop/shops
- List shopsGET /{locale}/shop/shops/nearby
- Find nearby shopsGET /{locale}/shop/shops/{id}/analytics
- Shop analyticsPOST /{locale}/shop/shops/import
- Bulk importPOST /{locale}/shop/shops/export
- Data export
Integration Features
XML Import System
Bulk data import system for migrating existing customer and transaction data. Import Capabilities:- Customer data migration
- Transaction history import
- Points balance initialization
- Loyalty card bulk creation
- Data validation and mapping
POST /{locale}/shop/xml-import/from-url
- Import from URLPOST /{locale}/shop/xml-import/from-file
- Upload and importGET /{locale}/shop/xml-import/history
- Import historyPOST /{locale}/shop/xml-import/validate
- Validate XML structure
Common Features
Authentication Methods
- API Credentials: Server-side authentication using X-API-Key and X-API-Secret headers
- JWT Tokens: User session authentication for customer-facing operations
- Partner Authentication: Integrated with partner API auth middleware
Rate Limits
- Standard Rate: 1000 requests per hour per API key
- Burst Allowance: Up to 100 requests per minute
- Premium Limits: Higher limits available for enterprise customers
Response Format
All endpoints return consistent JSON responses:Error Handling
- 400: Validation errors with detailed field information
- 401: Authentication required or invalid credentials
- 403: Insufficient permissions for operation
- 404: Resource not found
- 429: Rate limit exceeded
- 500: Server errors with error tracking
Health Check
Monitor API availability:GET /shop/health
- Service health status
Next Steps
Authentication Guide
Learn how to authenticate requests using API credentials or JWT tokens
Error Handling
Understand error responses and implement proper error handling
All endpoint details, request/response schemas, and examples are automatically generated from the OpenAPI specification. Use the interactive API reference to test endpoints and view complete documentation.