---
schema_version: "1"
id: 2cb6016100052a46712562e0da0ac91172844fc654f25fedf6e023ac7ad42ed4
title: ProcessPolicyLimits(ProcessPolicyLimitsInput, claimId, coverageId)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceClaimFamily_ProcessPolicyLimits.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceClaimFamily_ProcessPolicyLimits.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2042b43717e45fd73f049525cf003941ba8df31d838ce2635db951e1d5e3ebc2
description: Process the policy limits for a loss item in a claim by using the current standings of the insurance policy limits.
---
# ProcessPolicyLimits(ProcessPolicyLimitsInput, claimId, coverageId)

Process the policy limits for a loss item in a claim by using the current standings of the insurance policy limits.

## API Version

65.0

## Requires Chatter

No

## Signature

public static ConnectApi.ProcessPolicyLimitsRepresentation ProcessPolicyLimits(ConnectApi.ProcessPolicyLimitsInputRepresentation ProcessPolicyLimitsInput, String claimId, String coverageId)

## Parameters

**ProcessPolicyLimitsInput**

- Type: [ConnectApi.ProcessPolicyLimitsInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_process_policy_limits.htm "Input representation for processing policy limits for a claim loss item.")
- JSON object that contains details for processing the policy limits.

**claimId**

- Type: String
- ID of the claim.

**coverageId**

- Type: String
- ID of the claim coverage.

## Return Value

Type: [ConnectApi.ProcessPolicyLimitsRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_process_policy_limits.htm "Output representation for processing the policy limits for a claim loss item.")

## Example

Here's an example of how to invoke the Process Policy Limits API by using Apex.

public with sharing class PostApiCalloutProcessLimitTest implements System.Callable {
public Object call(String action, Map<String, Object\> args) {
System.debug('>>> Action: ' + action);
System.debug('>>> Args: ' + JSON.serializePretty(args));
Map<String, Object\> bodyMap = new Map<String, Object\>();
// Extract 'input' from args
Map<String, Object\> inputMap = (Map<String, Object\>)args.get('input');
Map<String, Object\> outputMap = (Map<String, Object\>)args.get('output');
String claimId;
String claimCoverageId;
String CLAIM\_ID = 'claimId';
String CLAIM\_COVERAGE\_ID = 'claimCoverageId';
String ADJUSTED\_AMOUNT = 'adjustedAmount';
String LIMIT\_UNIT\_COUNT = 'limitUnitCount';
String BENEFIT\_NAME = 'benefitName';
if (inputMap != null) {
if (inputMap.containsKey(ADJUSTED\_AMOUNT) &&
inputMap.get(ADJUSTED\_AMOUNT) != null) {
bodyMap.put(ADJUSTED\_AMOUNT,
String.valueOf(inputMap.get(ADJUSTED\_AMOUNT)));
} if (inputMap.containsKey(LIMIT\_UNIT\_COUNT) &&
inputMap.get(LIMIT\_UNIT\_COUNT) != null) {
bodyMap.put(LIMIT\_UNIT\_COUNT,
String.valueOf(inputMap.get(LIMIT\_UNIT\_COUNT)));
} if (inputMap.containsKey(BENEFIT\_NAME) && inputMap.get(BENEFIT\_NAME) != null)
{

bodyMap.put(BENEFIT\_NAME, String.valueOf(inputMap.get(BENEFIT\_NAME)));
} if (inputMap.containsKey(CLAIM\_ID) && inputMap.get(CLAIM\_ID) != null) {
claimId = String.valueOf(inputMap.get(CLAIM\_ID));
} if (inputMap.containsKey(CLAIM\_COVERAGE\_ID) &&
inputMap.get(CLAIM\_COVERAGE\_ID) != null) {

claimCoverageId = String.valueOf(inputMap.get(CLAIM\_COVERAGE\_ID));
}
}

String jsonBody = JSON.serialize(bodyMap);
System.debug('>>> Final JSON Body: ' + jsonBody);
System.debug('>>> Claim Id : ' + claimId);
System.debug('>>> Claim Coverage Id : ' + claimCoverageId);
String str = postDataToExternalApi(jsonBody, claimId, claimCoverageId);
return outputMap.put('response', str);
}
public static String postDataToExternalApi(String jsonBody, String claimId, String
claimCoverageId) {
HttpRequest request = new HttpRequest();
Http http = new Http();

// Endpoint for Process Limits
String url = 'callout:invokeUW/services/data/v65.0/connect/insurance/'

+ 'claims/' + claimId + '/coverages/' + claimCoverageId + '/process-limits';

request.setEndpoint(url);
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json');
request.setTimeout(120000); // 2 mins timeout
request.setBody(jsonBody);
System.debug('>>> Calling Process Limits API');
System.debug('>>> Calling Endpoint : ' + url );
try {
HttpResponse response = http.send(request);
System.debug('>>> Status Code: ' + response.getStatusCode());
System.debug('>>> Response Body: ' + response.getBody());
return response.getBody();
} catch (Exception e) {
System.debug('Exception: ' + e.getMessage());
return 'Exception: ' + e.getMessage();
}
}
}