cURL
curl --request GET \ --url https://api.example.com/{locale}/shop/games/{id}/progress
{ "success": true, "message": "Game progress retrieved successfully", "data": { "game": { "id": 1, "name": { "lt": "Kavos kortelė", "en": "Coffee Card" }, "game_type": "stamps" }, "progress": { "current_step": 5, "completed": false, "completed_at": null, "history": [ { "timestamp": "2024-01-15T10:30:00Z", "action": "stamp_added", "value": 1, "shop_id": 1, "performed_by_staff": 42 }, { "timestamp": "2024-01-14T14:20:00Z", "action": "stamp_added", "value": 2, "shop_id": 1, "performed_by_staff": 42 } ] }, "stamps_required": 8, "stamp_settings": { "stamps_required": 8, "reward_type": "free_product", "product_name": "Cappuccino", "layout": "grid", "rows": 2, "columns": 4, "stamp_icon": "coffee", "stamp_icon_type": "icon", "background_color": "#f0f9ff", "text_color": "#0369a1", "punch_text": { "lt": "Perkite kavą ir gaukite antspaudą!", "en": "Buy coffee and get a stamp!" }, "reward_text": { "lt": "Nemokama kava!", "en": "Free coffee!" } } } }
Get detailed game progress for a customer
X-API-Key
X-API-Secret
curl -X GET "https://staging-api.loyalty.lt/en/shop/games/1/progress?card_id=123" \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" \ -H "Accept: application/json"
import { LoyaltySDK } from '@loyaltylt/sdk'; const sdk = new LoyaltySDK({ apiKey: 'your_api_key', apiSecret: 'your_api_secret', }); // Get detailed progress for a game const progress = await sdk.getGameProgress(1, 123); // gameId, cardId console.log(`Progress: ${progress.progress.current_step}/${progress.stamps_required}`); console.log('Stamp settings:', progress.stamp_settings);