You are here:
InsCommissionService:adjust
Use this service to adjust a Producer Commission amount.
Method:
adjust
Description
This service uses an existing Producer Commission record and Commission Schedule to adjust a commission amount for a producer.
How it Works
To adjust a commission, this service:
-
Accepts
commissionIdinput and retrieves the corresponding Producer Commission record.If a commission has already been adjusted, the service requires the
commissionIdfor the most recent adjustment. -
If the
useOriginalScheduleis true, uses the Commission Schedule specified in the retrieved Producer Commission record for the calculation.If the
useOriginalScheduleis false, the service usesproductionCode,producerId,productId,commissionableEvent,context, andeffectiveDateinputs to determine which Commission Schedule to use. -
Calculates the commission based on the Commission Schedule.
-
Evaluates the commission to determine whether it's a chargeback (a returned commission amount).
-
If the commissionable amount is negative, the service treats the commission as a chargeback.
-
If the commission isn't a chargeback, the service compares the calculated commission amount to minimum and maximum commission amounts. If the calculated amount it too low or too high, the service returns the minimum or maximum amount instead of the calculated amount.
-
-
Returns the commission amount, the ID of the commission schedule used to calculate it, and the minimum and maximum amounts that apply to this commission.
Inputs
Input |
Description |
|---|---|
|
Required. ID of the Producer Commission to adjust. |
|
When set to
When set to |
|
Optional. The production code name, not the ID, for the processing producer. |
|
The ID of the processing producer. |
|
Required if The ID of the product for which the commission is paid. |
|
The event or transaction that triggers a commission calculation (for example, Quote, Sold Policy, or Changed/Endorsed). |
|
Optional. The effective date of the adjustment. If null, the service uses today's date. |
|
Required. Field name and value pairs for the record on which commission is calculated. You must:
Format without lookup field:
Format with lookup field:
You can specify up to two levels of fields if you format the input with a lookup field. |
|
The amount on which the commission calculation is based. |
Input JSON
Here's how to format input JSON.
{
"commissionId": ProducerCommission.Id,
"useOriginalSchedule": true,
"productionCode": ProductionCode.Name,
"producerId": Producer.Id,
"product2Id": Product2.Id,
"commissionableEvent": event type,
"commissionableAmount": amount of the transaction,
"context": {
"objectId": ID of applicable object used,
"objectAPI.fieldAPI" : value
}
}This sample adjusts a commission issued for an endorsement, using the same commission schedule that was used originally.
{
"commissionId": apwe045asx,
"useOriginalSchedule": true,
"productionCode":AX001,
"producerId":ay001jh002,
"product2Id":az011jh022,
"commissionableEvent":"Endorsement",
"commissionableAmount":500,
"context":{
"Quote.vlocity_ins__TotalPremiumforTerm__c":100,
"QuoteLineItem.vlocity_ins__GroupClassId__r.vlocity_ins__ClassCode__c":"Managers",
"QuoteLineItem.vlocity_ins__FeeAmount__c":5,
"objectId":ax003jh001
}
}Output JSON
Here's the format of output JSON.
{
"commissionAmount": amount,
"commissionScheduleId": ID of the commission schedule used,
"minCommissionAmount": CommissionScheduleAssignment.MinCommissionAmount,
"maxCommissionAmount": CommissionScheduleAssignment.MaxCommissionAmount
}Here's sample output that shows the calculated amount ($167) is within the range defined by minimum and maximum values ($100-$500).
{
"commissionAmount":167,
"commissionScheduleId":"ab001od002",
"minCommissionAmount":100,
"maxCommissionAmount":500
}
