Generally used for the My Payouts component, the FieloPLT.PayoutsAPI Class includes one method.
Get Member Payouts (getMemberPayouts)
List<FieloPLT__Payout__c> FieloPLT.PayoutsAPI.getMemberPayouts(Map<String, Set<String>> fieldsMap, Id memberId, Set<Id> payoutIds, Integer quantity, Integer offset, String dynamicFilter, String orderBy)
This method is used when you want to recover and show to the member all the payouts and payout items associated with them - i.e. that they have received. Allow them to overview all of the available information from the payout records, such as its amount and the Payout Date.
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:
Set<String> payoutFields = new Set<String>{'Id','Name'};
Set<String> pointFields = new Set<String>{'Id','Name'};
Map<String, Set<String>> fieldsMap = Map<String, Set<String>> fieldsMap('FieloPLT__Payout__c' => payoutFields, 'FieloPLT__Point__c' => pointFields);
Id memberId = [SELECT Id FROM FieloPLT__Member__c LIMIT 1].Id;
Set<Id> payoutIds = new Set<Id>(); //Empty in order to get all members payouts
Integer quantity = 10;
Integer offset = 0;
String orderBy = 'Name';
String dynamicFilter = null;
PayoutsAPI.getMemberPayouts(fieldsMap, memberId, payoutIds, quantity, offset, orderBy, dynamicFilter);| Parameter | Type | Description | Required |
|---|---|---|---|
| fieldsMap | Map<String, Set<String>> | A map defining a map with the API names of the fields from the Payout and Payout Item Objects that must be returned. The key is the Object's name. | No |
| memberId | Id | Member's id that will identify them. This is a mandatory parameter. | Yes |
| payoutIds | Set<Id> | A set of payout IDs to return. If null, returns all payouts that the member has received. | No |
| quantity | Integer | The quantity of payouts that must be returned. | No |
| offset | Integer | Number of records from a collection to skip. | No |
| dynamicFilter | String | Define fields from the Payout object that the member can use as filters. E.g. FieloPLT__PayoutDate__c, Name, FieloPLT__Currency__c. If null, it doesn't add any custom filter, returning all payouts. | No |
| orderBy | String | Define a field from the Payout object to be used as a base to order the records returned. If null, it is based on the last modified date in decreasing order. | 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<FieloPLT__Payout__c>:
[{"attributes":{"type":"FieloPLT__Payout__c","url":"/services/data/v51.0/sobjects/FieloPLT__Payout__c/a0i1k000004k6hYAAQ"},"Id":"a0i1k000004k6hYAAQ","Name":"PY-0100005"},{"attributes":{"type":"FieloPLT__Payout__c","url":"/services/data/v51.0/sobjects/FieloPLT__Payout__c/a0i1k000004k6hXAAQ"},"Id":"a0i1k000004k6hXAAQ","Name":"PY-0100004"},{"attributes":{"type":"FieloPLT__Payout__c","url":"/services/data/v51.0/sobjects/FieloPLT__Payout__c/a0i1k000004k6hWAAQ"},"Id":"a0i1k000004k6hWAAQ","Name":"PY-0100003"},{"attributes":{"type":"FieloPLT__Payout__c","url":"/services/data/v51.0/sobjects/FieloPLT__Payout__c/a0i1k000004k6hVAAQ"},"Id":"a0i1k000004k6hVAAQ","Name":"PY-0100002"},{"attributes":{"type":"FieloPLT__Payout__c","url":"/services/data/v51.0/sobjects/FieloPLT__Payout__c/a0i1k000004k6hUAAQ"},"Id":"a0i1k000004k6hUAAQ","Name":"PY-0100001"}]| Type | Description |
|---|---|
| List<FieloPLT__Payout__c> | A list of the member's payouts. |
Exception
Errors can occur when you use the endpoint. See below the exception that you can receive when using the PayoutsAPI:
| Type | Description |
|---|---|
| FieloApiException |
|
| FieloApiException |
|
