Calculate Projected Rebate Amount

Calculate the projected rebate amount for rebate types associated with a specified transaction reference ID.

This object is available in API version 54.0 and later.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/calculateProjectedRebateAmount

Where XX.X is the latest API version.

Formats: JSON

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a variable.

Inputs 

InputTypeDescription
programRebateTypeIdsstringRequired. The list of program rebate type IDs to calculate the projected rebate amounts for.
referenceRecordIdstringRequired. The transaction reference record ID to calculate the projected rebate amounts for.

Outputs 

OutputTypeDescription
calculateProjectedRebateAmountstringThe calculated rebate amount details for the program rebate types associated with the transaction reference record.
This is an Apex output type that contains nested arrays in JSON format. calculateProjectedRebateAmount contains an array of the CalculateProjectedRebateAmountOutputRepresentation Apex class. This output representation contains an array of the ProjectedRebateAmountCalc fields, while an array of DetailedProjectedRebateAmountCalc is contained in ProjectedRebateAmountCalc.

The fields aggregateId, benefitQualifierValue, benefitTier, measureFieldValue, qualifiedTiers, rebateTypeBenefit, totalProjectedRebateAmount, payoutPeriod, projectedRebateAmount can appear in the output list. These fields must be ignored because they aren’t supported in the flow for this invocable action. These fields will be deprecated in API version 55.0.

Note

Usage 

JSON Sample Request

1{
2   "inputs":[ {
3      "programRebateTypeIds": ["0hvRM0000004CUt"],
4      "referenceRecordId": "801RM00000083TeYAI"
5   } ]
6}

JSON Sample Response

1{
2  "projectedRebateAmountCalc": [
3    {
4      "programRebateTypeId": "0hvRM0000004CUt",
5      "referenceRecordId": "801RM00000083TeYAI",
6      "totalProjectedRebateAmount": 1088000,
7      "detailedProjectedRebateAmountCalc": [
8        {
9          "benefitQualifierValue": 500,
10          "benefitTier": "0huRM0000004CRC",
11          "rebateTypeBenefit": "5",
12          "measureFieldValue": 160000,
13          "payoutPeriod": "0i7RM0000004CV7",
14          "projectedRebateAmount": 800000,
15          "qualifiedTiers": [
16            "0huRM0000004CRC"
17          ]
18        },
19        {
20          "benefitQualifierValue": 240,
21          "benefitTier": "0huRM0000004CRC",
22          "rebateTypeBenefit": "5",
23          "measureFieldValue": 57600,
24          "payoutPeriod": "0i7RM0000004CV7",
25          "projectedRebateAmount": 288000,
26          "qualifiedTiers": [
27            "0huRM0000004CRC"
28          ]
29        }
30      ]
31    }
32  ]
33}

Details of the Apex Output Type 

  • projectedRebateAmountCalc—An array of projected rebate amounts. Each item specifies the projected rebate amount for a passed rebate type and the reference object.

    • programRebateTypeId—Specifies the program rebate type ID whose projected rebate amounts are calculated in this item.

    • referenceRecordId—Specifies the transaction reference record ID based on which the projected rebate amounts are calculated.

    • totalProjectedRebateAmount—Specifies the total projected rebate amount for this program rebate type and reference record.

    • detailedProjectedRebateAmountCalc—An array with each item corresponding to each aggregate record that is found for a combination of rebate type and reference object. For example, if the rebate is computed differently for every product using a benefit mapping and the reference object (order) has two order lines, this collection has two aggregates, one for each product.

      • benefitQualifierValue—Specifies the total benefit qualifier value calculated from both the aggregate record and the reference object.
      • benefitTier—Specifies the benefit tier ID that is determined based on the benefit qualifier value.
      • rebateTypeBenefit—Specifies the applied benefit that is granted based on the benefit tier identified.
      • measureFieldValue—Specifies the total measure value calculated from both the aggregate record and the reference object.
      • payoutPeriod—Specifies the rebate program payout period that is determined based on the mapped member ID and activity date. The mapping between reference object and transaction journal is used here. See Map Fields Between Target Transaction Object and Transaction Journal.
      • projectedRebateAmount—Specifies the calculated projected rebate amount based on the benefit tier and the measure field value.
      • qualifiedTiers—List of the eligible benefit tiers that have already been met.

Usage 

You must configure the output parameter for the Calculate Projected Rebate Amount Flow Action in Flow Builder. The following screen illustrates how to use the output parameter in the Flow Builder.

A representation of the Calculated Projected Rebate Amount screen.