Accept a quote as a proposal
const url = 'https://integrador.avalisto.com/v1/home/quotes/example/proposal';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"effectiveDate":"2027-01-01","iban":"ES0000000000000000000000","policyholder":{"secondLastName":"Prueba","birthDate":"1990-01-31","gender":"male","maritalStatus":"single","profession":"Ingeniera","phone":"600000000","nationality":"ESP","allowsCommunication":false,"address":{"streetType":"street","street":"Calle Ejemplo","number":12,"floor":"3","door":"B","postalCode":"28000","town":"Madrid","province":"Madrid"}},"owner":{"secondLastName":"Prueba","birthDate":"1990-01-31","gender":"male","maritalStatus":"single","profession":"Ingeniera","phone":"600000000","nationality":"ESP","allowsCommunication":false,"address":{"streetType":"street","street":"Calle Ejemplo","number":12,"floor":"3","door":"B","postalCode":"28000","town":"Madrid","province":"Madrid"},"firstName":"Luis","lastName":"Ejemplo","documentType":"dni","documentNumber":"11111111H","email":"luis@example.com"},"mortgage":{"lender":"Banco Ejemplo","lenderTaxId":"A00000000","loanNumber":"0000000000"}}'};
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/example/proposal \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "effectiveDate": "2027-01-01", "iban": "ES0000000000000000000000", "policyholder": { "secondLastName": "Prueba", "birthDate": "1990-01-31", "gender": "male", "maritalStatus": "single", "profession": "Ingeniera", "phone": "600000000", "nationality": "ESP", "allowsCommunication": false, "address": { "streetType": "street", "street": "Calle Ejemplo", "number": 12, "floor": "3", "door": "B", "postalCode": "28000", "town": "Madrid", "province": "Madrid" } }, "owner": { "secondLastName": "Prueba", "birthDate": "1990-01-31", "gender": "male", "maritalStatus": "single", "profession": "Ingeniera", "phone": "600000000", "nationality": "ESP", "allowsCommunication": false, "address": { "streetType": "street", "street": "Calle Ejemplo", "number": 12, "floor": "3", "door": "B", "postalCode": "28000", "town": "Madrid", "province": "Madrid" }, "firstName": "Luis", "lastName": "Ejemplo", "documentType": "dni", "documentNumber": "11111111H", "email": "luis@example.com" }, "mortgage": { "lender": "Banco Ejemplo", "lenderTaxId": "A00000000", "loanNumber": "0000000000" } }'Adds the policyholder, payment and start date. The quote becomes “quoted” with its final premium and can then be contracted.
Authorizations
Sección titulada «Authorizations»Parameters
Sección titulada «Parameters»Path Parameters
Sección titulada «Path Parameters»Quote id
Request Bodyrequired
Sección titulada «Request Bodyrequired»object
Coverage start, ISO YYYY-MM-DD. Today or later
Example
2027-01-01IBAN for the premium direct debit
Example
ES0000000000000000000000Additional policyholder details
object
Second last name
Example
PruebaBirth date, ISO YYYY-MM-DD
Example
1990-01-31Gender
Example
femaleMarital status
Example
singleProfession
Example
IngenieraPhone number
Example
600000000Nationality, ISO 3166-1 alpha-3. Defaults to ESP
Example
ESPAccepts commercial communications
Example
falsePostal address of the policyholder. Defaults to 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
MadridOwner of the home, who is the insured person. Omit it when the policyholder is the owner
object
Second last name
Example
PruebaBirth date, ISO YYYY-MM-DD
Example
1990-01-31Gender
Example
femaleMarital status
Example
singleProfession
Example
IngenieraPhone number
Example
600000000Nationality, ISO 3166-1 alpha-3. Defaults to ESP
Example
ESPAccepts commercial communications
Example
falsePostal address of the policyholder. Defaults to 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
MadridFirst name
Example
LuisLast name
Example
EjemploIdentity document type
Example
dniIdentity document number
Example
11111111HEmail address
Example
luis@example.comRequired if the quote was created with mortgageLinked = true
object
Lending institution
Example
Banco EjemploTax id of the lending institution
Example
A00000000Loan number
Example
0000000000Responses
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" } ] }}