Specifying modifiers
Creating modifiers
When a line or modifiable object is created, a set of modifier objects are
automatically created. Thus, there are no POST /modifiers
or DELETE
/modifiers
endpoints.
You cannot specify defaults in the product definition. Modifiers may or may not have default values:
- For Boolean modifiers, PolicyCenter defaults them 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. They are attached either to the line itself (such as a MultiPolicyDiscount modifier) or to a specific object, such as a vehicle (such as an AntiLockBreaks discount modifier).
Retrieving modifiers and their values
Use the following endpoints to retrieve all modifiers and their values.
Type of modifiers | Endpoint |
---|---|
Line-level modifiers |
GET GET
|
Object-level modifiers |
GET
GET
|
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 is the 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 theAntiTheftType
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).
PATCH /job/v1/jobs/pc:1111/lines/PersonalAutoLine/vehicles/505/modifiers/ PAPassiveRestraint
{
"data": {
"attributes": {
"typekeyModifier": {
"code": "driver"
}
}
}
}