Skip to main content

Update a quote

Prerequisites
  • The id of an existing quote

A quote can be updated to change some information previously provided, or to add new information that was not previously available during the quote creation.

An update to a quote using the endpoint PUT /v2/quotes completely resets all the information previously sent, with the following exceptions:

  • the partner code code and the quote id id cannot be changed;
  • the product code product_code may be specified at quote creation, but cannot be changed during the quote update;
  • if the policyholder's email has been validated (field policyholder.email_validated_at), the validation will still hold after the quote update (provided the email did not change);
  • if the policyholder previously consented to be contacted (field consent_to_be_contacted), this consent will not be erased.

Consequently, a request for an update should provide values for all the configurable parameters and not only for what changed since the previous update. We advise API consumers to apply updates to the data structure previously returned by the API (e.g. by POST /v2/quotes, PUT /v2/quotes or GET /v2/quotes) and submit that updated payload to the endpoint PUT /v2/quotes, instead of creating the payload from scratch. Since unexpected payload keys are simply ignored, it is not needed to remove non-configuration information (e.g. insurance or premium).

Here we will set the information concerning the policyholder and the insured person (which may or may not be the same person). All the other fields come from the payload previously returned by the call to the creation endpoint POST /v2/quotes. Some of these fields are not configurable parameters (e.g. premium), they will simply be ignored by the API.

The room count is also updated to illustrate how the pricing is updated to match the latest information, and the field issued_at is set to the current datetime to keep track of the time at which the quote was changed.

curl --header "Content-Type: application/json" \
--header "x-api-key: <your-api-key>" \
--request PUT \
--data '{
"id": "XRM1DCC",
"code": "demo",
"accept_previous_policy_termination": false,
"consent_to_be_contacted": false,
"external_id": null,
"nb_months_due": 12,
"origin": null,
"special_operation_code": null,
"special_operation_code_applied_at": null,
"start_date": "2023-01-03",
"end_date": null,
"tacit_renewal": true,
"term_start_date": "2023-01-03",
"term_end_date": "2024-01-02",
"issued_at": "2023-01-03T15:19:02.978Z",
"customisation": {
"cover_acvol": null,
"default_cap": null,
"valuables_cap": null,
"deductible": null
},
"insurance": {
"contractual_terms": "https://sandbox.assurance.appenin.fr/docs/Appenin_Conditions_Generales_assurance_habitation_APP978_2022-05-09.pdf",
"currency": "EUR",
"default_cap": 20000,
"default_deductible": 150,
"ipid": "https://sandbox.assurance.appenin.fr/docs/Appenin_Document_Information_assurance_habitation_APP978_2022-05-09.pdf",
"product_code": "APP978",
"product_pricing_code": "APP978_FLAT",
"product_version": "2022-05-09",
"simplified_covers": [
"ACASSHE",
"ACBDV",
"ACCATNAT",
"ACCLI",
"ACDDE",
"ACDEFJU",
"ACINCEX",
"ACRC",
"ACVOL"
],
"valuables_cap": 3000
},
"policyholder": {
"address": "17 rue des Prévoyants de l’Avenir",
"birthdate": "2002-01-01",
"city": "Angers",
"email": "john.doe@example.org",
"email_validated_at": null,
"firstname": "John",
"lastname": "Doe",
"phone_number": "+33123456789",
"postal_code": "49000",
"preferred_language": "fr"
},
"premium": {
"monthly_price": 15.11,
"price": 181.32,
"price_excl_tax": 163.75,
"price_tax": 17.57
},
"risk": {
"person": {
"firstname": "John",
"lastname": "Doe"
},
"property": {
"address": "17 rue des Prévoyants de l’Avenir",
"building_flat": null,
"city": "Angers",
"equipments": [],
"occupancy": "TENANT",
"postal_code": "49000",
"room_count": 2,
"type": "FLAT"
},
"roommates": []
}
}' \
https://sandbox.api.appenin.fr/v2/quotes/XRM1DCC

The updated quote with a new pricing is returned:

{
"id": "XRM1DCC",
"code": "demo",
"accept_previous_policy_termination": false,
"consent_to_be_contacted": false,
"external_id": null,
"nb_months_due": 12,
"origin": null,
"special_operation_code": null,
"special_operation_code_applied_at": null,
"start_date": "2023-01-03",
"end_date": null,
"tacit_renewal": true,
"term_start_date": "2023-01-03",
"term_end_date": "2024-01-02",
"issued_at": "2023-01-03T15:37:39.835Z",
"customisation": {
"cover_acvol": null,
"default_cap": null,
"valuables_cap": null,
"deductible": null
},
"insurance": {
"contractual_terms": "https://sandbox.assurance.appenin.fr/docs/Appenin_Conditions_Generales_assurance_habitation_APP978_2022-05-09.pdf",
"currency": "EUR",
"default_cap": 15000,
"default_deductible": 150,
"ipid": "https://sandbox.assurance.appenin.fr/docs/Appenin_Document_Information_assurance_habitation_APP978_2022-05-09.pdf",
"product_code": "APP978",
"product_pricing_code": "APP978_FLAT",
"product_version": "2022-05-09",
"simplified_covers": [
"ACASSHE",
"ACBDV",
"ACCATNAT",
"ACCLI",
"ACDDE",
"ACDEFJU",
"ACINCEX",
"ACRC",
"ACVOL"
],
"valuables_cap": 2500
},
"policyholder": {
"address": "17 rue des Prévoyants de l’Avenir",
"birthdate": "2002-01-01",
"city": "Angers",
"email": "john.doe@example.org",
"email_validated_at": null,
"firstname": "John",
"lastname": "Doe",
"phone_number": "+33123456789",
"postal_code": "49000",
"preferred_language": "fr"
},
"premium": {
"monthly_price": 11.89,
"price": 142.68,
"price_excl_tax": 128.62,
"price_tax": 14.06
},
"risk": {
"person": {
"firstname": "John",
"lastname": "Doe"
},
"property": {
"address": "17 rue des Prévoyants de l’Avenir",
"building_flat": null,
"city": "Angers",
"equipments": [],
"occupancy": "TENANT",
"postal_code": "49000",
"room_count": 2,
"type": "FLAT"
},
"roommates": []
}
}
PUT /v2/quotes

Find more information about the quote update API endpoint PUT /v2/quotes in the API reference