Estimate the premium of a rental policy
const url = 'https://integrador.avalisto.com/v1/rental/estimates';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"productId":"prod_123","monthlyRent":1200,"durationMonths":12,"recipient":{"fullName":"Ana Ejemplo","email":"ana@example.com"}}'};
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/rental/estimates \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "productId": "prod_123", "monthlyRent": 1200, "durationMonths": 12, "recipient": { "fullName": "Ana Ejemplo", "email": "ana@example.com" } }'Indicative total premium for the period, without evaluating anyone. Only for products with supportsEstimate = true.
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»object
Product id (GET /v1/products)
Example
prod_123Monthly rent in EUR
Example
1200One of product.requirements.durationsMonths
Example
12Person the estimate is for. For products with requirements.consent = true, the estimate PDF is emailed to them
object
Full name
Example
Ana EjemploEmail address
Example
ana@example.comResponses
Sección titulada «Responses»object
Estimate id
Product id
Monthly rent
Duration in months
Total premium for the period
object
Amount in currency units
ISO 4217 currency
Premium / durationMonths, informative
object
Amount in currency units
ISO 4217 currency
Estimate PDF (signed URL, 24 h). Only for products with requirements.consent = true; null otherwise
Creation date (ISO 8601, UTC)
Example
{ "monthlyRent": 1200, "durationMonths": 12, "premium": { "amount": 650, "currency": "EUR" }, "monthlyPremium": { "amount": 650, "currency": "EUR" }}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" } ] }}