Quote a home policy
const url = 'https://integrador.avalisto.com/v1/home/quotes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"productId":"prod_456","policyholder":{"firstName":"Ana","lastName":"Ejemplo","documentType":"dni","documentNumber":"00000000T","email":"ana@example.com"},"property":{"address":{"streetType":"street","street":"Calle Ejemplo","number":12,"floor":"3","door":"B","postalCode":"28000","town":"Madrid","province":"Madrid"},"use":"primary","buildingType":"ground_floor","location":"urban","constructionYear":1995,"renovationYear":2015,"constructionQuality":"high","constructionMaterials":"solid","alarm":"none","armouredDoors":false,"windowBars":false,"security24h":false,"communityPolicy":false,"mortgageLinked":false},"coverage":{"area":80,"annexArea":0,"mode":"building_only","buildingAmount":120000,"contentsAmount":20000,"professionalGoodsAmount":0,"jewelleryInSafeAmount":0,"jewelleryOutsideSafeAmount":0,"specialValuablesAmount":0,"jewelleryInSafeExtension":false,"jewelleryInSafeTheft":false,"jewelleryOutsideSafeTheft":false}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://integrador.avalisto.com/v1/home/quotes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "productId": "prod_456", "policyholder": { "firstName": "Ana", "lastName": "Ejemplo", "documentType": "dni", "documentNumber": "00000000T", "email": "ana@example.com" }, "property": { "address": { "streetType": "street", "street": "Calle Ejemplo", "number": 12, "floor": "3", "door": "B", "postalCode": "28000", "town": "Madrid", "province": "Madrid" }, "use": "primary", "buildingType": "ground_floor", "location": "urban", "constructionYear": 1995, "renovationYear": 2015, "constructionQuality": "high", "constructionMaterials": "solid", "alarm": "none", "armouredDoors": false, "windowBars": false, "security24h": false, "communityPolicy": false, "mortgageLinked": false }, "coverage": { "area": 80, "annexArea": 0, "mode": "building_only", "buildingAmount": 120000, "contentsAmount": 20000, "professionalGoodsAmount": 0, "jewelleryInSafeAmount": 0, "jewelleryOutsideSafeAmount": 0, "specialValuablesAmount": 0, "jewelleryInSafeExtension": false, "jewelleryInSafeTheft": false, "jewelleryOutsideSafeTheft": false } }'Prices the home and its sums insured. The quote is a draft until a proposal is accepted (POST /v1/home/quotes/{id}/proposal).
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»object
Product id (GET /v1/products)
Example
prod_456Policyholder
object
First name
Example
AnaLast name
Example
EjemploIdentity document type
Example
dniIdentity document number
Example
00000000TEmail address
Example
ana@example.comHome to insure
object
Address of the insured home
object
Street type. Defaults to “street”
Example
streetStreet name
Example
Calle EjemploStreet number
Example
12Floor
Example
3Door
Example
BPostal code (5 digits)
Example
28000Town
Example
MadridProvince
Example
MadridUse of the home
Example
primaryType of building
Example
middle_floorLocation of the building
Example
urbanYear of construction
Example
1995Year of the last full renovation
Example
2015Construction quality
Example
mediumSolid: stone, brick or non-combustible; combustible: wood or prefabricated with more than 30% combustible; partly_combustible: up to 30% combustible
Example
solidIntruder alarm
Example
noneAll doors are armoured
Example
falseBars on all windows and openings
Example
falseGated community with 24-hour security
Example
falseThe building has a community insurance policy
Example
falseThe policy is linked to a mortgage loan
Example
falseSums insured and optional covers
object
Built area of the home (m²)
Example
80Area of annexes (m²)
Example
0How the sums insured are applied
Example
full_valueSum insured for the building (EUR)
Example
120000Sum insured for the contents (EUR)
Example
20000Professional goods (EUR)
Example
0Jewellery kept in a safe (EUR)
Example
0Jewellery kept outside a safe (EUR)
Example
0Objects of special value (EUR)
Example
0Extension of the jewellery-in-safe cover
Example
falseExtended theft cover for jewellery in a safe
Example
falseExtended theft cover for jewellery outside a safe
Example
falseResponses
Sección titulada «Responses»object
Quote id
Product id
Draft: simulated; quoted: proposal accepted, ready to contract; contracted: policy issued
Insured home
object
Street
Number
Floor, door, staircase… in one line
Postal code
Town
Province
Use of the property
Annual premium
object
Amount in currency units
ISO 4217 currency
Covers included
object
Cover code
Cover name
Sum insured (EUR); null if not applicable
Creation date (ISO 8601, UTC)
Expiry of the quote; null if not set
Example
{ "status": "draft", "property": { "street": "Calle Ejemplo", "number": "12", "details": "3º B", "postalCode": "28000", "town": "Madrid", "province": "Madrid", "use": "residential" }, "premium": { "amount": 650, "currency": "EUR" }, "coverages": [ { "code": "water_damage", "name": "Daños por agua" } ]}Invalid request (validation_error, invalid_cursor, missing_idempotency_key)
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Missing, invalid, expired or revoked credential
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Missing scope (forbidden_scope) or product not available (product_not_available)
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Resource not found (not_found)
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Rate limit or daily quota exceeded; see Retry-After
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}