/
v3.0.11Get access

getLoyaltyInfo

Is used to retrieve the user’s loyalty program status and rules. Loyalty is a reward system where users earn points from activity and can exchange them for bonuses or currency. The call returns current loyalty points, current level, level thresholds, conversion rates, exchange limits, and available level-up bonuses.

Request parameters:

The method works without parameters

Call example:

getLoyaltyInfo()

Response example:

{
  code: 0,
  rid: 1753217755,
  data: {
    result: 0,
    result_text: null,
    details: {
      LoyaltyEarnedPoints: 0,
      LoyaltyExchangedPoints: 0,
      LoyaltyLastEarnedPoints: 90.54,
      LoyaltyLevelId: 3270,
      LoyaltyPointUsagePeriod: 0,
      LoyaltyMaxExchangePoints: 0,
      LoyaltyMinExchangePoints: 0,
      LoyaltyRates: [{
        Id: 1419,
        CurrencyId: 'BTC',
        ConversionRate: 1000
      }, {
        Id: 1420,
        CurrencyId: 'ETH',
        ConversionRate: 1000
      }],
      LoyaltyLevels: [{
        Id: 3270,
        Name: '1',
        MaxPoint: 400,
        MinPoint: 0
      }, {
        Id: 3271,
        Name: '2',
        MaxPoint: 1500,
        MinPoint: 400
      }],
      LevelUpBonuses: [{
        LoyaltyLevelId: 3271,
        CurrencyId: 'FTN',
        Amount: 0.01
      }, {
        LoyaltyLevelId: 3271,
        CurrencyId: 'TUS',
        Amount: 0.03
      }]
    }
  }
}

Response parameters:

NameDescriptionTypeValues
LoyaltyEarnedPoints
soonnumber-
LoyaltyExchangedPoints
soonnumber-
LoyaltyLastEarnedPoints
Number of loyalty points earned during the current periodnumber-
LoyaltyLevelId
Identifier of the user’s current loyalty level.number-
LoyaltyPointUsagePeriod
soonnumber-
LoyaltyMaxExchangePoints
soonnumber-
LoyaltyMinExchangePoints
soonnumber-
LoyaltyRates
Defines how loyalty points can be exchanged into different currencies and the conversion rate for each currency.array-
└─ Id
Conversion rule IDnumber-
└─ CurrencyId
Target currency codestring-
└─ ConversionRate
How many loyalty points equal 1 unit of currencynumber-
LoyaltyLevels
List of all available loyalty levels with their required point ranges, used to determine the user’s current level and progression to the next onearray-
└─ Id
Loyalty level IDnumber-
└─ Name
Level name or rankstring-
└─ MinPoint
Minimum points required to reach this levelnumber-
└─ MaxPoint
Maximum points allowed within this levelnumber-
LevelUpBonuses
Defines the rewards granted to a user when they reach a specific loyalty level.array-
└─ LoyaltyLevelId
Level at which the bonus is grantednumber-
└─ CurrencyId
Bonus currency codestring-
└─ Amount
Bonus amount awarded upon reaching the levelnumber-