Skip to main content

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

EnvironmentURL
Staginghttps://staging-api.loyalty.lt/{locale}/shop/
Productionhttps://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"
HeaderDescription
X-API-KeyYour API key
X-API-SecretYour 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

MethodEndpointAuthDescription
POST/validate-credentialsPartnerVerify API credentials
GET/auth/meJWTGet current user
POST/auth/qr-login/generatePartnerGenerate QR session
POST/auth/qr-login/poll/{session_id}PartnerPoll session status
POST/ably/tokenPartnerGet Ably WebSocket token
POST/auth/send-app-linkPartnerSend app download SMS

Loyalty Cards Endpoints

MethodEndpointAuthDescription
GET/loyalty-cardsPartnerList loyalty card templates
GET/loyalty-cards/{id}PartnerGet specific card template
GET/loyalty-cards/infoPartnerGet full card details by number/ID
GET/loyalty-cards/balancePartnerGet points balance only
POST/loyalty-cardsJWTCreate user loyalty card
GET/loyalty-cards/{user_id}JWTGet user’s cards

Transaction Endpoints

MethodEndpointAuthDescription
POST/transactions/createPartnerCreate transaction and award points
POST/transactions/award-pointsPartnerAlias for create transaction
POST/transactions/deduct-pointsPartnerDeduct points (refunds)
GET/transactionsJWTList user transactions
GET/transactions/{id}JWTGet transaction details

Shops Endpoints

MethodEndpointAuthDescription
GET/shopsPartnerList partner shops/locations

Offers Endpoints

MethodEndpointAuthDescription
GET/offersJWTList available offers
GET/categoriesPartnerList offer categories
GET/sync-statusPartnerGet offer sync status

Products Endpoints

MethodEndpointAuthDescription
GET/products/categoriesPartnerGet product categories
GET/products/sync-statusPartnerGet product sync status

XML Import Endpoints

MethodEndpointAuthDescription
POST/xml-import/from-urlPartnerImport from URL
POST/xml-import/from-filePartnerImport from file upload
POST/xml-import/validatePartnerValidate XML structure
GET/xml-import/statsPartnerGet import statistics

Response Format

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

CodeDescription
200Success
201Created
400Bad Request / Validation Error
401Unauthorized
403Forbidden
404Not Found
409Conflict (duplicate)
422Unprocessable Entity
429Too Many Requests
500Server 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