Generally used for the Rewards Catalog component, the FieloPLT.PointTypeAPI Class includes one method.
Get Point Types (getPointTypes)
List<FieloPLT__PointType__c> FieloPLT.PointTypeAPI.getPointTypes(Id memberId, Set<String> fields)
It allows you to recover the currencies that exist within the program that the member is participating in. This might be important to add to a Rewards Catalog component, in order to display within the cart summary which are the currencies in the program and if any rewards require them to be redeemed.
Note that this method will get all of the program currencies, even if the member hasn't received any amount of a currency yet. For example, let's say that the program in which the member is participating has 2 currencies, Points and Miles, but the member has only won Points up until now. The getPointTypes API will return information regarding both currencies.
Take a look at a step by step guide on how to use this method.
Parameters
Check an example of how the API can be used below and a definition of its parameters right after:
Id memberId = [SELECT Id FROM FieloPLT__Member__c LIMIT 1].Id;
Set<String> fields = new Set<String>{'Id','Name'};
List<PointType__c> result = PointTypeAPI.getPointTypes(memberId, fields);| Parameters | Type | Description | Required |
|---|---|---|---|
| memberId | String | A specific member's ID. | Yes |
| fields | Set<String> | A list of API names from the Currency ( FieloPLT__PointType__c) Object fields, which you want to be added to the return. | No |
Return Value
Take a look below at an example of what is returned in the call and a definition of the return values right after:
List<PointType__c>:
[{"attributes":{"type":"FieloPLT__PointType__c","url":"/services/data/v51.0/sobjects/FieloPLT__PointType__c/a0j54000004QUrvAAG"},"Id":"a0j54000004QUrvAAG","FieloPLT__RewardBalanceField__c":"FieloPLT__Points__c"}]| Type | Description |
|---|---|
| List<PointType__c> | Returns a list of currencies from the Program that the member is participating in. By default, the return brings the currency's ID and its API name (FieloPLT__RewardBalanceField__c). |
Exception
Errors can occur when you use the endpoint. See below the exception that you can receive when using the PointTypeAPI:
| Type | Description |
|---|---|
| FieloApiException |
|
