NAV Navbar
shell

Introduction

Welcome to the Direct API! You can use our API to access Direct API endpoints, including information on properties, units, rates, availability, and quotes in our database. You can view code examples in the dark area to the right.

The base URL for all endpoints in this doc is:

https://app.getdirect.io/api/public/<ORG_ID>

where <ORG_ID> is the ID of the connected organization.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

Make sure to replace your_api_key with your API key.

Direct uses API keys to allow access to the API. You can register a new Direct API key by emailing us at [email protected].

Direct expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: your_api_key

Accept: application/vnd.direct.v1

Properties

Get All Properties

curl "https://app.getdirect.io/api/public/<ORG_ID>/properties"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

The above command returns JSON structured like this:

{
   "properties":[
      {
         "id":92,
         "name":"Westgate Resort Bella Suite",
         "updated_at":"2018-12-11T23:56:42.904Z"
      },
      {
         "id":39,
         "name":"La Palme- Sanctuary",
         "updated_at":"2018-12-11T22:39:54.001Z"
      }
   ]
}

This endpoint retrieves all properties connected to your organization.

HTTP Request

GET /properties

Get a Specific Property

curl "https://app.getdirect.io/api/public/<ORG_ID>/properties/<ID>"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

The above command returns JSON structured like this:

{
   "id":92,
   "name":"Westgate Resort Bella Suite",
   "updated_at":"2018-12-11T23:56:42.904Z",
   "address":{
      "addressLine1":"3000 Canyons Resort Drive",
      "addressLine2":"3704",
      "city":"Park City",
      "state":"UT",
      "country":"US",
      "postalCode":"84098",
      "lat":40.6845975,
      "lng":-111.5548417
   },
   "features":[
      "Cycling",
      "Fishing",
      ...
   ],
   "images":[
      {
         "label":"",
         "uri":"<image url>"
      }
   ],
   "units":[
      {
         "id":92,
         "active":true,
         "description":null,
         "propertyType":"PROPERTY_TYPE_CONDO",
         "currency":"USD",
         "name":"PCWG3704",
         "bathrooms":[
            {
               "id":185,
               "roomSubType":"SHOWER_INDOOR_OR_OUTDOOR",
               "amenities":[]
            }
         ],
         "bedrooms":[
            {
               "id":187,
               "roomSubType":"OTHER_SLEEPING_AREA",
               "amenities":[]
            }
         ],
         "unitFeatures":[
            "Air conditioning",
            "Elevator",
            ...
         ]
      }
   ]
}

This endpoint retrieves a specific property.

HTTP Request

GET /properties/<ID>

URL Parameters

Parameter Description
ID The ID of the property to retrieve

Units

Get Rates

curl "https://app.getdirect.io/api/public/<ORG_ID>/properties/<P_ID>/units/<U_ID>/rates"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

The above command returns JSON structured like this:

{
   "currency":"USD",
   "updated_at":"2018-12-11T23:56:43.268Z",
   "default_nightly_weekend":99.0,
   "default_nightly_weekday":99.0,
   "tax_rate":10.42,
   "discounts":[],
   "fees":[
      {
         "id":322,
         "name":"Processing Fee",
         "calculation_type":"percent",
         "calculation_amount":2.0,
         "taxable":false,
         "is_addon":"false"
      },
      {
         "id":49,
         "name":"Cleaning Fee",
         "calculation_type":"flat",
         "calculation_amount":100.0,
         "taxable":true,
         "is_addon":"false"
      }
   ],
   "security_deposit":[],
   "nightlyOverrides":[
      {
         "amount":219.0,
         "nights":[
            {
               "min":"2019-01-02",
               "max":"2019-01-03"
            }
         ]
      }
   ],
   "paymentSchedule":[
      {
         "days":null,
         "dueType":"AT_BOOKING",
         "amount":50,
         "type":"percent"
      },
      {
         "days": 7
         "dueType":"BEFORE_CHECKIN",
         "amount":null,
         "type":"remainder"
      }
   ]
}

This endpoint retrieves a particular unit's rates.

HTTP Request

GET /properties/<P_ID>/units/<U_ID>/rates

URL Parameters

Parameter Description
P_ID The ID of the property to retrieve
U_ID The ID of the unit to retrieve

Get Availability

curl "https://app.getdirect.io/api/public/<ORG_ID>/properties/<P_ID>/units/<U_ID>/availability"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

The above command returns JSON structured like this:

