Create Out-of-sequence Policy Endorsement Action

Create an out-of-sequence endorsement for an insurance policy.

This action is available in API version 65.0 and later.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/createOutOfSeqPlcyEndorsement

Where XX.X is the latest API version.

Formats: JSON

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is your OAuth access token.

Inputs 

InputTypeDescription
outOfSequencePolicyEndorsementInputRepApex-definedRequired. An Apex ConnectApi.OutOfSequenceEndorsePolicyInputRep record that contains the details to create the out-of-sequence policy endorsement.

Outputs 

OutputTypeDescription
jobIdentifierstringID of the job that’s created for the out-of-sequence endorsement process.

Example 

POST

This is a sample request to call this invocable action.

1{
2  "inputs": [
3    {
4      "contextId": "0000000i18tq18g00291750179239892137c4250a82940e49987f6d97559b4de",
5      "effectiveDate": "2025-03-05",
6      "policyId": ""
7      "insurancePolicy": {
8        "policyName": "Life Insurance",
9        "policyNumber": "LI000aax8967245gj"
10      },
11      "fieldSetIds": {
12        "policyFieldSetId": "0IXxx0000004CYqGAM",
13        "assetFieldSetId": "0IXxx0000004CaSGAU",
14        "participantFieldSetId": "0IXxx0000004CdgGAE",
15        "coverageFieldSetId": "0IXxx0000004Cc4GAE"
16      },
17      "transactionRecord": {
18        "name": "Custom OOSE transaction"
19      }
20    }
21  ]
22}

This is a sample request to call this invocable action from Apex code.

1public with sharing class OutOfSequenceEndorsementInvocable {
2    
3    /**
4     * Execute OOSE with custom parameters
5     * Usage: OutOfSequenceEndorsement.executeOOSEWithParams('policyId', 'effectiveDate', 'contextId');
6     */
7   public static void executeOOSEWithParams(String policyId, String effectiveDate, String contextId) {
8        // Validate input parameters
9        if (String.isBlank(policyId) || String.isBlank(effectiveDate) || String.isBlank(contextId)) {
10            System.debug('ERROR: All parameters (policyId, effectiveDate, contextId) are required');
11            return;
12        }
13        
14        // OOSE IA - Create the standard Invocable Action for out of sequence endorsement
15        Invocable.Action action = Invocable.Action.createStandardAction('createOutOfSeqPlcyEndorsement');
16        
17        // Instantiate the IA input object for OOSE
18        ConnectApi.outOfSequencePolicyEndorsementInputRep policyInput = 
19            new ConnectApi.outOfSequencePolicyEndorsementInputRep();
20        
21        // Set parameters
22        policyInput.effectiveDate = effectiveDate;
23        policyInput.contextId = contextId;
24        policyInput.policyId = policyId;
25        
26        // Populate Insurance Policy details (using IA classes)
27        ConnectApi.InsPolicyIAInputRep insurancePolicy = 
28            new ConnectApi.InsPolicyIAInputRep();
29        insurancePolicy.policyName = 'Lisa Auto Policy';
30        insurancePolicy.policyNumber = 'Lisa Auto Policy';
31        policyInput.insurancePolicy = insurancePolicy;
32        
33        // Set field sets (using IA field set representation)
34        ConnectApi.FieldSetIdsInputRep fieldSetIds = 
35            new ConnectApi.FieldSetIdsInputRep();
36        fieldSetIds.policyFieldSetId = '0IXZM0000008P684AE'; // Replace with your policy field set ID
37        fieldSetIds.assetFieldSetId = '0IXZM0000004DDC4A2'; // Replace with your asset field set ID
38        fieldSetIds.participantFieldSetId = '0IXZM0000004DDH4A2'; // Replace with your participant field set ID
39        fieldSetIds.coverageFieldSetId = '0IXZM0000008P6D4AU'; // Replace with your coverage field set ID
40        policyInput.fieldSetIds = fieldSetIds;
41        
42        // Populate Transaction record (using IA transaction representation)
43        ConnectApi.InsPolicyTrxnIAInputRep transactionRecord = 
44            new ConnectApi.InsPolicyTrxnIAInputRep();
45        transactionRecord.name = 'Custom OOSE Transaction';
46        policyInput.transactionRecord = transactionRecord;
47        
48        // Set invocation parameters
49        action.setInvocationParameter('outOfSequencePolicyEndorsementInputRep', policyInput);
50        
51        System.debug('Starting OOSE Invocable Action (createOutOfSeqPlcyEndorsement)...');
52        System.debug('Policy ID: ' + policyId);
53        System.debug('Effective Date: ' + effectiveDate);
54        System.debug('Context ID: ' + contextId);
55        
56        try {
57            // Invoke the action
58            List<Invocable.Action.Result> results = action.invoke();
59            
60            System.debug('OOSE Invocable Action result = ' + results);
61            
62            // Process results
63            for (Invocable.Action.Result result : results) {
64                if (result.isSuccess()) {
65                    System.debug('SUCCESS: Custom OOSE completed successfully!');
66                    Object outputValue = result.getOutputParameters().get('jobIdentifier');
67                    if (outputValue != null) {
68                        System.debug('Job Identifier: ' + outputValue);
69                    } else {
70                        System.debug('OOSE job started - result: ' + result.getOutputParameters());
71                    }
72                } else {
73                    System.debug('ERROR: Custom OOSE failed');
74                    System.debug('Error Details: ' + result.getErrors());
75                }
76            }
77            
78        } catch (Exception e) {
79            System.debug('EXCEPTION in Custom OOSE Invocable Action: ' + e.getMessage());
80        }
81    }
82}
83
84/*
85 * USAGE EXAMPLE:
86 * Copy and paste this code into Developer Console Execute Anonymous Window
87 */
88
89OutOfSequenceEndorsementInvocable.executeOOSEWithParams(
90    '0YTZM00000000xG4AQ',  // policyId
91    '2025-10-01',          // effectiveDate
92    '0000000i18tq18g002917575994042598cecb38226a341dd96349ee513c7c1e5'  // contextId
93);

This is a sample response when you call this action.

1[
2  {
3    "actionName": "createOutOfSeqPlcyEndorsement",
4    "errors": null,
5    "invocationId": null,
6    "isSuccess": true,
7    "outcome": null,
8    "outputValues": {
9      "jobIdentifier": "15Uxx0000004CUWEA2"
10    },
11    "sortOrder": -1,
12    "version": 1
13  }
14]