cURL
curl --request POST \ --url https://api.example.com/{locale}/shop/games/{id}/complete \ --header 'Content-Type: application/json' \ --data '{ "card_id": 123 }'
{ "success": true, "message": "Game completed successfully", "data": { "completed": true, "reward": { "type": "free_product", "product_name": "Cappuccino", "description": "Free Cappuccino" }, "coupon": { "id": 456, "code": "K12345678", "status": "active", "expires_at": "2024-02-15T23:59:59Z" } } }
Manually complete a stamp card game and generate reward
X-API-Key
X-API-Secret
curl -X POST "https://staging-api.loyalty.lt/en/shop/games/1/complete" \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" \ -H "Content-Type: application/json" \ -d '{ "card_id": 123 }'
import { LoyaltySDK } from '@loyaltylt/sdk'; const sdk = new LoyaltySDK({ apiKey: 'your_api_key', apiSecret: 'your_api_secret', }); // Complete a game manually const result = await sdk.completeStampCard(1, 123); // gameId, cardId if (result.coupon) { console.log('Coupon generated:', result.coupon.code); }