---
schema_version: "1"
id: 454314cbcc39621fbc4b5ab81e2a5d1728a19daf5857c7c594d1930d01a0540c
title: issueInsurancePolicy(policyId)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceBrokerageFamily_issueInsurancePolicy_1.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceBrokerageFamily_issueInsurancePolicy_1.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d3fb480447728f9b4333f909c8354c7e88c695e8ef10a40b8aef2240a09a982b
description: Issue a specific insurance policy by providing the policy ID.
---
# issueInsurancePolicy(policyId)

Issue a specific insurance policy by providing the policy ID.

## API Version

67.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsurancePolicyIssueOutputRepresentation issueInsurancePolicy(String policyId)

## Parameters

**policyId**

- Type: String
- ID of the insurance policy to issue.

## Return Value

Type: [ConnectApi.InsurancePolicyIssueOutputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_insurance_policy_issue_output.htm "Output representation for the issue or endorse policy response. Contains the transaction ID and any errors that occurred during the process.")

## Usage

Use this method to issue a specific insurance policy. Issuing a policy transitions it from a draft or pending state to an active state. The response includes the transaction ID and any errors that occurred during the issue process.

## Example

The Apex example shows how to use the ConnectApi.InsuranceBrokerageFamily.issueInsurancePolicy() method to issue a specific insurance policy.

**Class Definition**

This Apex example shows how to issue an insurance policy.

global class IssueConnectDriver {

    global static void callIssueConnectAPI() {
        Map<String, Object\> input = new Map<String, Object\>();
        input.put('policyId', '0YTxx000000001dGAA');

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

        IssueTestConnectAPI callable = new IssueTestConnectAPI();
        Object result = callable.call('issue', args);

        ConnectApi.InsurancePolicyIssueOutputRepresentation policyData =
            (ConnectApi.InsurancePolicyIssueOutputRepresentation) result;
        System.debug('Issue Policy Data: ' + JSON.serializePretty(policyData));

        if (output.containsKey('error')) {
            System.debug('Error: ' + output.get('error'));
        }
    }
}

**Usage Example**

Use the IssueTestConnectAPI class to execute the issue action and process the result.

public class IssueTestConnectAPI implements System.Callable {

    public Object call(String action, Map<String, Object\> args) {
        Map<String, Object\> inputMap = (Map<String, Object\>) args.get('input');
        Map<String, Object\> outputMap = (Map<String, Object\>) args.get('output');

        if (action == 'issue') {
            String policyId = (String) inputMap.get('policyId');
            System.debug('Start of Connect API call to issue policy: ' + policyId);

            ConnectApi.InsurancePolicyIssueOutputRepresentation policyData;
            try {
                policyData = ConnectApi.InsuranceBrokerageFamily.issueInsurancePolicy(policyId);
                System.debug('Policy issued successfully: ' + policyData);
                outputMap.put('policyData', policyData);
            } catch (Exception e) {
                System.debug('Error while issuing policy: ' + e.getMessage());
                outputMap.put('error', e.getMessage());
            }
            return policyData;
        }

        return null;
    }
}

// Execute
IssueConnectDriver.callIssueConnectAPI();