curl -X POST "https://staging-api.loyalty.lt/en/shop/offers/101/claim" \ -H "Authorization: Bearer your_jwt_token" \ -H "Content-Type: application/json" \ -d '{ "card_id": 123, "metadata": { "preferred_redemption_date": "2024-01-20", "source": "app", "notes": "Planning to use this weekend" } }'
Copy
{ "success": true, "message": "Offer claimed successfully", "data": { "claim": { "id": 5001, "claim_code": "DISCOUNT-ABC123-XYZ789", "status": "active", "claimed_at": "2024-01-15T16:30:00Z", "expires_at": "2024-03-15T23:59:59Z", "redemption_instructions": "Present this code at checkout to receive your 20% discount on purchases of €25 or more." }, "offer": { "id": 101, "title": "20% Off Your Next Purchase", "description": "Get 20% discount on your next purchase of €25 or more", "value": 20, "offer_type": "percentage_discount", "terms_conditions": "Valid on purchases of €25 or more. Cannot be combined with other offers." }, "points_transaction": { "id": 12350, "points_deducted": 200, "balance_before": 1250, "balance_after": 1050 }, "benefit": { "type": "discount_code", "value": "DISCOUNT20-CAFE123", "amount": 5.00, "usage_instructions": "Enter code 'DISCOUNT20-CAFE123' at checkout or show to cashier", "valid_until": "2024-03-15T23:59:59Z" } }}
Offers & Coupons
Claim Offer
Claim an available offer using loyalty points
POST
/
{locale}
/
shop
/
offers
/
{id}
/
claim
Copy
curl -X POST "https://staging-api.loyalty.lt/en/shop/offers/101/claim" \ -H "Authorization: Bearer your_jwt_token" \ -H "Content-Type: application/json" \ -d '{ "card_id": 123, "metadata": { "preferred_redemption_date": "2024-01-20", "source": "app", "notes": "Planning to use this weekend" } }'
Copy
{ "success": true, "message": "Offer claimed successfully", "data": { "claim": { "id": 5001, "claim_code": "DISCOUNT-ABC123-XYZ789", "status": "active", "claimed_at": "2024-01-15T16:30:00Z", "expires_at": "2024-03-15T23:59:59Z", "redemption_instructions": "Present this code at checkout to receive your 20% discount on purchases of €25 or more." }, "offer": { "id": 101, "title": "20% Off Your Next Purchase", "description": "Get 20% discount on your next purchase of €25 or more", "value": 20, "offer_type": "percentage_discount", "terms_conditions": "Valid on purchases of €25 or more. Cannot be combined with other offers." }, "points_transaction": { "id": 12350, "points_deducted": 200, "balance_before": 1250, "balance_after": 1050 }, "benefit": { "type": "discount_code", "value": "DISCOUNT20-CAFE123", "amount": 5.00, "usage_instructions": "Enter code 'DISCOUNT20-CAFE123' at checkout or show to cashier", "valid_until": "2024-03-15T23:59:59Z" } }}
Claim an available offer by spending the required loyalty points. This endpoint validates eligibility, deducts points, and generates the appropriate benefit (discount code, voucher, etc.).
Offers can only be claimed once per user (unless specified otherwise) and require sufficient points balance and tier status. Claimed offers are immediately activated.
curl -X POST "https://staging-api.loyalty.lt/en/shop/offers/101/claim" \ -H "Authorization: Bearer your_jwt_token" \ -H "Content-Type: application/json" \ -d '{ "card_id": 123, "metadata": { "preferred_redemption_date": "2024-01-20", "source": "app", "notes": "Planning to use this weekend" } }'
Copy
{ "success": true, "message": "Offer claimed successfully", "data": { "claim": { "id": 5001, "claim_code": "DISCOUNT-ABC123-XYZ789", "status": "active", "claimed_at": "2024-01-15T16:30:00Z", "expires_at": "2024-03-15T23:59:59Z", "redemption_instructions": "Present this code at checkout to receive your 20% discount on purchases of €25 or more." }, "offer": { "id": 101, "title": "20% Off Your Next Purchase", "description": "Get 20% discount on your next purchase of €25 or more", "value": 20, "offer_type": "percentage_discount", "terms_conditions": "Valid on purchases of €25 or more. Cannot be combined with other offers." }, "points_transaction": { "id": 12350, "points_deducted": 200, "balance_before": 1250, "balance_after": 1050 }, "benefit": { "type": "discount_code", "value": "DISCOUNT20-CAFE123", "amount": 5.00, "usage_instructions": "Enter code 'DISCOUNT20-CAFE123' at checkout or show to cashier", "valid_until": "2024-03-15T23:59:59Z" } }}
Different offer types generate different benefits when claimed:
Discount Codes
Generated: Unique alphanumeric codesUsage: Enter at checkout or show to cashierValidation: Single-use, time-limitedFormat: DISCOUNT20-SHOP123
Product Vouchers
Generated: Redeemable voucher codesUsage: Present when purchasing qualifying itemsValidation: Product-specific, time-limitedFormat: VOUCHER-PASTRY-789
Cashback Credits
Generated: Credit applied to loyalty accountUsage: Automatic application on next purchaseValidation: Minimum purchase thresholds may applyProcessing: 5-7 business days
Access Tokens
Generated: Temporary access credentialsUsage: VIP area access, exclusive eventsValidation: Time and location specificFormat: ACCESS-VIP-2024-456
if (error.code === 'INSUFFICIENT_POINTS') { // Show points needed vs. available const needed = offer.points_required; const available = user.points_balance; const shortfall = needed - available; showMessage(`You need ${shortfall} more points to claim this offer.`); showEarnPointsOptions();}
if (error.code === 'OFFER_ALREADY_CLAIMED') { // Redirect to claimed offers list navigateToClaimedOffers(); showMessage('You\'ve already claimed this offer. Check your claimed offers.');}
Claim Persistence: Claimed offers remain accessible through user’s account even after the original offer expires, ensuring users can always access their benefits.