{
   "availabilityDefault":"Y",
   "stayIncrementDefault":"D",
   "changeOverDefault":"C",
   "availableUnitCountDefault":1,
   "updated_at":"2018-12-11T23:56:42.917Z",
   "default_stay_min":2,
   "default_stay_max":30,
   "default_prior_notify_min":1,
   "dateRange":{
      "beginDate":"2019-01-02",
      "endDate":"2022-01-01"
   },
   "availability":"YN...",
   "changeOver":"CC...",
   "maxStay":"30,30,...",
   "minPriorNotify":"1,1,...",
   "minStay":"5,5,...",
   "stayIncrement":"DD..."
}

This endpoint retrieves a particular unit's availability.

HTTP Request

GET /properties/<P_ID>/units/<U_ID>/availability

URL Parameters

Parameter Description
P_ID The ID of the property to retrieve
U_ID The ID of the unit to retrieve

Availability Response Values

Key Values
availability Y (available) or N (not available)
changeOver C (any), I (check in), O (check out), or X (none)
stayIncrement D (day) or W (week)

Get a Quote

curl "http://www.lvh.me:5100/api/public/990/properties/92/units/92/quotes" 
-d '{"check_in": "2019-02-01", "check_out": "2019-02-05", "adults": 1, "children": 0, "pets": 0}' 
-H "Authorization: Token test_api_key" 
-H "Accept: application/vnd.direct.v1" 
-H "Content-Type: application/json" 
-X POST

The above command returns JSON structured like this:

{
   "orderItems":[
      {
         "feeType":"RENTAL",
         "name":"Rent",
         "preTaxAmount":892.0,
         "totalAmount":1001.51,
         "isAddOn":null
      },
      {
         "feeType":"MISC",
         "name":"Non-Refundable Damage Waiver Fee",
         "preTaxAmount":59.0,
         "totalAmount":59.0,
         "isAddOn":"false"
      },
      {
         "feeType":"MISC",
         "name":"Processing Fee",
         "preTaxAmount":17.84,
         "totalAmount":17.84,
         "isAddOn":"false"
      },
      {
         "feeType":"MISC",
         "name":"Cleaning Fee",
         "preTaxAmount":100.0,
         "totalAmount":100.0,
         "isAddOn":"false"
      },
      {
         "feeType":"MISC",
         "name":"Resort Fee",
         "preTaxAmount":20.0,
         "totalAmount":20.0,
         "isAddOn":"false"
      }
   ],
   "paymentSchedule":[
      {
         "amount":1198.35,
         "dueDate":"2019-01-02"
      }
   ],
   "rentalAgreement":"<url to PDF>"
}

This endpoint retrieves a quote for the specified unit given check in date, check out date, number of adults, number of children (optional) and number of pets (optional).

HTTP Request

POST /properties/<P_ID>/units/<U_ID>/quotes

URL Parameters

Parameter Description
P_ID The ID of the property to retrieve
U_ID The ID of the unit to retrieve

Request Parameters

Parameter Description
check_in The check in date ("YYYY-MM-DD")
check_out The check out date ("YYYY-MM-DD")
adults The number of adult guests
children The number of child guests (optional, default to 0)
pets The number of pets (optional, default to 0)

Update Pricing

curl "https://app.getdirect.io/api/public/990/properties/92/units/92/pricing" 
-d '{"pricing_array":
      [
         {"date":"2019-04-03", "recommended_price":"440", "reason":"High demand"},
         {"date":"2019-04-04", "recommended_price":"244", "reason":"Low demand"}
      ]
   }'
-H "Authorization: Token test_api_key" 
-H "Accept: application/vnd.direct.v1" 
-H "Content-Type: application/json" 
-X POST

The above command returns JSON structured like this:

{
   "status": "Success"
}

This endpoint updates the nightly price for the specified unit given and dates found in the json.

HTTP Request

POST /properties/<P_ID>/units/<U_ID>/pricing

URL Parameters

Parameter Description
P_ID The ID of the property to retrieve
U_ID The ID of the unit to retrieve

Request Parameters

Parameter Description
pricing_array An array of pricing objects to process
date The date you wish to update ("YYYY-MM-DD")
recommended_price The price to set on the specified date
reason The reason for the updated price

Update Minimum Night Stay

