Line-level and object-level modifiers

When a job is created, specific modifier values are attached either to the line itself (such as a MultiPolicyDiscount modifier) or to an object on that line (such as a vehicle with an AntiLockBreaks discount).

Modifier endpoints

Every line has endpoints to get a collection of modifiers, and to get or modify a modifier element. These endpoints follow these patterns:

  • Line-level modifiers
    • GET /jobs/{jobId}/lines/{lineId}/modifiers
    • GET /jobs/{jobId}/lines/{lineId}/modifiers/{modifierId}
    • PATCH /jobs/{jobId}/lines/{lineId}/modifiers/{modifierId}
  • Object-level modifiers
    • GET /jobs/{jobId}/lines/{lineId}/{objectName}/{objectNameId}/modifiers
    • GET /jobs/{jobId}/lines/{lineId}/{objectName}/{objectNameId}/modifiers/{modifierId}
    • PATCH /jobs/{jobId}/lines/{lineId}/{objectName}/{objectNameId}/modifiers/{modifierId}

For example, personal auto lines can have line-level modifiers and modifiers attached to vehicles. For a personal auto line, the endpoints to work with modifiers might be:

  • Line-level modifiers
    • GET /jobs/{jobId}/lines/PersonalAutoLine/modifiers
    • GET /jobs/{jobId}/lines/PersonalAutoLine/modifiers/{modifierId}
    • PATCH /jobs/{jobId}/lines/PersonalAutoLine/modifiers/{modifierId}
  • Object-level modifiers
    • GET /jobs/{jobId}/lines/PersonalAutoLine/vehicles/{vehicleId}/modifiers
    • GET /jobs/{jobId}/lines/PersonalAutoLine/vehicles/{vehicleId}/modifiers/{modifierId}
    • PATCH /jobs/{jobId}/lines/PersonalAutoLine/vehicles/{vehicleId}/modifiers/{modifierId}

Creating modifiers

When a line or modifiable object is created, a set of modifier objects is automatically created. Thus, there are no POST /modifiers or DELETE /modifiers endpoints.

You cannot specify defaults in the product definition. Modifiers might have built-in default values, depending on the type:

  • For Boolean modifiers, PolicyCenter defaults them value to false.
  • For schedule rate modifiers, PolicyCenter defaults the rateOverride to $0.
  • For all other modifiers, there are no default values.

Modifier values are always expressed as one of the following datatypes: Boolean, date, rate (decimal), or typekey.

Retrieving modifiers and their values

Use the following endpoints to retrieve modifiers and their values.

Type of modifiers Endpoint
Line-level modifiers

GET /jobs/{jobId}/lines/{lineId}/modifiers

GET /jobs/{jobId}/lines/{lineId}/modifiers/{modifierId}

Object-level modifiers

GET /jobs/{jobId}/lines/{lineId}/{objectName}/{objectNameId}/modifiers

GET /jobs/{jobId}/lines/{lineId}/{objectName}/{objectNameId}/modifiers/{modifierId}

The following is the syntax for the fundamental attributes of a modifier:

    "attributes": {
      "id": "PAMultiPolicyDiscount",
      "modifierType": {
        "code": "<modifierTypeCode>"
      },
      "booleanModifier": <value>,
      "dateModifier": "<value">,
      "rateModifier": "<value>",
      "typekeyModifier": {
        "code": "<value>"
      }
    },

For any given modifier, the id and modifierType are always included in the response. If the modifier has been set to a value, then the corresponding *Modifier property is also included. If the modifier is a typekey modifier, the typelist that defines its values is specified in the product definition. If the modifier has not been set, the response has no *Modifier property.

Note that even though the Modifier schema has multiple *Modifier fields, for a given modifier only one of them will have a value. The other *Modifier fields will be null.

For example, the following are modifiers for a Personal Auto vehicle. Note the following:

  • The first modifier is a Boolean modifier and has been set to false.
  • The second modifier is a typekey modifier and has been set to alarmonly. (Based on the product definition, this modifier uses the AntiTheftType typelist.)
  • The third modifier is also a typekey modifier, but its value has not been set.
        {
            "attributes": {
                "id": "PAAntiLockBrakes",
                "modifierType": {
                    "code": "boolean"
                }
                "booleanModifier": false,
            }
        },
        {
            "attributes": {
                "id": "PAAntiTheft",
                "modifierType": {
                    "code": "typekey"
                },
                "typekeyModifier": {
                    "code": "alarmonly"
                }
            }
        },
        {
            "attributes": {
                "id": "PAPassiveRestraint",
                "modifierType": {
                    "code": "typekey",
                    "name": "typekey"
                }
            }
        }
...

Specifying modifier values

To specify a value for a modifier, use the following endpoints.

Type of modifiers Endpoint
Line-level modifiers PATCH /jobs/{jobId}/lines/{lineId}/modifiers/{modifierId}
Object-level modifiers PATCH /jobs/{jobId}/lines/{lineId}/{objectName}/{objectNameId}/modifiers/{modifierId}

For example, the following call sets the value of the PAPassiveRestraint modifier on vehicle 505 to "Driver Side Only" (code driver from the PassiveRestraintType typelist).

Command

PATCH /job/v1/jobs/pc:1111/lines/PersonalAutoLine/vehicles/505/modifiers/PAPassiveRestraint

Response

{
  "data": {
    "attributes": {
      "typekeyModifier": {
        "code": "driver"
      }
    }
  }
}