⇡ GET /availability

The /availability request must be made as a GET request to https://api.cityconnect.net/v1/availability. You must use your email and token created in your account as HTTP Basic Authentication header to authenticate the request.

If the product is freesale, there is no need to query availability or make a reservation. Instead you should just go straight to making a booking_confirmation, and assume all dates are available.

You must make the GET request, with the following as URL parameters:

ParameterDescriptionExample
supplierThe supplier you are querying the availability from.[email protected]
productThe product codeWINETOURS
optionThe option code (if applicable)WITHLUNCH
fromThe start date of the query, inclusive. Given in the format YYYY-MM-DD2017-10-01
toThe end date of the query, inclusive. Given in the format YYYY-MM-DD2017-10-04

You must iterate over each day between the value of from and to (include).

Your response must be a JSON object, with the key being the date, and the value being either a list of departures, or the availability for that specific date. For example:

{
  "2017-10-01": {
    "promotions": {
      "OCT2017": "October Special! $5 OFF adult tickets",
      "5FOR4": "October Special! $5 OFF adult tickets"
    },
    "hours": { "10:30": "12:30", "14:00": "18:30" },
    "availability": {
      "open": true,
      "vacancies": null,
      "tickets": {
        "adult": "18+ years",
        "child": "18 or under"
      }
    },
    "pickups": {
      "Tour Office & Travel Depot": {
        "address": "81 Long Street",
        "latitude": 33.9249,
        "longitude": 18.4241,
        "time": "10:30"
      },
      "Camps Bay - Beach Road": {
        "address": "Opposite the Bay Hotel",
        "latitude": 33.9249,
        "longitude": 18.4241,
        "time": "11:30"
      }
    }
  },
  "2017-10-02": {
    "times": {
      "10:30": {
        "promotions": {},
        "open": true,
        "vacancies": 12,
        "tickets": {
          "adult": "18+ years",
          "child": "18 or under"
        },
        "pickups": {
          "Tour Office & Travel Depot": {
            "address": "81 Long Street",
            "latitude": 33.9249,
            "longitude": 18.4241,
            "time": "09:30"
          },
          "Camps Bay - Beach Road": {
            "address": "Opposite the Bay Hotel",
            "latitude": 33.9249,
            "longitude": 18.4241,
            "time": "10:00"
          }
        }
      },
      "11:00": {
        "promotions": {},
        "open": false,
        "vacancies": 0,
        "tickets": {
          "adult": "18+ years",
          "child": "18 or under"
        },
        "pickups": []
      }
    ]
  },
  "2017-10-03": {
    "times": {
      "10:30": {
        "promotions": {},
        "open": false,
        "vacancies": null,
        "tickets": {
          "adult": "18+ years",
          "child": "18 or under"
        },
        "pickups": []
      },
      "11:00": {
        "promotions": {},
        "open": true,
        "vacancies": 12,
        "tickets": {
          "adult": "18+ years",
          "child": "18 or under"
        },
        "pickups": []
      }
    ]
  },
  "2017-10-04": {
    "promotions": {},
    "hours": { "10:30": "18:30" },
    "availability": {
      "open": false,
      "vacancies": null,
      "tickets": {
        "adult": "18+ years",
        "child": "18 or under"
      }
    },
    "pickups": []
  },
  "2017-10-05": {
    "promotions": {},
    "hours": { "10:30": "12:30", "14:00": "18:30" },
    "availability": {
      "open": true,
      "vacancies": 25,
      "tickets": {
        "adult": "18+ years",
        "child": "18 or under"
      }
    },
    "pickups": []
  }
}

The key represents the date, and the value will contain either opening_hours and availability, or a list of departures. The former represents allows you to purchase tickets for the whole day (if available), and for the latter you much book for a specific time slot.

For each there is an availability object, that will always and only have two fields open and vacancies. A complete reference guide of all these fields is given below:

Note you will not find a date with both departures AND opening_hours, only one or the other will be set.

FieldDescription
promotions[*]Any public-ally available promotions for the product. The key is the code, and the value is a written description of the promotion.
times[*]Time slots available for purchase, the key is given in the format HH:MM (24hr clock) in the product's local time zone.
times[*][open]
availability[open]
A boolean value indicating whether tickets can be purchased or not.
times[*][vacancies]
availability[vacancies]
How many tickets can be purchased.
times[*][tickets][*]
availability[tickets][*]
An object where the key is the ticket type available for sale, and the value are the conditions the customer must comply with to be suitable for that type of ticket.

The ticket types must be one of the following:

- adult
- youth
- child
- infant
- senior
- student
hours[*]An object of times the venue opens (key) and closes (value). The venue can have multiple opening times.
times[*][pickups][*]
pickups[*]
The key is the name of the pickup, this is what will be included in the booking confirmation request.
times[*][pickups][*][address]
pickups[*][address]
Either an address or simple instructions of how to get to the pickup location.
times[*][pickups][*][latitude]
pickups[*][latitude]
The exact latitude of the pickup point
times[*][pickups][*][longitude]
pickups[*][longitude]
The exact longitude of the pickup point
times[*][pickups][*][time]
pickups[*][time]
The time the customer should be at the pickup location to be collected.

If availability is open, but vacancies is 0 the availability should be considered sold out. If availability is closed (open = false) but there are still vacancies then the product should be considered blocked out, or closed on those days, rather than sold out.