Skip to main content
GET
/
{locale}
/
shop
/
cards
/
{cardId}
/
games
Get Card Games
curl --request GET \
  --url https://api.example.com/{locale}/shop/cards/{cardId}/games
{
  "success": true,
  "message": "Card games retrieved successfully",
  "data": [
    {
      "id": 1,
      "name": {
        "lt": "Kavos kortelė",
        "en": "Coffee Card"
      },
      "game_type": "stamps",
      "is_active": true,
      "status": "active",
      "stamps_required": 8,
      "user_progress": {
        "current_step": 5,
        "completed": false,
        "completed_at": null,
        "history": [
          {
            "timestamp": "2024-01-15T10:30:00Z",
            "action": "stamp_added",
            "value": 1,
            "shop_id": 1
          }
        ]
      },
      "stamp_settings": {
        "stamps_required": 8,
        "reward_type": "free_product",
        "stamp_icon": "coffee"
      }
    }
  ]
}

Overview

Get all games available for a specific loyalty card, including user progress. This is useful for displaying games on a POS when a customer’s card has been scanned.

Authentication

This endpoint requires Partner API authentication with X-API-Key and X-API-Secret headers.

Parameters

cardId
integer
required
The loyalty card ID
shop_id
integer
Filter games by shop ID

Response

success
boolean
Indicates if the request was successful
data
array
Array of games with user progress
data[].id
integer
Game ID
data[].name
object
Localized game name
data[].game_type
string
Type of game
data[].status
string
Game status for this user: available, active, completed
data[].user_progress
object
User’s current progress in the game
data[].user_progress.current_step
integer
Current number of stamps/progress
data[].user_progress.completed
boolean
Whether the game is completed
data[].user_progress.completed_at
string
ISO 8601 timestamp when completed
{
  "success": true,
  "message": "Card games retrieved successfully",
  "data": [
    {
      "id": 1,
      "name": {
        "lt": "Kavos kortelė",
        "en": "Coffee Card"
      },
      "game_type": "stamps",
      "is_active": true,
      "status": "active",
      "stamps_required": 8,
      "user_progress": {
        "current_step": 5,
        "completed": false,
        "completed_at": null,
        "history": [
          {
            "timestamp": "2024-01-15T10:30:00Z",
            "action": "stamp_added",
            "value": 1,
            "shop_id": 1
          }
        ]
      },
      "stamp_settings": {
        "stamps_required": 8,
        "reward_type": "free_product",
        "stamp_icon": "coffee"
      }
    }
  ]
}

Example Request

curl -X GET "https://staging-api.loyalty.lt/en/shop/cards/123/games?shop_id=1" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -H "Accept: application/json"

SDK Example

import { LoyaltySDK } from '@loyaltylt/sdk';

const sdk = new LoyaltySDK({
  apiKey: 'your_api_key',
  apiSecret: 'your_api_secret',
});

// Get games for a customer's card
const games = await sdk.getCardGames(123, 1); // cardId, shopId
console.log(games);