You are here:
InsPolicyService:calculateTaxesAndFees
Use this service to calculate and save taxes and fees on a target asset (policy).
Tax and fee information is saved on the asset (policy) object, and on the
AssetCoverage__c, AssetInsuredItem__c, and
AssetPartyRelationship__c fields.
This service also saves itemized taxes as described in step 3 below.
This service supports the Salesforce Financial Services Cloud.
How It Works
-
The service takes the
assetId, theeffectiveDate(orEffectiveDate_con the target policy, or today's date if the value is null). -
Based on the taxes and fees items associated with the policy, the coverages, and/or the insured items, either does the simple calculation specified or calls the calculation procedure or Integration Procedure required to calculate the taxes and fees.
NoteThis service can also call external systems to calculate taxes and fees. Specify these systems when you set up taxes and fees.
-
If saveChanges is set (or defaulted) to
true, saves the calculated taxes and fees in one of three ways.-
If an
AssetItemhas calculated taxes and fees, the service saves anAssetPricingAdjustment__crecord representing that tax/fee.The
AssetPricingAdjustment__crecord holds the calculated amount (Amount__c), the associatedAssetItem(AssetCoverageId__c/AssetInsuredItemId__c/AssetPartyRelationshipId__c) andAsset(AssetId__c) , the type (tax or fee;AdjustmentType__c), and the associated tax/fee (PriceListEntryId__c).AssetPricingAdjustment__chas an associatedAssetItem, so theApplicableItemType__cfield will also be set. This setting indicates which item type is applicable: Coverage, Insured Item, or Party Relationship.If the
transactionIdoption is specified, theAssetTransactionId__cfield is set to thetransactionIdvalue. -
If an
AssetItemor its children have calculated taxes, the sum of the calculated taxes on itself and its children will be stored on theTaxAmount__cfield. -
If an
AssetItemor its children have calculated fees, the sum of the calculated fees on itself and its children will be stored on theFeeAmount__cfield.
-
-
At the Asset level, the sum of all of the tax amounts and fee amounts are stored on the
TotalTaxAmount__candTotalFeeAmount__cfields respectively. -
If the target asset (policy) is not the original version of the policy, the tax and fee amounts will be prorated based on the asset’s
EffectiveDate__candExpirationDate__c. The prorated tax and fee amounts for anAssetItemis stored on theProratedTaxAmount__candProratedFeeAmount__cfields. The prorated tax and fee amounts for the asset are stored on theTotalTaxForTerm__candTotalFeeForTerm__cfields. -
If a
transactionIdoption is provided, the change in total prorated tax and fee amounts (the sum of the prorated tax and fee amounts across the target asset version and all previous versions of the asset) between the current asset version and the previous asset versions are stored on the target transaction’sTaxAmount__candFeeAmount__cfields respectively.
Remote Options
Option |
Description |
|---|---|
|
Required Id of the asset (policy) this service will calculate taxes and fees for. |
|
Optional The specified transaction will be updated with calculated tax and fee amounts. |
|
Optional Calculates taxes and fees associated with the provided jurisdictions only. |
|
Optional Calculate taxes and fees that are effective on the specified date only. If not provided, the value defaults
to the target policy’s |
|
Optional
Defaults to
If If |
Output JSON
The service returns the itemized taxes and fees in the product/child product hierarchy. Here's an example:
{
"productId": 1,
"productName": "Product",
"ProductCode": "P",
"taxesAndFees": [{
"Id": 1,
"Amount__c": 10,
"PriceListEntryId__c": 11,
"AdjustmentType__c": "Tax"
}, {
"Id": 2,
"Amount__c": 15,
"PriceListEntryId__c": 12,
"AdjustmentType__c": "Fee"
}],
"taxAmount": 25
"feeAmount": 30
"childProducts": [{
"productId": 2,
"productName": "Insured Item",
"ProductCode": "II",
"instanceKey": "My Insured Item",
"taxesAndFees": [{
"Id": 3,
"Amount__c": 15,
"PriceListEntryId__c": 16,
"AdjustmentType__c": "Tax"
}],
"taxAmount": 15
}, {
"productId": 3,
"productName": "Coverage",
"ProductCode": "C",
"taxesAndFees": [{
"Id": 4,
"Amount__c": 15,
"PriceListEntryId__c": 21
"AdjustmentType__c": "Fee"
}],
"feeAmount": 15
}]
}

