@windingtree/wt-read-api
Version:
API to interact with the Winding Tree platform
275 lines • 81.4 kB
YAML
openapi: 3.0.0
servers:
-
description: 'Demo deployment'
url: 'https://demo-api.windingtree.com'
-
description: Localhost
url: 'http://localhost:3000'
info:
description: 'API for reading inventory from Winding Tree platform'
version: will-be-set-at-runtime
title: 'WT Read API'
paths:
/:
get:
summary: 'API info'
responses: {'200': {description: 'Basic information about this API instance.', content: {application/json: {schema: {type: object, properties: {docs: {type: string, description: 'Link to the API documentation.'}, info: {type: string, description: 'Link to more information about the API.'}, version: {type: string, description: 'Deployed API version number.'}, config: {type: string, description: 'Which config is the API using. It might be useful to name configs after used ETH networks.'}, entrypointAddress: {type: string, desc: 'Ethereum address of used Winding Tree Entrypoint.'}, directoryAddresses: {type: object, properties: {airlines: {type: string, description: 'Ethereum address of used Winding Tree airline directory.'}, hotels: {type: string, description: 'Ethereum address of used Winding Tree hotel directory.'}}}, ethNetwork: {type: string, description: 'Name of the ethereum network against which this instance runs.'}, dataFormatVersions: {description: 'Version number indicating the data format specification version the server expects from hotels.', type: object, properties: {airlines: {type: string, format: semver, maxLength: 20}, hotels: {type: string, format: semver, maxLength: 20}}}, trustClues: {description: 'Lists all used trust clues and their metadata. Every clue contains name and description field, but it might contiain other fields depending on the clue.', type: array, items: {type: object, properties: {name: {type: string}, description: {type: string}}}}}}}}}}
/hotels:
get:
summary: 'Lists hotels'
parameters: [{name: limit, in: query, description: 'maximum number of records to return', required: false, schema: {default: 30, type: integer, format: int32, minimum: 0, maximum: 300}}, {name: startWith, in: query, description: 'The `id` of the first record that will be included in the result', required: false, schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: fields, in: query, description: "List of fields to return with the hotel item. Selecting only `id` field leads to fastest responses as all data are retrieved from directory only.\n", required: false, schema: {default: [id, name, location], type: array, items: {type: string, enum: [address, amenities, availability, bookingUri, cancellationPolicies, category, contacts, currency, dataFormatVersion, orgJsonUri, defaultCancellationAmount, defaultLocale, description, guarantee, id, images, location, managerAddress, name, notificationsUri, operator, ratePlans, roomTypes, spokenLanguages, tags, timezone, updatedAt]}}}]
responses: {'200': {description: 'List of hotels. The API tries to always fulfil the requested limit, so in some cases, the `errors` field might be present.', content: {application/json: {schema: {type: object, properties: {items: {type: array, description: 'List of resolved hotels.', items: {$ref: '#/components/schemas/HotelListItem'}}, warnings: {type: array, description: 'List of resolved hotels passing validation with unsupported declared data format version.', items: {$ref: '#/components/schemas/HotelListError'}}, errors: {type: array, description: 'List of checked hotels whose requested data cannot be accessed (i. e. off-chain data cannot be reached) or fail validation.', items: {$ref: '#/components/schemas/HotelListError'}}, next: {description: 'Uri to next page of records. When there''s no next page, this is not set.', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}}}}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}':
get:
summary: 'Get hotel by `id`'
parameters: [{name: hotelId, required: true, in: path, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: fields, required: false, in: query, schema: {type: array, items: {type: string, default: [id, location, name, description, contacts, address, currency, images, amenities, updatedAt], enum: [address, amenities, availability, bookingUri, cancellationPolicies, category, contacts, currency, dataFormatVersion, orgJsonUri, defaultCancellationAmount, defaultLocale, description, guarantee, id, images, location, managerAddress, name, notificationsUri, operator, ratePlans, roomTypes, spokenLanguages, tags, timezone, updatedAt]}}}]
responses: {'200': {description: 'Hotel object', content: {application/json: {schema: {$ref: '#/components/schemas/HotelDetail'}}}, headers: {X-Data-Validation-Warning: {schema: {type: string}, description: 'Warning in case of a soft validation fail.'}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/meta':
get:
summary: 'Hotel record meta information - mostly on-chain and off-chain identifiers of places where to reach all of the hotel''s data.'
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}]
responses: {'200': {description: 'Hotel data uris.', content: {application/json: {schema: {$ref: '#/components/schemas/MetaResponse'}}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/roomTypes':
get:
summary: 'List room types for hotel `id`'
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: fields, in: query, required: false, description: 'Additional fields to return', schema: {type: string, enum: [ratePlans, availability]}}]
responses: {'200': {description: 'Room types list', content: {application/json: {schema: {$ref: '#/components/schemas/RoomTypesResponse'}}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/roomTypes/{roomTypeId}':
get:
summary: 'Get room type `id`'
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: roomTypeId, in: path, required: true, description: 'Id of room type', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}, {name: fields, in: query, required: false, description: 'Additional fields to return', schema: {type: string, enum: [ratePlans, availability]}}]
responses: {'200': {description: 'Room type with id = `id`', content: {application/json: {schema: {$ref: '#/components/schemas/RoomTypeResponse'}}}, headers: {X-Data-Validation-Warning: {schema: {type: string}, description: 'Warning in case of a soft validation fail.'}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/roomTypes/{roomTypeId}/ratePlans':
get:
summary: 'Get rate plans of the room type `id`'
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: roomTypeId, in: path, required: true, description: 'Id of room type', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}]
responses: {'200': {description: 'Rate plans for the room type', content: {application/json: {schema: {$ref: '#/components/schemas/RatePlansResponse'}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/roomTypes/{roomTypeId}/availability':
get:
summary: 'Get availability of the room type `id`. The availability field contains only a single key with room type id.'
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: roomTypeId, in: path, required: true, description: 'Id of room type', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}]
responses: {'200': {description: 'Availability for the room type', content: {application/json: {schema: {$ref: '#/components/schemas/AvailabilityResponse'}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/availability':
get:
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}]
responses: {'200': {description: 'Availability data for the hotel', content: {application/json: {schema: {$ref: '#/components/schemas/AvailabilityResponse'}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/ratePlans':
get:
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}]
responses: {'200': {description: 'Rate plans for the hotel', content: {application/json: {schema: {$ref: '#/components/schemas/RatePlansResponse'}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/hotels/{hotelId}/ratePlans/{ratePlanId}':
get:
parameters: [{name: hotelId, in: path, required: true, description: 'Hotel Id as returned by `GET /hotel`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: ratePlanId, in: path, required: true, description: 'Id of rate plan', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}]
responses: {'200': {description: 'Rate plan details', content: {application/json: {schema: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RatePlan'}}}, headers: {X-Data-Validation-Warning: {schema: {type: string}, description: 'Warning in case of a soft validation fail.'}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
/airlines:
get:
summary: 'Lists airlines'
parameters: [{name: limit, in: query, description: 'maximum number of records to return', required: false, schema: {default: 30, type: integer, format: int32, minimum: 0, maximum: 300}}, {name: startWith, in: query, description: 'The `id` of the first record that will be included in the result', required: false, schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: fields, in: query, description: "List of fields to return with the airline item. Selecting only `id` field leads to fastest responses as all data are retrieved from directory only.\n", required: false, schema: {default: [id, name, code], type: array, items: {type: string, enum: [bookingUri, cancellationPolicies, code, contacts, currency, dataFormatVersion, orgJsonUri, defaultCancellationAmount, description, flights, flights.items.flightInstances, id, managerAddress, name, notificationsUri, operator, updatedAt]}}}]
responses: {'200': {description: 'List of airlines. The API tries to always fulfil the requested limit, so in some cases, the `errors` field might be present.', content: {application/json: {schema: {type: object, properties: {items: {type: array, description: 'List of resolved airlines.', items: {$ref: '#/components/schemas/AirlineListItem'}}, warnings: {type: array, description: 'List of resolved airlines passing validation with unsupported declared data format version.', items: {$ref: '#/components/schemas/AirlineListError'}}, errors: {type: array, description: 'List of checked airlines whose requested data cannot be accessed (i. e. off-chain data cannot be reached) or fail validation.', items: {$ref: '#/components/schemas/AirlineListError'}}, next: {description: 'Uri to next page of records. When there''s no next page, this is not set.', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}}}}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/airlines/{airlineId}':
get:
summary: 'Get airline by `id`'
parameters: [{name: airlineId, required: true, in: path, description: 'Airline id as returned by `GET /airline`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: fields, required: false, in: query, schema: {type: array, items: {type: string, default: [id, name, description, contacts, currency, updatedAt], enum: [bookingUri, cancellationPolicies, code, contacts, currency, dataFormatVersion, orgJsonUri, defaultCancellationAmount, description, flights, flights.items.flightInstances, id, managerAddress, name, notificationsUri, operator, updatedAt]}}}]
responses: {'200': {description: 'Airline object', content: {application/json: {schema: {$ref: '#/components/schemas/AirlineDetail'}}}, headers: {X-Data-Validation-Warning: {schema: {type: string}, description: 'Warning in case of a soft validation fail.'}}}, '400': {$ref: '#/components/responses/InvalidRequestError'}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/airlines/{airlineId}/flights':
get:
summary: 'Get flights list by airline id'
parameters: [{name: airlineId, in: path, required: true, description: 'Airline Id as returned by `GET /airline`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: fields, in: query, required: false, description: 'Additional fields to return (id, origin, destination and segments are always returned).', schema: {type: string, default: [], enum: [flightInstances]}}]
responses: {'200': {description: 'Flight data', content: {application/json: {schema: {allOf: [{$ref: '#/components/schemas/windingtree-wt-airline-schemas-Flights'}, {type: object, properties: {warnings: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}, errors: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}}}]}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/airlines/{airlineId}/flights/{flightId}':
get:
summary: 'Get flight by `id`'
parameters: [{name: airlineId, in: path, required: true, description: 'Airline Id as returned by `GET /airline`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: flightId, in: path, required: true, description: 'Flight Id as returned by `GET /airline` or `GET /airline/:id/flights`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}, {name: fields, in: query, required: false, description: 'Additional fields to return (id, origin, destination and segments are always returned).', schema: {type: string, default: [], enum: [flightInstances]}}]
responses: {'200': {description: 'Flight data', content: {application/json: {schema: {$ref: '#/components/schemas/windingtree-wt-airline-schemas-Flight'}}}, headers: {X-Data-Validation-Warning: {schema: {type: string}, description: 'Warning in case of a soft validation fail.'}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/airlines/{airlineId}/flights/{flightId}/meta':
get:
summary: 'Get flight meta data'
parameters: [{name: airlineId, in: path, required: true, description: 'Airline Id as returned by `GET /airline`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: flightId, in: path, required: true, description: 'Flight Id as returned by `GET /airline` or `GET /airline/:id/flights`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}]
responses: {'200': {description: 'Flight instances', content: {application/json: {schema: {type: object, required: [flightInstancesUri], properties: {flightInstancesUri: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}}}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/airlines/{airlineId}/flights/{flightId}/instances':
get:
summary: 'Get flight instances list by flight id'
parameters: [{name: airlineId, in: path, required: true, description: 'Airline Id as returned by `GET /airline`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: flightId, in: path, required: true, description: 'Flight Id as returned by `GET /airline` or `GET /airline/:id/flights`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}]
responses: {'200': {description: 'Flight instances', content: {application/json: {schema: {type: object, properties: {items: {$ref: '#/components/schemas/windingtree-wt-airline-schemas-FlightInstances'}, warnings: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}, errors: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}}}}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
'/airlines/{airlineId}/flights/{flightId}/instances/{flightInstanceId}':
get:
summary: 'Get flight instance detail'
parameters: [{name: airlineId, in: path, required: true, description: 'Airline Id as returned by `GET /airline`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}}, {name: flightId, in: path, required: true, description: 'Flight Id as returned by `GET /airline` or `GET /airline/:id/flights`', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}, {name: flightInstanceId, in: path, required: true, description: 'Id of flight instance', schema: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-ObjectIdType'}}]
responses: {'200': {description: 'Flight instance details', content: {application/json: {schema: {allOf: [{$ref: '#/components/schemas/windingtree-wt-airline-schemas-FlightInstance'}, {type: object, properties: {dataFormatVersion: {description: 'Version number indicating the data format specification version.', type: string, format: semver, maxLength: 20}}}]}}}, headers: {X-Data-Validation-Warning: {schema: {type: string}, description: 'Warning in case of a soft validation fail.'}}}, '404': {$ref: '#/components/responses/NotFoundError'}, '422': {$ref: '#/components/responses/UnprocessableEntityError'}, '500': {$ref: '#/components/responses/InternalServerError'}, '502': {$ref: '#/components/responses/HttpBadGatewayError'}}
components:
responses:
InvalidRequestError:
description: 'The server does not understand to the request (HTTP code 400)'
content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}
NotFoundError:
description: 'The object was not found (HTTP code 404)'
content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}
UnprocessableEntityError:
description: 'The object was not found (HTTP code 422)'
content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}
InternalServerError:
description: 'Internal server error (HTTP code 500)'
content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}
HttpBadGatewayError:
description: 'Internal server error (HTTP code 502)'
content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}
ValidationError:
description: 'Upstream data validation error (HTTP code 422)'
content: {application/json: {schema: {allOf: [{$ref: '#/components/schemas/Error'}, {type: object, properties: {data: {description: 'Upstream data that failed validation against api spec or is invalid dataFormatVersion.', type: object}}}]}}}
schemas:
HotelListError:
type: object
required: [error]
properties: {error: {description: 'Human readable error from the API', type: string}, originalError: {description: 'Text of the original exception that caused this error', type: string}, data: {type: object, description: 'Additional data to this error, typically contains `id` that identifies the erroring record.'}}
HotelListItem:
allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-HotelDescriptionBase'}, {$ref: '#/components/schemas/ReducedHotelDataIndex'}, {type: object, required: [id], properties: {id: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, managerAddress: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, ratePlans: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RatePlans'}, availability: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-Availability'}, roomTypes: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RoomTypes'}}}]
HotelDetail:
allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-HotelDescription'}, {$ref: '#/components/schemas/ReducedHotelDataIndex'}, {type: object, required: [id], properties: {id: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, managerAddress: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, ratePlans: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RatePlans'}, availability: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-Availability'}, roomTypes: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RoomTypes'}}}]
ReducedHotelDataIndex:
title: 'Hotel data index fields that can be resolved in read api'
type: object
properties: {orgJsonUri: {description: 'URI of the Hotel ORG.JSON (pointing off-chain)', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}, dataFormatVersion: {description: 'Version number indicating the data format specification version.', type: string, format: semver, maxLength: 20}, notificationsUri: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType', description: 'URI pointing to an instance of the WT Notification service.'}, bookingUri: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType', description: 'URI pointing to an instance of the WT Booking service.'}, defaultLocale: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-LanguageCodeType', description: 'Code of language in which all textual information for this record is presented. If no default locale is declared, the texts are expected to be in English language.'}, guarantee: {description: 'Object used to prove that a hotel is legitimate.', type: object, properties: {claim: {description: 'Hex encoded JSON serialized claim', type: string}, signature: {description: 'Signature of a serialized `claim` signed by a private key associated with the `claim.guarantor` ETH address with the [eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign) compatible method.', type: string}}}}
RoomTypesResponse:
description: 'Array of room types'
type: object
properties: {items: {type: array, items: {$ref: '#/components/schemas/RoomTypeResponse'}}, warnings: {type: array, description: 'Array of room types warnings', items: {$ref: '#/components/schemas/HotelListError'}}, errors: {type: array, description: 'Array of room types errors', items: {$ref: '#/components/schemas/HotelListError'}}}
RoomTypeResponse:
allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RoomType'}, {type: object, properties: {availability: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-Availability'}}}]
RatePlansResponse:
type: object
properties: {items: {type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RatePlan'}}, warnings: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}, errors: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}}
AvailabilityResponse:
type: object
properties: {items: {type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-AvailabilityForDay'}}, warnings: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}, errors: {type: array, description: 'Array of Flights', items: {$ref: '#/components/schemas/AirlineListError'}}, updatedAt: {type: string, description: 'Date-time when the data was last changed. Used by consumers to handle incremental updates and caching.', format: date-time}}
AirlineListItem:
allOf: [{$ref: '#/components/schemas/windingtree-wt-airline-schemas-AirlineDescriptionBase'}, {type: object, required: [id], properties: {id: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, managerAddress: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, flights: {description: 'Flights operated by the airline', $ref: '#/components/schemas/FlightsResponse'}}}]
AirlineListError:
type: object
required: [error]
properties: {error: {description: 'Human readable error from the API', type: string}, originalError: {description: 'Text of the original exception that caused this error', type: string}, data: {type: object, description: 'Additional data to this error, typically contains `id` that identifies the erroring record.'}}
AirlineDetail:
allOf: [{$ref: '#/components/schemas/windingtree-wt-airline-schemas-AirlineDescription'}, {type: object, required: [id], properties: {id: {$ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, flights: {$ref: '#/components/schemas/windingtree-wt-airline-schemas-Flights'}}}]
FlightsResponse:
description: 'Array of flight instances'
type: array
items: {$ref: '#/components/schemas/windingtree-wt-airline-schemas-Flight'}
MetaResponse:
type: object
description: 'Collection of identifiers required to look up hotel data'
required: [address, orgJsonUri, orgJsonHash]
properties: {address: {description: 'Ethereum address of the hotel', $ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, orgJsonUri: {description: 'URI of the Hotel ORG.JSON (pointing off-chain)', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}, orgJsonHash: {description: 'Hash of the Hotel ORG.JSON contents as published on-chain', type: string}, dataIndexUri: {description: 'URI of the Hotel API data index', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}, descriptionUri: {description: 'URI of the Hotel description (pointing off-chain)', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}, ratePlansUri: {description: 'URI of the Hotel rate plans (pointing off-chain)', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}, availabilityUri: {description: 'URI of the Hotel availability (pointing off-chain)', $ref: '#/components/schemas/windingtree-wt-shared-schemas-UriType'}, dataFormatVersion: {description: 'Version number indicating the data format specification version.', type: string, format: semver, maxLength: 20}, guarantee: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-GuarantorMessage'}}
Error:
title: Error
description: 'Default schema for errors returned by API.'
properties: {status: {type: number, description: 'HTTP status'}, code: {type: string, description: 'Computer-readable error. Use this for comparison.'}, short: {type: string, description: 'Human-readable error with a short description of the error.'}, long: {type: string, description: 'Verbose explanation of what happen.'}}
windingtree-wt-shared-schemas-Contact:
title: Contact
type: object
properties: {email: {description: 'E-mail contact', type: string, format: email, example: joseph.urban@example.com, maxLength: 150}, phone: {description: 'Phone number (with country prefix and a leading + sign)', type: string, maxLength: 18, example: '+44123456789', format: phone}, url: {description: 'Url to the contact web page', type: string, format: uri}, ethereum: {description: 'Address of wallet on Ethereum', $ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, additionalContacts: {description: 'More contact options, such as Whatsapp, WeChat, Telegram, twitter handle, facebook address. Once we see high demand for a particular type of contact, we can promote them to regular contact types.', type: array, items: {type: object, required: [title, value], properties: {title: {description: 'Name of this contact options', type: string, maxLength: 100}, value: {description: 'The actual contact', type: string, maxLength: 100}}}}}
windingtree-wt-shared-schemas-CancellationPolicy:
title: 'Cancellation policy'
type: object
description: 'What is the penalty when a guest/passenger wants to cancel a reservation.'
required: [amount]
properties: {from: {description: 'After which date does this cancellation policy apply (including). If not present, this policy applies since the beginning of time. This is related to arrival and departure dates, not the date of the booking.', type: string, format: date, example: '2018-01-30'}, to: {description: 'Before which date does this cancellation policy apply(including). If not present, this policy applies until the end of the universe. This is related to arrival and departure dates, not the date of the booking.', type: string, format: date, example: '2018-02-20'}, deadline: {type: integer, description: 'How many days before hotel arrival or flight departure does this first apply. If not present, this policy applies any time.', example: 30}, amount: {type: number, format: float, description: 'Cost of cancellation in percents of the final price, 100 means non refundable. This means how much money will the hotel keep.', example: 25}}
windingtree-wt-shared-schemas-AddressType:
title: 'Postal address'
description: 'Based on output of Open Street Map''s [Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim). For formatting, take a look [here](https://github.com/OpenCageData/address-formatting).'
type: object
required: [road, houseNumber, city, countryCode]
properties: {houseNumber: {type: string, maxLength: 150}, road: {type: string, maxLength: 150}, city: {type: string, maxLength: 150}, county: {type: string, maxLength: 150}, stateDistrict: {type: string, maxLength: 150}, state: {type: string, maxLength: 150}, postcode: {type: string, maxLength: 13}, countryCode: {type: string, maxLength: 2, minLength: 2, description: 'ISO 3166-1 alpha-2 codes', format: country-code}}
windingtree-wt-shared-schemas-LegalEntityType:
title: 'Legal entity'
type: object
description: 'A legal entity that can be held responsible'
required: [name, address, contact]
properties: {name: {description: 'Entity''s name as registered with the authorities', type: string, maxLength: 300}, address: {description: 'Entity''s postal address as registered with the authorities', $ref: '#/components/schemas/windingtree-wt-shared-schemas-AddressType'}, contact: {description: 'Any way of contacting the entity', $ref: '#/components/schemas/windingtree-wt-shared-schemas-Contact'}, vatin: {description: 'VAT identification number ([EU](https://en.wikipedia.org/wiki/VAT_identification_number), [US](https://www.irs.gov/individuals/international-taxpayers/taxpayer-identification-numbers-tin), or equivalents)', type: string, maxLength: 50}, lei: {description: 'Legal Entity Identifier as defined in ISO 17442, https://en.wikipedia.org/wiki/Legal_Entity_Identifier', type: string, length: 20}}
windingtree-wt-shared-schemas-CurrencyType:
title: 'Currency code'
type: string
minLength: 3
maxLength: 3
description: 'Three letter ISO 4217 currency code.'
format: currency-code
windingtree-wt-shared-schemas-DescriptionType:
title: 'Markdown description'
description: 'Text description in simple Markdown format (bold, italic, titles, line break and paragraph format). Particular flavour of markdown is yet to be decided.'
type: string
maxLength: 3000
windingtree-wt-shared-schemas-EthereumAddressType:
title: 'Ethereum address'
type: string
description: 'Ethereum address in hexadecimal format (with leading 0x) or an ENS name.'
maxLength: 300
windingtree-wt-shared-schemas-NameType:
title: 'Entity name'
description: 'Human readable name identifying an entity (shown to users in search results, hotel/room details, etc)'
type: string
maxLength: 150
windingtree-wt-shared-schemas-ObjectIdType:
title: ID
description: 'Vendor string ID'
type: string
maxLength: 100
example: 1234-abcd
windingtree-wt-shared-schemas-TimezoneType:
title: 'Timezone code'
description: 'Timezone name according to https://www.iana.org/time-zones (refer to zone.tab)'
type: string
maxLength: 40
format: timezone
windingtree-wt-shared-schemas-UriType:
title: URI
description: 'URI for linking resources. The maximal length is 1500 to save space.'
type: string
format: uri
maxLength: 1500
windingtree-wt-shared-schemas-LanguageCodeType:
title: 'Language code'
description: 'Two letter language code based on ISO 639-1 standard'
type: string
format: language-code
length: 2
windingtree-wt-shared-schemas-RelationshipSignatureType:
description: "Organization A (`subject`) publishes this object to tell the world that an Organization B (`guarantor`)\nagreed to be in an asymmetric relationship with the `subject`. Nature of such relationship can change\nto fit any particular use case.\nThe flow should be like this:\n 1. `subject` asks `guarantor` to establish a certain kind of relationship.\n 2. `guarantor` does its due dilligence of the `subject`.\n 3. `guarantor` creates `claim` and signs it. Typically, a `guarantor` address will be of a smart contract,\n which cannot sign data. So a `guarantor` would sign the data with a private key associated with one of\n the `associatedKeys` of the `guarantor`'s Organization smart contract. That is the `signature`.\n 6. `guarantor` sends the `claim` and the `signature` back to the `subject`.\n 7. `subject` publishes the `claim` and `signature` in its data.\n"
type: object
properties: {claim: {description: "A message that is signed by `guarantor`. This cannot be a JSON object due to its serialization rules\nambiguity. Instead, this is a hex encoded representation of a `RelationshipClaimType`\nserialized by the signing party to prevent inconsistencies.\n", type: string}, signature: {description: "Signature of a serialized `claim` signed by a private key associated (either directly or via a `associatedKeys`\nrelationship) with the `claim.guarantor` ETH address. The signature has to conform to the\n[eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign) method.\n", type: string}}
windingtree-wt-shared-schemas-RelationshipClaimType:
description: 'A message used to prove an asymmetric relationship between two subjects. It has a limited validity in time.'
type: object
required: [subject, guarantor, expiresAt]
properties: {subject: {description: 'Subjects''s ethereum address', $ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, guarantor: {description: 'Guarantor''s ethereum address', $ref: '#/components/schemas/windingtree-wt-shared-schemas-EthereumAddressType'}, expiresAt: {description: 'When the relationship will expire. UNIX timestamp in seconds.', type: string, format: timestamp}}
windingtree-wt-hotel-schemas-HotelDataIndex:
title: 'Hotel data index'
description: 'Landing index for hotel resources. Link to this document is stored in WT-Index smart contract hotel record'
type: object
required: [dataFormatVersion, descriptionUri]
properties: {dataFormatVersion: {description: 'Version number indicating the data format specification version.', type: string, format: semver, maxLength: 20}, descriptionUri: {description: 'URI pointing to the HotelDescription data resource', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType'}, ratePlansUri: {description: 'URI pointing to RatePlans data resource', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType'}, availabilityUri: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType', description: 'URI pointing to Availability data resource'}, notificationsUri: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType', description: 'URI pointing to an instance of the WT Notification service.'}, bookingUri: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType', description: 'URI pointing to an instance of the WT Booking service.'}, defaultLocale: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-LanguageCodeType', description: 'Code of language in which all textual information for this record is presented. If no default locale is declared, the texts are expected to be in English language.'}, guarantee: {allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RelationshipSignatureType'}, {description: "Object used to prove that a hotel is legitimate. A trust level is evaluated for hotel's guarantor\n"}]}}
windingtree-wt-hotel-schemas-HotelDescription:
title: 'Hotel description'
allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-HotelDescriptionBase'}, {type: object, required: [name, description, contacts, address, timezone, currency, defaultCancellationAmount]}]
windingtree-wt-hotel-schemas-HotelDescriptionMinimal:
title: 'Minimal hotel description definition with a required subset'
allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-HotelDescriptionMinimalBase'}, {type: object, required: [name, location, website]}]
windingtree-wt-hotel-schemas-HotelDescriptionMinimalBase:
title: 'Minimal hotel description definition'
description: 'Basic properties of a hotel'
type: object
properties: {location: {description: 'Geo-location in GPS format', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-Location'}, name: {description: 'Name of the hotel to display to users', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-NameType'}, website: {description: 'URL of a hotel website', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType'}, description: {description: 'Short text description of the hotel to show to users.', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-DescriptionType'}, contacts: {type: object, description: 'A set of contacts', required: [general], properties: {general: {description: 'Primary contact', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-Contact'}}}, address: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-AddressType'}}
windingtree-wt-hotel-schemas-HotelDescriptionBase:
allOf: [{$ref: '#/components/schemas/windingtree-wt-hotel-schemas-HotelDescriptionMinimalBase'}, {type: object, title: 'Hotel description definition', description: 'All properties of a hotel', properties: {roomTypes: {description: 'Room types in the hotel', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-RoomTypes'}, operator: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-LegalEntityType'}, timezone: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-TimezoneType'}, currency: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-CurrencyType'}, spokenLanguages: {description: 'List of languages that people can use when communicating with this hotel.', type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-LanguageCodeType'}}, category: {description: 'Hotel category for easier filtering. These values are placeholder strings that are coincidentally in English and should be localized by the end user interface.', type: string, enum: [apartment, 'bed and breakfast', boat, cabin, camp, 'holiday home', hostel, hotel, house, inn, 'mobile home', motel, other, spa]}, images: {description: 'Images. We don''t process them in any way, so they should be in the best quality available and in a common format such as JPEG. As we don''t have any tagging, the most important picture should come first.', type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType'}}, amenities: {description: 'Hotel products/services provided to guests. If a service is stated here, it is provided.', type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-HotelAmenityItem'}}, tags: {description: 'Free form textual tags that can describe the hotel. These can be eventually used for searching.', type: array, items: {type: string}}, updatedAt: {type: string, description: 'Date-time when the data was last changed. Used by consumers to handle incremental updates and caching.', format: date-time}, defaultCancellationAmount: {type: number, format: float, description: 'Cost of cancellation in percents of the final price, 100 means non refundable. This is a default amount of how much money will the hotel keep if no other cancallation policy is applicable.', example: 25}, cancellationPolicies: {description: 'A list of policies under which it is possible to cancel a reservation.', type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-CancellationPolicy'}}}}]
windingtree-wt-hotel-schemas-RoomTypes:
type: array
description: 'Array of RoomTypes'
items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RoomType'}
windingtree-wt-hotel-schemas-RoomType:
type: object
required: [id, name, description, occupancy, totalQuantity]
properties: {id: {description: 'ID of the room type', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-ObjectIdType', example: 123-afg-34}, name: {description: 'Name of the room type to show to users', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-NameType'}, description: {description: 'Room type description in plain text', $ref: '#/components/schemas/windingtree-wt-hotel-schemas-DescriptionType'}, category: {type: string, description: 'Room category for easier filtering. These values are placeholder strings that are coincidentally in English and should be localized by the end user interface.', enum: [apartment, barn, boat, bungalow, bunk, cabin, condominium, 'double or twin room', 'double room', 'double room single use', duplex, lodge, other, penthouse, 'quadruple room', 'recreation vehicle', room, 'shared room', 'single room', studio, suite, teepee, tent, 'tree house', 'triple room', 'twin room', villa, yurt]}, totalQuantity: {type: integer, format: int32}, occupancy: {type: object, required: [max], properties: {min: {type: integer, format: int32, description: 'Minimal number of occupants to rent the room.', default: 1, example: 1}, max: {type: integer, format: int32, description: 'Maximal number of occupants to rent the room.', example: 3}}}, amenities: {description: 'Room products/services provided to guests. If a service is stated here, it is provided.', type: array, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RoomAmenityItem'}}, tags: {description: 'Free form textual tags that can describe the room. These can be eventually used for searching.', type: array, items: {type: string}}, images: {description: 'Images. We don''t process them in any way, so they should be in the best quality available and in a common format such as JPEG. As we don''t have any tagging, the most important picture should come first.', type: array, minItems: 0, maxItems: 30, uniqueItems: true, items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-UriType', description: 'image uri', example: 'https://example.com/my-image.jpg'}}, updatedAt: {type: string, format: date-time, description: 'Date-time when the data was last changed. Used by consumers to handle incremental updates and caching.'}}
windingtree-wt-hotel-schemas-RatePlans:
type: array
description: 'Array of RatePlans'
items: {$ref: '#/components/schemas/windingtree-wt-hotel-schemas-RatePlan'}
windingtree-wt-hotel-schemas-RatePlan:
description: "Rate plan for specified room types. All prices are meant for a single room for a single night for a single person.\nWe recommend using [wt-pricing-algorithms](https://github.com/windingtree/wt-pricing-algorithms) library for this.\n\nAlgorithm to calculate price\n- choose the currency you want to compute the price in\n- pick the right ratePlan(s) based on the chosen currency, availableForTravel field and provided booking dates\n- check restrictions and drop rate plans that the booking doesn't meet\n- for every rate plan as rp_i\n - for every person as p_j\n apply the best of any fitting price m