Marketplace#
Welcome to the GameLoom Marketplace — the reward redemption system where your users can browse and redeem gifts using their earned points.How It Works#
1.
Browse gifts — Retrieve available gifts for a user. The system automatically filters based on stock, expiry, and user targeting
2.
View gift details — Get full information about a specific gift including pricing, stock, and redemption rules
3.
Redeem a gift — Deduct points from the user's balance and create a redemption record. Stock is managed automatically
4.
Track redemptions — View the user's redemption history including delivery status
Key Concepts#
Gifts#
Redeemable items available in the marketplace. Each gift has:Price in points and/or SAR
Stock — limited or unlimited quantity
Expiry — optional expiration date
Ranking — display order in the marketplace
Categories#
Gifts are organized into categories (e.g. Electronics, Food & Drinks). A default "All" category exists for every company.Point Types#
Each gift is linked to one or more point types from the Rewards service. When redeeming, the user must specify which point type to use. Only eligible point types are accepted.Use the pointTypeIds array from the gift details to know which point types a gift accepts.Targeting#
Gifts can be public (visible to all users) or private (targeted). Private gifts are only visible to users who match the targeting criteria:| Criteria | Description |
|---|
gender | Female or Male |
minAge / maxAge | Age range |
country | Country (case-insensitive) |
city | City (case-insensitive) |
segment | User segment (e.g. Premium, Silver, VIP) |
Public gifts are always visible. Private gifts are automatically filtered based on the user's profile from the Registration service.Redemptions#
When a user redeems a gift:Points are deducted from their balance via the Rewards service
Stock is decremented atomically (for limited-stock gifts)
A redemption record is created with a snapshot of the gift at the time of redemption
If the gift requires delivery, the redemption starts with deliveryStatus: Pending
If the gift has a redemptionValue (coupon code, voucher, link), it is returned in the response
Redemption Rules#
Gifts can have rules that affect the redemption flow:| Rule | Effect |
|---|
collectCustomerInfo: true | User must provide customerName and customerPhone when redeeming |
deliveryRequired: true | User must provide deliveryName, deliveryPhone, deliveryCity, and deliveryAddress when redeeming |
maxRedeemPerUser: N | Each user can redeem this gift at most N times. null = unlimited |
All errors follow the ProblemDetails format:{
"type": "GIFT_NOT_FOUND",
"title": "Gift not found",
"status": 404,
"detail": "Gift not found",
"correlationId": "0HNI1NSLEBIHO:00000001",
"timestamp": "2026-03-22T16:00:00Z"
}
When Accept-Language: ar is set, the title and detail fields return Arabic messages.Error Codes#
| Error Code | Status | Description |
|---|
GIFT_NOT_FOUND | 404 | Gift not found, inactive, expired, or deleted |
GIFT_NOT_AVAILABLE | 400 | Gift is not active or has expired |
GIFT_OUT_OF_STOCK | 400 | No remaining stock |
POINT_TYPE_NOT_ELIGIBLE | 400 | The submitted pointId is not accepted for this gift |
MAX_REDEEM_LIMIT_REACHED | 400 | User has reached the maximum redemption limit |
CUSTOMER_INFO_REQUIRED | 400 | customerName and customerPhone are required |
DELIVERY_INFO_REQUIRED | 400 | Delivery details are required |
INSUFFICIENT_POINTS | 400 | User does not have enough points |
USER_NOT_FOUND_OR_INACTIVE | 400 | User does not exist or is inactive |
GIFT_NOT_TARGETED_FOR_USER | 403 | Gift not available based on targeting criteria |
SERVICE_UNAVAILABLE | 503 | A dependent service is temporarily unavailable |
Endpoints#
| Method | Path | Description |
|---|
| GET | /api/v1/marketplace/user/{userKey}/gifts | Browse available gifts |
| GET | /api/v1/marketplace/user/{userKey}/gifts/{id} | Get gift details |
| POST | /api/v1/marketplace/user/{userKey}/redeem | Redeem a gift |
| GET | /api/v1/marketplace/user/{userKey}/redemptions | Get user's redemption history |
Modified at 2026-04-13 22:59:00