Loyi API Reference
  1. Reward
Loyi API Reference
  • Getting Started
  • Architecture
  • User
    • Users Overview
    • Create user
      POST
    • Get users
      GET
    • Get user
      GET
    • Update user
      PUT
    • Delete user
      DELETE
  • Reward
    • Rewards Overview
    • Create reward
      POST
    • Get rewards
      GET
    • Delete reward
      DELETE
    • Create entry pass code
      POST
    • Get entry pass code
      GET
    • Airdrop reward
      PUT
    • Award reward
      POST
    • Redeem rewards
      GET
  • Collection
    • Collection Overview
    • Create collection
      POST
    • Get collections
      GET
    • Get collection
      GET
    • Update collection
      PUT
    • Delete collection
      DELETE
    • Get rewards
      GET
  • Collectible
    • Claim collectible
      POST
    • Get collectibles
      GET
  • Quest
    • Quest Overview
    • Create quest
    • Get quests
    • Get quest
    • Update quest
    • Delete quest
    • Get participants
    • Accept quest
    • Submit answers
    • Get answers
  • Leaderboard
    • Leaderboard Overview
    • Get leaderboard
  • Leveling
    • Get leveling configuration
    • Configure leveling
    • Get milestone levels
    • Create milestone level
    • Get milestone level
    • Update milestone level
    • Delete milestone level
  1. Reward

Redeem rewards

Staging
https://testserver.loyi.io/public/api
Staging
https://testserver.loyi.io/public/api
GET
/reward/redeem
Reward
Redeems multiple rewards with the specified IDs. This operation is used to make a user redeem rewards.

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Path Params
id
string <uuid>
required
Reward ID
Query Params
userId
string <uuid>
required
rewardIds
array[string <uuid>]
required
comma-separated IDs of the rewards to be redeemed.
tokenId
number 
optional
ID of the collectible to be redeemed.
Header Params
Origin
string 
required
The value must be one of the whitelisted domains. You can whitelist domain URLs on your Loyi dashboard.
Default:
<WHITELISTED_URL>
Example:
https://example.com

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://testserver.loyi.io/public/api/reward/redeem?userId&rewardIds' \
--header 'Origin;' \
--header 'x-api-key;'

Responses

🟢200OK
application/json
Ok
Body
rewards
array[null (Reward) {3}] 
optional
object 
CouponLinkUnique
optional
Example:
{"id":"123e4567-e89b-12d3-a456-426655440000","code":null,"title":"Unique Coupon","description":"A special reward with unique coupons","instruction":"Use these coupons to get discounts","type":"CouponLinkUnique","link":"https://example.com","coupons":[{"code":"coupon1"},{"code":"coupon2"}],"createdAt":"2022-01-01T00:00:00.000Z","updatedAt":"2022-01-01T00:00:00.000Z"}
object 
CouponLinkGeneric
optional
Example:
{"id":"123e4567-e89b-12d3-a456-426655440000","code":"GENERICCODE123","title":"Generic Coupon","description":"A general reward with a coupon code","instruction":"Use this coupon to get a discount","type":"CouponLinkGeneric","link":"https://example.com","createdAt":"2022-01-01T00:00:00.000Z","updatedAt":"2022-01-01T00:00:00.000Z"}
object 
EntryPass
optional
Example:
{"id":"123e4567-e89b-12d3-a456-426655440000","title":"Event Entry Pass","description":"An entry pass for the event","instruction":"Show this pass at the event entrance","type":"EntryPass","createdAt":"2022-01-01T00:00:00.000Z","updatedAt":"2022-01-01T00:00:00.000Z"}
errors
array [object {2}] 
optional
resourceId
string <uuid>
optional
ID of the reward.
message
string 
optional
Error message.
Example
{
    "rewards": [
        {
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "title": "Event Entry Pass",
            "description": "An entry pass for the event",
            "instruction": "Show this pass at the event entrance",
            "type": "EntryPass",
            "createdAt": "2022-01-01T00:00:00.000Z",
            "updatedAt": "2022-01-01T00:00:00.000Z"
        }
    ],
    "errors": [
        {
            "resourceId": "123e4567-e89b-12d3-a456-426655440000",
            "message": "You are not eligible to redeem this reward."
        }
    ]
}
🟠400Bad Request
🟠401Unauthorized
🟠404Record Not Found
Modified at 2025-06-19 21:23:41
Previous
Award reward
Next
Collection Overview
Built with