Socotra
Feature GuidePolicy Management

Policy Status

Overview

You can easily obtain a policy's status in Socotra and listen on status updates. Socotra defines the following policy statuses:

StatusMeaning
pendingThe policy has not yet reached its startTime, or it was cancelled prior to reaching its startTime.
expiredThe policy's endTime is in the past.
cancelledThe transaction stack contains an issued cancellation that has an effective time in the past. It is removed when the policy is reinstated or the cancellation is reversed.
cancelPendingThe transaction stack contains an issued cancellation that has an effective time in the future. The status is removed when the policy is reinstated (with or without a gap), the cancellation is reversed, or the cancellation effective time enters the past.
onRiskThe policy is not pending, expired, or cancelled.
delinquentThere is an active delinquency. This status is set when delinquency is inGrace and unset when the delinquency is in preGrace, settled, or lapseTriggered.
doNotRenewThe latest term's auto-renewal object has doNotRenew.

Socotra does not attempt to impose a singular status in cases where a policy can be said to fulfill multiple state conditions. This is why the platform exposes statuses, an array of enumerated values, on PolicyResponse. For example, a policy's status can be [onRisk, cancelPending].

Obtaining Policy Status

API

Policy status is provided as statuses on the PolicyResponse returned by endpoints such as Fetch Policy and supplied as inputs to plugins like the precommit plugin.

Event Stream

The event stream includes policy.status.update, which is emitted on any change to policy status. The event body includes newStatuses and removedStatuses to indicate which statuses may have been added and which may have been removed, respectively. Both newStatuses and removedStatuses have ListPageResponsePolicyStatus values:

ListPageResponsePolicyStatus

Required properties

PropertyTypeDescription
listCompletedboolean
itemsEnum[] pending | expired | cancelled | cancelPending | onRisk | delinquent | doNotRenew

For example, when a new on-risk policy is issued, you should expect to see an event like this:

{
	"locator": "...",
	"requestId": "...",
	"userLocator": "...",
	"timestamp": "...",
	"type": "policy.status.update",
	"data": {
		"removedStatuses": {
			"listCompleted": true
		},
		"policyLocator": "...",
		"newStatuses": {
			"listCompleted": true,
			"items": ["onRisk"]
		}
	}
}

If you were to then issue a cancellation effective now or in the past, a new event would be emitted:

{
	"locator": "...",
	"requestId": "...",
	"userLocator": "...",
	"timestamp": "...",
	"type": "policy.status.update",
	"data": {
		"removedStatuses": {
			"listCompleted": true,
			"items": ["onRisk"]
		},
		"policyLocator": "...",
		"newStatuses": {
			"listCompleted": true,
			"items": ["cancelled"]
		}
	}
}

As the event implies, statuses in PolicyResponse would be [cancelled].

On this page