Shop API Overview
The Shop API enables e-commerce platforms and POS systems to integrate with the Loyalty.lt loyalty system. Award points, redeem rewards, and manage customer loyalty cards programmatically.
Base URL
| Environment | URL |
|---|
| Staging | https://staging-api.loyalty.lt/{locale}/shop/ |
| Production | https://api.loyalty.lt/{locale}/shop/ |
Replace {locale} with language code: en or lt
Authentication Types
The Shop API uses two authentication methods depending on the endpoint:
Shop API (Server-to-Server)
For backend integrations (WooCommerce, Shopify, POS systems):
curl -X POST "https://staging-api.loyalty.lt/en/shop/transactions/create" \
-H "X-API-Key: your_api_key" \
-H "X-API-Secret: your_api_secret" \
-H "Content-Type: application/json"
| Header | Description |
|---|
X-API-Key | Your API key |
X-API-Secret | Your API secret |
Get your API credentials from the Partners Portal → API Credentials
User JWT (Mobile/Frontend)
For user-facing applications:
curl -X GET "https://staging-api.loyalty.lt/en/shop/auth/me" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1..."
Endpoint Categories
Authentication Endpoints
| Method | Endpoint | Auth | Description |
|---|
POST | /validate-credentials | Partner | Verify API credentials |
GET | /auth/me | JWT | Get current user |
POST | /auth/qr-login/generate | Partner | Generate QR session |
POST | /auth/qr-login/poll/{session_id} | Partner | Poll session status |
POST | /ably/token | Partner | Get Ably WebSocket token |
POST | /auth/send-app-link | Partner | Send app download SMS |
Loyalty Cards Endpoints
| Method | Endpoint | Auth | Description |
|---|
GET | /loyalty-cards | Partner | List loyalty card templates |
GET | /loyalty-cards/{id} | Partner | Get specific card template |
GET | /loyalty-cards/info | Partner | Get full card details by number/ID |
GET | /loyalty-cards/balance | Partner | Get points balance only |
POST | /loyalty-cards | JWT | Create user loyalty card |
GET | /loyalty-cards/{user_id} | JWT | Get user’s cards |
Transaction Endpoints
| Method | Endpoint | Auth | Description |
|---|
POST | /transactions/create | Partner | Create transaction and award points |
POST | /transactions/award-points | Partner | Alias for create transaction |
POST | /transactions/deduct-points | Partner | Deduct points (refunds) |
GET | /transactions | JWT | List user transactions |
GET | /transactions/{id} | JWT | Get transaction details |
Shops Endpoints
| Method | Endpoint | Auth | Description |
|---|
GET | /shops | Partner | List partner shops/locations |
Offers Endpoints
| Method | Endpoint | Auth | Description |
|---|
GET | /offers | JWT | List available offers |
GET | /categories | Partner | List offer categories |
GET | /sync-status | Partner | Get offer sync status |
Products Endpoints
| Method | Endpoint | Auth | Description |
|---|
GET | /products/categories | Partner | Get product categories |
GET | /products/sync-status | Partner | Get product sync status |
XML Import Endpoints
| Method | Endpoint | Auth | Description |
|---|
POST | /xml-import/from-url | Partner | Import from URL |
POST | /xml-import/from-file | Partner | Import from file upload |
POST | /xml-import/validate | Partner | Validate XML structure |
GET | /xml-import/stats | Partner | Get import statistics |
All endpoints return JSON with consistent structure:
Success Response
{
"success": true,
"message": "Operation completed successfully",
"data": { ... },
"meta": {
"current_page": 1,
"total": 100
}
}
Error Response
{
"success": false,
"message": "Error description",
"code": "ERROR_CODE",
"errors": {
"field": ["Validation message"]
}
}
HTTP Status Codes
| Code | Description |
|---|
200 | Success |
201 | Created |
400 | Bad Request / Validation Error |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Conflict (duplicate) |
422 | Unprocessable Entity |
429 | Too Many Requests |
500 | Server Error |
Rate Limits
All API requests are limited to 60 requests per minute per API key or IP address.
Exceeding rate limits will result in 429 Too Many Requests responses. If you need higher limits, contact [email protected].
Support
For API support, email: [email protected]
Manage credentials at: https://partners.loyalty.lt