OptimoCMSDocs

Rental

Units, availability, and bookings

GET
/v1/sites/{siteId}/rental/units

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Query Parameters

limit?integer
Default25
Rangevalue <= 100
cursor?string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/rental/units"
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "type": "string",
      "description": "string",
      "maxGuests": 0,
      "bedrooms": 0,
      "pricePerNight": 0,
      "currency": "string",
      "images": [
        "string"
      ],
      "active": true
    }
  ],
  "hasMore": true,
  "nextCursor": "string",
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/rental/units/{unitId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
unitId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/rental/units/string"
{
  "data": {
    "id": "string",
    "name": "string",
    "type": "string",
    "description": "string",
    "maxGuests": 0,
    "bedrooms": 0,
    "pricePerNight": 0,
    "currency": "string",
    "images": [
      "string"
    ],
    "active": true
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/rental/units/{unitId}/availability

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
unitId*string

Query Parameters

checkIn*string
Formatdate
checkOut*string
Formatdate
guests?integer

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/rental/units/string/availability?checkIn=2019-08-24&checkOut=2019-08-24"
{
  "data": {
    "unitId": "string",
    "available": true,
    "checkIn": "string",
    "checkOut": "string",
    "totalPrice": 0,
    "currency": "string"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/rental/bookings

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Query Parameters

status?string
Value in"pending" | "approved" | "declined" | "cancelled"
limit?integer
Default25
Rangevalue <= 100
cursor?string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/rental/bookings"
{
  "data": [
    {
      "id": "string",
      "unitId": "string",
      "checkIn": "2019-08-24",
      "checkOut": "2019-08-24",
      "guests": 0,
      "totalPrice": 0,
      "currency": "string",
      "status": "pending",
      "customerName": "string",
      "customerEmail": "string",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "hasMore": true,
  "nextCursor": "string",
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
POST
/v1/sites/{siteId}/rental/bookings

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/sites/string/rental/bookings" \  -H "Content-Type: application/json" \  -d '{    "unitId": "string",    "checkIn": "2019-08-24",    "checkOut": "2019-08-24",    "customer": {}  }'
{
  "data": {
    "id": "string",
    "unitId": "string",
    "checkIn": "2019-08-24",
    "checkOut": "2019-08-24",
    "guests": 0,
    "totalPrice": 0,
    "currency": "string",
    "status": "pending",
    "customerName": "string",
    "customerEmail": "string",
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
PATCH
/v1/sites/{siteId}/rental/bookings/{bookingId}/status

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
bookingId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "https://example.com/v1/sites/string/rental/bookings/string/status" \  -H "Content-Type: application/json" \  -d '{    "status": "approved"  }'
Empty
GET
/v1/sites/{siteId}/rental/properties

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/rental/properties"
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "address": "string",
      "unitCount": 0
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}