---
schema_version: "1"
id: aab2df0e1a2e2e4f9e31a4740ec1070fbb4dec5cec1a19833e48b90950823ad1
title: CheckFinancialAuthority(paymentDetailId)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceClaimFamily_CheckFinancialAuthority.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceClaimFamily_CheckFinancialAuthority.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e997cb01587a85b2aa2cf02e52f33cfbe66aa2bb0e40001c83eed6a5f2ee0922
description: Check whether the current user has the financial authority to pay a specified claim coverage payment detail record.
---
# CheckFinancialAuthority(paymentDetailId)

Check whether the current user has the financial authority to pay a specified claim coverage payment detail record.

## API Version

68.0

## Requires Chatter

No

## Signature

public static ConnectApi.CheckFinancialAuthorityRep CheckFinancialAuthority(String paymentDetailId)

## Parameters

**paymentDetailId**

- Type: String
- ID of the claim coverage payment detail record to evaluate.

## Return Value

Type: [ConnectApi.CheckFinancialAuthorityRep](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_check_financial_authority_rep.htm "Contains the result of a financial authority check for a claim coverage payment detail, including whether payment is allowed and the user’s maximum approval amount.")

## Example

**Class Definition**

/\*\*
 \* Callable wrapper to exercise the UFA (User Financial Authority) Connect API:
 \*   POST /connect/insurance/claims/payment-details/${paymentDetailId}/check-financial-authority
 \*
 \* Backed by CheckFinancialAuthorityResourceImpl -> CheckFinancialAuthorityService.
 \*
 \* Mirrors the EditClaimCoveragePaymentDetailCallable pattern. All debug output is
 \* prefixed with \[UFA\] so it is easy to grep in the debug logs.
 \*/
public with sharing class CheckFinancialAuthorityCallable implements System.Callable {

    private static final String LOG\_PREFIX = '\[UFA\] ';

    public Object call(String action, Map<String, Object\> args) {
        // Retrieve the input and output maps from the arguments
        Map<String, Object\> inputMap  = (Map<String, Object\>) args.get('input');
        Map<String, Object\> outputMap = (Map<String, Object\>) args.get('output');

        if (action == 'checkFinancialAuthority') {
            // paymentDetailId is the ClaimCoveragePaymentDetail record Id to evaluate.
            // It maps to the ${paymentDetailId} URL path parameter.
            String paymentDetailId = (String) inputMap.get('paymentDetailId');

            // The CheckFinancialAuthorityInputRep body is currently EMPTY (no fields).
            // We still build/accept one so the call site matches the generated signature.
            ConnectApi.CheckFinancialAuthorityInputRep checkInputRep =
                (ConnectApi.CheckFinancialAuthorityInputRep) inputMap.get('CheckFinancialAuthorityInput');
            if (checkInputRep == null) {
                checkInputRep = new ConnectApi.CheckFinancialAuthorityInputRep();
            }

            System.debug(LOG\_PREFIX + '==== Start CheckFinancialAuthority Connect API call ====');
            System.debug(LOG\_PREFIX + 'Running as user: ' + UserInfo.getUserId() + ' (' + UserInfo.getName() + ')');
            System.debug(LOG\_PREFIX + 'paymentDetailId (ClaimCoveragePaymentDetail Id): ' + paymentDetailId);

            ConnectApi.CheckFinancialAuthorityRep checkResponse;

            try {
                // Generated Apex signature: (paymentDetailId, input) — path param first.
                checkResponse = ConnectApi.InsuranceClaimFamily.CheckFinancialAuthority(
                    paymentDetailId,
                    checkInputRep
                );

                System.debug(LOG\_PREFIX + 'CheckFinancialAuthority completed. Raw response: ' + checkResponse);

                // Surface every field the output representation returns.
                outputMap.put('checkResponse', checkResponse);
                if (checkResponse != null) {
                    outputMap.put('isSuccess',                     checkResponse.isSuccess);
                    outputMap.put('requestedBy',                   checkResponse.requestedBy);
                    outputMap.put('hasFinancialAuthority',         checkResponse.hasFinancialAuthority);
                    outputMap.put('isFinancialAuthorityConfigured', checkResponse.isFinancialAuthorityConfigured);
                    outputMap.put('isPaymentAllowed',              checkResponse.isPaymentAllowed);
                    outputMap.put('maximumApprovalAmount',         checkResponse.maximumApprovalAmount);

                    System.debug(LOG\_PREFIX + 'isSuccess                     = ' + checkResponse.isSuccess);
                    System.debug(LOG\_PREFIX + 'requestedBy                   = ' + checkResponse.requestedBy);
                    System.debug(LOG\_PREFIX + 'hasFinancialAuthority         = ' + checkResponse.hasFinancialAuthority);
                    System.debug(LOG\_PREFIX + 'isFinancialAuthorityConfigured= ' + checkResponse.isFinancialAuthorityConfigured);
                    System.debug(LOG\_PREFIX + 'isPaymentAllowed              = ' + checkResponse.isPaymentAllowed);
                    System.debug(LOG\_PREFIX + 'maximumApprovalAmount         = ' + checkResponse.maximumApprovalAmount);

                    if (checkResponse.errors != null && !checkResponse.errors.isEmpty()) {
                        outputMap.put('errors', checkResponse.errors);
                        System.debug(LOG\_PREFIX + 'Errors returned by service:');
                        for (ConnectApi.ErrorDetail err : checkResponse.errors) {
                            System.debug(LOG\_PREFIX + '   code=' + err.code + ', message=' + err.message);
                        }
                    } else {
                        System.debug(LOG\_PREFIX + 'No errors returned.');
                    }
                }
            } catch (Exception e) {
                System.debug(LOG\_PREFIX + 'EXCEPTION while calling CheckFinancialAuthority: ' + e.getMessage());
                System.debug(LOG\_PREFIX + 'Stack trace: ' + e.getStackTraceString());
                outputMap.put('error', e.getMessage());
                outputMap.put('isSuccess', false);
            }

            System.debug(LOG\_PREFIX + '==== End CheckFinancialAuthority Connect API call ====');
            return checkResponse;
        }

        System.debug(LOG\_PREFIX + 'Unrecognized action: ' + action);
        return null;
    }
}    

