You are here:
InsContractService:createUpdateContract
Use
this service to create or update a contract using the output of the InsQuoteService:getQuoteDetail service.
The same quote used to create the contract is also used in the update.
The service is typically used to add replacement products to an existing contract, for small groups.
Method: createUpdateContract
How It Works
-
This service looks for the
inputKeyvalue in the product JSON of a quote, which also contains theproductConfigurationDetailmap. -
If a
contractIdis specified, the contract is updated using the output of thegetContractDetailsservice as its input. -
If a
contractIdis not specified, a newcontractIdis created.
Remote Options
Options |
Description |
|---|---|
|
Id of target contract. |
|
Optional. The name of the pricebook to use on the created or updated contract. If you don't provide a value, the
service defaults to |
Input JSON
When
creating a new contract, the input JSON is similar to the output of the
InsQuoteService:getQuoteDetail service. When updating an existing
contract, the input JSON remains the same.
This
sample shows a new contract input JSON, where contractJson is the
input key and productConfigurationDetail contains the product JSON
returned via InsQuoteService:getQuoteDetail:
{
"productConfigurationDetail": {
"records": [...]
"totalSize": 1
},
"insuredItems": {
"Driver": [{
"instanceKey": "Joan Smith",
"isPrimary": false,
"isParent": false,
"LN": "Smith",
"AGE": 20,
"FN": "Joan",
"GENDER": "Female",
"FirstName": "Joan",
"LastName": "Smith"
},
{
...
}
],
"Auto": [{
"instanceKey": "2015 Lexus LX250",
"autoAntiTheft": true,
"est_annual_mileage": "1-10000",
"autoLicNum": "Lexus",
"autoModel": "LX250",
"autoYear": 2015,
"BodyClass": "Sedan/Saloon",
"VehicleType": "PASSENGER CAR",
"isPrimary": true
"isParent": false,
},
{
...
}
]
},
"quoteDetail": {
"attributes": {
"type": "Quote",
"url": "/services/data/v43.0/sobjects/Quote/0Q01I000000qeWLSAY"
},
"ins_daily4__EffectiveDate__c": "2018-07-27",
"ins_daily4__TotalSumInsured__c": 0,
"AccountId": "0011I00000QknfjQAB",
"ins_daily4__RootItemTotal__c": 0,
"Id": "0Q01I000000qeWLSAY"
},
"error": "OK"
}Output JSON
When
creating a new contract, the contractId of the new contract is returned in the
output JSON ('{"contractId": "idOfNewContract"}'), as
shown below. When updating an existing contract, no output JSON is
returned.
[{
'Name': 'Current Product'
}, {
'Name': 'Replacement Product',
'isReplacementProduct': true
}]