curl "https://app.getdirect.io/api/public/990/properties/92/units/92/stay-length" 
-d '{"availability_array":
      [
         {"date":"2019-04-03", "min_nights":"5", "reason":"High demand"},
         {"date":"2019-04-04", "min_nights":"3", "reason":"Low demand"}
      ]
   }'
-H "Authorization: Token test_api_key" 
-H "Accept: application/vnd.direct.v1" 
-H "Content-Type: application/json" 
-X POST

The above command returns JSON structured like this:

{
   "status": "Success"
}

This endpoint updates the minimum night stay for the speceified unit given and dates found in the json.

HTTP Request

POST /properties/<P_ID>/units/<U_ID>/stay-length

URL Parameters

Parameter Description
P_ID The ID of the property to retrieve
U_ID The ID of the unit to retrieve

Request Parameters

Parameter Description
availability_array An array of availability objects to process
date The date you wish to update ("YYYY-MM-DD")
min_nights The minimum nights to set on the specified date
reason The reason for the updated

Reservations

Get All reservations

curl "https://app.getdirect.io/api/public/<ORG_ID>/reservations"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

The above command returns JSON structured like this:

   {
      "reservations": [
        {
            "id": 951,
            "booking_code": "2VXUAWPE5-ZVCRY7",
            "updated_at": "2019-01-25T01:04:39.744Z"
        },
        {
            "id": 1811,
            "booking_code": "EQRMH4-L6QR1EALF",
            "updated_at": "2019-01-25T01:03:14.583Z"
        }
      ]
   }

This endpoint retrieves all reservations connected to your organization.

HTTP Request

GET /reservations

Get a Specific Reservation

curl "https://app.getdirect.io/api/public/<ORG_ID>/reservations/<ID>"
  -H "Authorization: Token your_api_key"
  -H "Accept: application/vnd.direct.v1"

The above command returns JSON structured like this:

{
    "id": 951,
    "booking_code": "2VXUAWPE5-ZVCRY7",
    "updated_at": "2019-01-25T01:04:39.744Z",
    "status": {
        "cancelled": false,
        "confirmed": true,
        "archived": true
    },
    "num_guests": 0,
    "days_booked": 3,
    "check_in": "2011-10-21",
    "check_out": "2011-10-23",
    "customer": {
        "name": "christopher zepf",
        "email": "[email protected]",
        "telephone": null
    }
}

This endpoint retrieves a specific reservation.

HTTP Request

GET /reservations/<ID>

URL Parameters

Parameter Description
ID The ID of the reservatoion to retrieve

Create a Reservation

curl "https://app.getdirect.io/api/public/990/reservations" 
-d '{
    "property_id": 1,
    "unit_id": 1,
    "customer": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "phone": "1234567890",
      "address": {
        "addressLine1": "123 Main Street"
        "addressLine2": "",
        "city": "Chicago",
        "state": "IL",
        "country": "US",
        "postal_code": "60654"
      }
    },
    "reservation": {
      "check_in": "2019-04-03",
      "check_out": "2019-04-07",
      "adults": 2,
      "children": 0,
      "pets": 0
    },
    "payment": {
      "number": "4111111111111111",
      "cvv": "123",
      "expiration_month": "02",
      "expiration_year": "2020",
      "name_on_card": "John Doe"
      "billing_address": {
        "addressLine1": "123 Main Street"
        "addressLine2": "",
        "city": "Chicago",
        "state": "IL",
        "country": "US",
        "postal_code": "60654"
      }
    }
  }'
-H "Authorization: Token test_api_key" 
-H "Accept: application/vnd.direct.v1" 
-H "Content-Type: application/json" 
-X POST

The above command returns JSON structured like this:

{
    "id": 951,
    "booking_code": "2VXUAWPE5-ZVCRY7",
    "updated_at": "2019-01-25T01:04:39.744Z",
    "cancelled": false,
    "confirmed": false,
    "archived": false,
    "num_guests": 1,
    "days_booked": 3,
    "check_in": "2019-04-03",
    "check_out": "2019-04-07",
    ...
}

This endpoint creates a new reservation for the requested unit.

HTTP Request

POST /reservations

Request Parameters

Parameter Description
property_id The unique identifier of the property being booked
unit_id The unique identifier of the unit being booked
customer Information about the customer making the inquiry
reservation Information about the reservation, including stay dates and guest counts
payment Payment information, including billing address and credit card details

Errors

The Direct API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The information requested is hidden for administrators only.
404 Not Found -- The specified information could not be found.
429 Too Many Requests -- You're making too many requests. Try again later.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.