Ir al contenido

Quote a home policy

POST
/v1/home/quotes
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).

Media typeapplication/json
object
productId
required

Product id (GET /v1/products)

string

Example

prod_456
policyholder
required

Policyholder

object
firstName
required

First name

string

Example

Ana
lastName
required

Last name

string

Example

Ejemplo
documentType
required

Identity document type

string
Allowed values: dni nie cif

Example

dni
documentNumber
required

Identity document number

string

Example

00000000T
email
required

Email address

string

Example

ana@example.com
property
required

Home to insure

object
address
required

Address of the insured home

object
streetType

Street type. Defaults to “street”

string
Allowed values: street avenue square promenade road path passage roundabout alley crossing ring_road boulevard development

Example

street
street
required

Street name

string

Example

Calle Ejemplo
number
required

Street number

number

Example

12
floor

Floor

string

Example

3
door

Door

string

Example

B
postalCode
required

Postal code (5 digits)

string

Example

28000
town
required

Town

string

Example

Madrid
province
required

Province

string

Example

Madrid
use
required

Use of the home

string
Allowed values: primary secondary rental low_occupancy

Example

primary
buildingType
required

Type of building

string
Allowed values: ground_floor middle_floor top_floor semi_detached detached

Example

middle_floor
location
required

Location of the building

string
Allowed values: urban outside_urban isolated

Example

urban
constructionYear
required

Year of construction

number

Example

1995
renovationYear

Year of the last full renovation

number

Example

2015
constructionQuality
required

Construction quality

string
Allowed values: high medium

Example

medium
constructionMaterials
required

Solid: stone, brick or non-combustible; combustible: wood or prefabricated with more than 30% combustible; partly_combustible: up to 30% combustible

string
Allowed values: solid combustible partly_combustible

Example

solid
alarm
required

Intruder alarm

string
Allowed values: none connected unconnected

Example

none
armouredDoors

All doors are armoured

boolean

Example

false
windowBars

Bars on all windows and openings

boolean

Example

false
security24h

Gated community with 24-hour security

boolean

Example

false
communityPolicy

The building has a community insurance policy

boolean

Example

false
mortgageLinked

The policy is linked to a mortgage loan

boolean

Example

false
coverage
required

Sums insured and optional covers

object
area
required

Built area of the home (m²)

number

Example

80
annexArea

Area of annexes (m²)

number

Example

0
mode
required

How the sums insured are applied

string
Allowed values: building_only contents_only full_value first_loss

Example

full_value
buildingAmount
required

Sum insured for the building (EUR)

number

Example

120000
contentsAmount
required

Sum insured for the contents (EUR)

number

Example

20000
professionalGoodsAmount

Professional goods (EUR)

number

Example

0
jewelleryInSafeAmount

Jewellery kept in a safe (EUR)

number

Example

0
jewelleryOutsideSafeAmount

Jewellery kept outside a safe (EUR)

number

Example

0
specialValuablesAmount

Objects of special value (EUR)

number

Example

0
jewelleryInSafeExtension

Extension of the jewellery-in-safe cover

boolean

Example

false
jewelleryInSafeTheft

Extended theft cover for jewellery in a safe

boolean

Example

false
jewelleryOutsideSafeTheft

Extended theft cover for jewellery outside a safe

boolean

Example

false
Media typeapplication/json
object
id
required

Quote id

string
productId
required

Product id

string
nullable
status
required

Draft: simulated; quoted: proposal accepted, ready to contract; contracted: policy issued

string
Allowed values: draft quoted contracted expired
property
required

Insured home

object
street
required

Street

string
number
required

Number

string
nullable
details
required

Floor, door, staircase… in one line

string
nullable
postalCode
required

Postal code

string
town
required

Town

string
province
required

Province

string
use
required

Use of the property

string
Allowed values: residential commercial
premium
required

Annual premium

object
amount
required

Amount in currency units

number
currency
required

ISO 4217 currency

string
Allowed values: EUR
coverages
required

Covers included

Array<object>
object
code
required

Cover code

string
name
required

Cover name

string
insuredAmount
required

Sum insured (EUR); null if not applicable

number
nullable
createdAt
required

Creation date (ISO 8601, UTC)

string
expiresAt
required

Expiry of the quote; null if not set

string
nullable

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)

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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)

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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)

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

Example

{
"error": {
"code": "validation_error",
"message": "Request validation failed",
"requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11",
"details": [
{
"field": "monthlyRent",
"issue": "must be a positive number"
}
]
}
}