Rental Agreements

  1. Overview
  2. List rental agreements
  3. Get a single rental agreement
  4. Create a new default rental agreement
  5. Create a new rental agreement for a booking
  6. Create a new rental agreement for a rental

Overview

This resource represents Rental Agreements - an agreement that needs to be accepted by Clients (travelers) for Bookings.

The Rental Agreement can be defined on the Account level (a global one that will be applied to all Rentals), a custom one for Rental (if not defined, it defaults to Account’s one) and on the Booking level (which is the copy of the Rental’s one at time of Booking creation).

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Rental Agreement
rental_agreementable_id Integer Read ID of the resource to which Rental Agreement belongs to (Rental, Account or Booking)
rental_agreementable_type String Read Type of the resource to which Rental Agreement belongs to (Rental, Account or Booking)
id Integer Read Rental Agreement’s ID.
body Text Read Rental Agreement’s body for the Account’s default locale.
body_translations Object Read Rental Agreement’s body translations
created_at Time Read Rental Agreement’s create time.
updated_at Time Read Rental Agreement’s update time.
Name Type Read/Write Description Constraints
account Integer Read Account’s ID related to the Rental Agreement  
rental_agreementable_id Integer Read ID of the resource to which Rental Agreement belongs to (Rental, Account or Booking)  
rental_agreementable_type String Read Type of the resource to which Rental Agreement belongs to (Rental, Account or Booking)  
id Integer Read Rental Agreement’s ID.  
body Text Read/Write Rental Agreement’s body for the Account’s default locale. Required, Maximum length: 100 000
body_translations Object Read Rental Agreement’s body translations  
created_at Time Read Rental Agreement’s create time.  
updated_at Time Read Rental Agreement’s update time.  

List rental agreements

List all rental agreements for rentals in given account(s).

GET /rental_agreements

Response

{
  "rental_agreements": [
    {
      "id": 1,
      "body": "My Agreement",
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z"
    }
  ]
}

Get a single rental agreement

Returns a single rental agreement identified by ID.

GET /rental_agreements/:rental_agreement_id

Response

{
  "rental_agreements": [
    {
      "id": 1,
      "body": "My Agreement",
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z"
    }
  ]
}

Create a new default rental agreement

Create a new rental agreement to be used by default. This rental agreement will be used, unless one is defined at rental or booking level.

Returns a newly created rental agreement.

POST /rental_agreements

Example JSON request

{
  "rental_agreements": [
    {
      "body": "My Agreement"
    }
  ]
}

Response

{
  "rental_agreements": [
    {
      "id": 1,
      "body": "My Agreement",
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z"
    }
  ]
}

Create a new rental agreement for a booking

Create a new rental agreement to be used exclusively for this booking.

Returns a newly created rental agreement.

POST /bookings/:booking_id/rental_agreements

Example JSON request

{
  "rental_agreements": [
    {
      "body": "My Agreement"
    }
  ]
}

Response

{
  "rental_agreements": [
    {
      "id": 1,
      "body": "My Agreement",
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z"
    }
  ]
}

Create a new rental agreement for a rental

Create a new rental agreement to be used by default for the given rental.

Returns a newly created rental agreement.

POST /rentals/:rental_id/rental_agreements

Example JSON request

{
  "rental_agreements": [
    {
      "body": "My Agreement"
    }
  ]
}

Response

{
  "rental_agreements": [
    {
      "id": 1,
      "body": "My Agreement",
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z"
    }
  ]
}