Skip to main content
POST
/
{locale}
/
shop
/
games
/
{id}
/
add-stamps
Add Stamps
curl --request POST \
  --url https://api.example.com/{locale}/shop/games/{id}/add-stamps \
  --header 'Content-Type: application/json' \
  --data '
{
  "card_id": 123,
  "shop_id": 123,
  "stamps_count": 123
}
'
{
  "success": true,
  "message": "Stamps added successfully",
  "data": {
    "current_step": 6,
    "stamps_required": 8,
    "is_completed": false,
    "was_already_completed": false,
    "remaining": 2
  }
}

Overview

Add one or more stamps to a customer’s stamp card game. This is the primary action for staff/POS to record customer purchases and progress.

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
shop_id
integer
required
The shop ID where the stamp is being added
stamps_count
integer
default:"1"
Number of stamps to add (1-10)

Response

success
boolean
Indicates if the request was successful
data.current_step
integer
New total number of stamps
data.is_completed
boolean
Whether the game is now completed
data.was_already_completed
boolean
Whether the game was already completed before this action
data.reward_generated
object
Details of the reward if game was completed (coupon, points, etc.)
{
  "success": true,
  "message": "Stamps added successfully",
  "data": {
    "current_step": 6,
    "stamps_required": 8,
    "is_completed": false,
    "was_already_completed": false,
    "remaining": 2
  }
}

Example Request

curl -X POST "https://staging-api.loyalty.lt/en/shop/games/1/add-stamps" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "card_id": 123,
    "shop_id": 1,
    "stamps_count": 2
  }'

SDK Example

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

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

// Add stamps to a customer's card
const result = await sdk.addStamps(
  1,   // gameId
  123, // cardId
  1,   // shopId
  2    // stampsCount
);

if (result.is_completed) {
  console.log('Game completed! Reward:', result.reward_generated);
} else {
  console.log(`Progress: ${result.current_step}/${result.stamps_required}`);
}

React Component Example

import { StampCard } from '@loyaltylt/sdk/react';

function POSScreen({ game, cardId, shopId }) {
  const handleAddStamps = async (gameId, cardId, shopId, count) => {
    const result = await sdk.addStamps(gameId, cardId, shopId, count);
    return result;
  };

  return (
    <StampCard
      game={game}
      cardId={cardId}
      shopId={shopId}
      onAddStamps={handleAddStamps}
      onGameCompleted={() => {
        console.log('Game completed!');
        // Refresh customer data
      }}
    />
  );
}

Error Responses

{
  "success": false,
  "message": "Game not found",
  "code": "RESOURCE_NOT_FOUND"
}