GET
/
{locale}
/
shop
/
loyalty-cards
curl -X GET "https://staging-api.loyalty.lt/en/shop/loyalty-cards?page=1&per_page=15&status=active" \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json"
{
  "success": true,
  "data": {
    "data": [
      {
        "id": 123,
        "card_number": "LC****4567",
        "card_type": "personal",
        "status": "active",
        "shop": {
          "id": 45,
          "name": "Coffee Paradise",
          "logo_url": "https://api.loyalty.lt/storage/logos/coffee-paradise.png"
        },
        "balance": {
          "points": 1250,
          "tier": "Gold",
          "tier_progress": 75
        },
        "created_at": "2024-01-01T10:00:00Z",
        "last_used_at": "2024-01-15T14:30:00Z"
      },
      {
        "id": 124,
        "card_number": "TP****8901",
        "card_type": "third_party",
        "status": "active",
        "shop": {
          "id": 67,
          "name": "Fashion Store",
          "logo_url": "https://api.loyalty.lt/storage/logos/fashion-store.png"
        },
        "balance": {
          "points": 890,
          "tier": "Silver",
          "tier_progress": 45
        },
        "created_at": "2024-01-10T09:15:00Z",
        "last_used_at": "2024-01-14T16:20:00Z"
      }
    ],
    "current_page": 1,
    "per_page": 15,
    "total": 5,
    "last_page": 1
  }
}

List Loyalty Cards

Retrieve a paginated list of the authenticated user’s loyalty cards, including both personal cards and third-party integrated cards.
This endpoint requires JWT authentication. Cards are returned with their current status, balance information, and associated shop details.

Path Parameters

locale
string
required
Language code for localized content (e.g., “en”, “lt”)

Query Parameters

page
integer
Page number for pagination (default: 1)
per_page
integer
Number of items per page (default: 15, max: 50)
status
string
Filter cards by status
  • active - Active cards only
  • inactive - Inactive cards only
  • all - All cards (default)
type
string
Filter cards by type
  • personal - User-created cards
  • third_party - Integrated external cards
  • all - All types (default)

Response

success
boolean
Indicates if the request was successful
data
object
curl -X GET "https://staging-api.loyalty.lt/en/shop/loyalty-cards?page=1&per_page=15&status=active" \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json"
{
  "success": true,
  "data": {
    "data": [
      {
        "id": 123,
        "card_number": "LC****4567",
        "card_type": "personal",
        "status": "active",
        "shop": {
          "id": 45,
          "name": "Coffee Paradise",
          "logo_url": "https://api.loyalty.lt/storage/logos/coffee-paradise.png"
        },
        "balance": {
          "points": 1250,
          "tier": "Gold",
          "tier_progress": 75
        },
        "created_at": "2024-01-01T10:00:00Z",
        "last_used_at": "2024-01-15T14:30:00Z"
      },
      {
        "id": 124,
        "card_number": "TP****8901",
        "card_type": "third_party",
        "status": "active",
        "shop": {
          "id": 67,
          "name": "Fashion Store",
          "logo_url": "https://api.loyalty.lt/storage/logos/fashion-store.png"
        },
        "balance": {
          "points": 890,
          "tier": "Silver",
          "tier_progress": 45
        },
        "created_at": "2024-01-10T09:15:00Z",
        "last_used_at": "2024-01-14T16:20:00Z"
      }
    ],
    "current_page": 1,
    "per_page": 15,
    "total": 5,
    "last_page": 1
  }
}

Usage Examples

Basic Card Listing

// Get all active cards
const activeCards = await fetch('/en/shop/loyalty-cards?status=active');

// Get personal cards only
const personalCards = await fetch('/en/shop/loyalty-cards?type=personal');

// Paginate through large collections
const page2 = await fetch('/en/shop/loyalty-cards?page=2&per_page=20');

Card Management Dashboard

// Build a card overview dashboard
async function loadUserDashboard() {
  const response = await fetch('/en/shop/loyalty-cards');
  const data = await response.json();
  
  if (data.success) {
    const totalPoints = data.data.data.reduce((sum, card) => 
      sum + card.balance.points, 0);
    
    const goldCards = data.data.data.filter(card => 
      card.balance.tier === 'Gold').length;
    
    console.log(`Total Points: ${totalPoints}`);
    console.log(`Gold Status Cards: ${goldCards}`);
  }
}
Card balances are updated in real-time. The tier_progress indicates how close the user is to reaching the next loyalty tier (0-100%).