Skip to main content
POST
/
{locale}
/
shop
/
games
/
{id}
/
complete
Complete Game
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"
    }
  }
}

Overview

Manually complete a stamp card game and generate the reward. This is typically called automatically when the last stamp is added, but can be used to force completion if needed.

Authentication

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

Parameters

id
integer
required
The game ID
card_id
integer
required
The customer’s loyalty card ID

Response

success
boolean
Indicates if the request was successful
data.completed
boolean
Whether the game was completed
data.reward
object
Reward details if applicable
data.coupon
object
Generated coupon if reward type creates one
{
  "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"
    }
  }
}

Example Request

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
  }'

SDK Example

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);
}