Ir al contenido

Quote a rental policy

POST
/v1/rental/quotes
curl --request POST \
--url https://integrador.avalisto.com/v1/rental/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "productId": "prod_123", "monthlyRent": 1200, "durationMonths": 12, "property": { "street": "Calle Ejemplo", "number": "12", "details": "3º B", "postalCode": "28000", "town": "Madrid", "province": "Madrid", "use": "residential" }, "parties": [ { "role": "tenant", "person": { "firstName": "Ana", "lastName": "Ejemplo", "documentType": "dni", "documentNumber": "00000000T", "email": "ana@example.com", "phones": [ "600000000" ], "birthDate": "1990-01-31", "selfEmployed": false, "address": { "street": "Calle Ejemplo", "number": "12", "details": "3º B", "postalCode": "28000", "town": "Madrid", "province": "Madrid" } }, "guarantees": "00000000T" } ], "consentId": "example", "externalReference": "LEASE-0001" }'

Evaluates the operation and creates it. The decision is approved, rejected or manual_review (Avalisto needs to review it; you can upload documents meanwhile). In the test environment premiums are fictitious.

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
property
required

Property

object
street
required

Street name

string

Example

Calle Ejemplo
number
required

Street number

string
nullable

Example

12
details
required

Floor, door, staircase… in one line

string
nullable

Example

3º 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 property

string
Allowed values: residential commercial

Example

residential
parties
required

Tenants and guarantors

Array<object>
object
role
required

Role in the operation

string
Allowed values: tenant guarantor

Example

tenant
person
required
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 nif cif pas

Example

dni
documentNumber
required

Identity document number

string

Example

00000000T
email
required

Email address

string

Example

ana@example.com
phones
required

Phone numbers

Array<string>

Example

[
"600000000"
]
birthDate
required

ISO date YYYY-MM-DD; must be of age

string

Example

1990-01-31
selfEmployed
required

True if self-employed

boolean

Example

false
address
required

Current home address

object
street
required

Street name

string

Example

Calle Ejemplo
number
required

Street number

string
nullable

Example

12
details
required

Floor, door, staircase… in one line

string
nullable

Example

3º B
postalCode
required

Postal code (5 digits)

string

Example

28000
town
required

Town

string

Example

Madrid
province
required

Province

string

Example

Madrid
guarantees

Guarantors only: documentNumber of the tenant this guarantor backs

string

Example

00000000T
consentId

Required if product.requirements.consent is true. Must be signed

string
externalReference

Your own reference (e.g. your lease id). Max 64 chars

string

Example

LEASE-0001
Media typeapplication/json
object
id
required

Quote id. May be equal to operationId

string
operationId
required

Operation id

string
productId
required

Null for operations not created through the API

string
nullable
decision
required

Evaluation result

string
Allowed values: approved rejected manual_review
reasons
required

Reasons for the decision (closed catalogue); may be empty

Array<string>
premium
required

Total premium for the period. null if rejected

object
amount
required

Amount in currency units

number
currency
required

ISO 4217 currency

string
Allowed values: EUR
monthlyRent
required

Monthly rent

number
durationMonths
required

Duration in months

number
property
required

Property

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
createdAt
required

Creation date (ISO 8601, UTC)

string

Example

{
"decision": "approved",
"reasons": [],
"premium": {
"amount": 650,
"currency": "EUR"
},
"monthlyRent": 1200,
"durationMonths": 12,
"property": {
"street": "Calle Ejemplo",
"number": "12",
"details": "3º B",
"postalCode": "28000",
"town": "Madrid",
"province": "Madrid",
"use": "residential"
},
"createdAt": "2027-01-01T10:00:00.000Z"
}

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