Ir al contenido

Estimate the premium of a rental policy

POST
/v1/rental/estimates
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.

Media typeapplication/json
object
productId
required

Product id (GET /v1/products)

string

Example

prod_123
monthlyRent
required

Monthly rent in EUR

number

Example

1200
durationMonths
required

One of product.requirements.durationsMonths

number

Example

12
recipient

Person the estimate is for. For products with requirements.consent = true, the estimate PDF is emailed to them

object
fullName
required

Full name

string

Example

Ana Ejemplo
email
required

Email address

string

Example

ana@example.com
Media typeapplication/json
object
id
required

Estimate id

string
productId
required

Product id

string
monthlyRent
required

Monthly rent

number
durationMonths
required

Duration in months

number
premium
required

Total premium for the period

object
amount
required

Amount in currency units

number
currency
required

ISO 4217 currency

string
Allowed values: EUR
monthlyPremium
required

Premium / durationMonths, informative

object
amount
required

Amount in currency units

number
currency
required

ISO 4217 currency

string
Allowed values: EUR
documentUrl
required

Estimate PDF (signed URL, 24 h). Only for products with requirements.consent = true; null otherwise

string
nullable
createdAt
required

Creation date (ISO 8601, UTC)

string

Example

{
"monthlyRent": 1200,
"durationMonths": 12,
"premium": {
"amount": 650,
"currency": "EUR"
},
"monthlyPremium": {
"amount": 650,
"currency": "EUR"
}
}

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"
}
]
}
}