**Usage Example**

/\*\*
 \* Execute-Anonymous script to test the UFA CheckFinancialAuthority Connect API
 \* via CheckFinancialAuthorityCallable.
 \*
 \* To view logs: open Developer Console -> Logs, or set a Debug Level, then
 \* filter the log for the \[UFA\] prefix.
 \*/

CheckFinancialAuthorityCallable callable = new CheckFinancialAuthorityCallable();

// ----- Input -----
Map<String, Object\> input = new Map<String, Object\>();

// The ClaimCoveragePaymentDetail record Id to evaluate (maps to ${paymentDetailId}).
input.put('paymentDetailId', '0l2SB000000CLsMYAW');   // <-- replace with a real CCPD Id

// The CheckFinancialAuthorityInputRep body is currently empty (no fields to set).
// Provided here for completeness / future-proofing.
ConnectApi.CheckFinancialAuthorityInputRep checkInputRep =
    new ConnectApi.CheckFinancialAuthorityInputRep();
input.put('CheckFinancialAuthorityInput', checkInputRep);

// ----- Output -----
Map<String, Object\> output = new Map<String, Object\>();

// ----- Args -----
Map<String, Object\> args = new Map<String, Object\>();
args.put('input', input);
args.put('output', output);

System.debug('\[UFA-TEST\] Invoking checkFinancialAuthority action...');
Object result = callable.call('checkFinancialAuthority', args);

// ----- Inspect result -----
if (result != null) {
    ConnectApi.CheckFinancialAuthorityRep checkData = (ConnectApi.CheckFinancialAuthorityRep) result;
    System.debug('\[UFA-TEST\] Response received: ' + checkData);
    System.debug('\[UFA-TEST\] isSuccess                      = ' + checkData.isSuccess);
    System.debug('\[UFA-TEST\] requestedBy                    = ' + checkData.requestedBy);
    System.debug('\[UFA-TEST\] hasFinancialAuthority          = ' + checkData.hasFinancialAuthority);
    System.debug('\[UFA-TEST\] isFinancialAuthorityConfigured = ' + checkData.isFinancialAuthorityConfigured);
    System.debug('\[UFA-TEST\] isPaymentAllowed               = ' + checkData.isPaymentAllowed);
    System.debug('\[UFA-TEST\] maximumApprovalAmount          = ' + checkData.maximumApprovalAmount);

    if (checkData.isSuccess == true) {
        if (checkData.isPaymentAllowed == true) {
            System.debug('\[UFA-TEST\] RESULT: Payment IS allowed for this CCPD.');
        } else {
            System.debug('\[UFA-TEST\] RESULT: Payment is NOT allowed for this CCPD.');
        }
    } else {
        System.debug('\[UFA-TEST\] RESULT: API reported failure.');
    }

    if (checkData.errors != null && !checkData.errors.isEmpty()) {
        for (ConnectApi.ErrorDetail err : checkData.errors) {
            System.debug('\[UFA-TEST\] Error -> code=' + err.code + ', message=' + err.message);
        }
    }
} else {
    System.debug('\[UFA-TEST\] No result returned. error=' + output.get('error'));
}