Plugin

Plugin

new Plugin(args)

For a comprehensive list of methods visit the Plugin Development page.


Source:
Parameters:
Name Type Description
args Object

New / Overwriting attributes for the Plugin.

Members

jobs

Background and schedule Jos

Source:

Methods

(async) validateToken(args) → {Boolean}

Check the validity of an integration token.

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

Returns:
Type:
Boolean
  • The token validity True/False

tokenTemplate()

Returns the the token template of a plugin. Properties are dynamic since every attribute should correspond to a token key, every attribute should contain at least the type (ie text) a regExp and a description. The regExp property gets decomposed into both source and flags as strings.

Source:

(async) getProfile(args) → {Profile}

Returns the profile details of the account.

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

Returns:
Type:
Profile
  • The profile details.

(async) updateProfile(args) → {boolean}

Updates profile information

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
payload Profile

Updated profile information

Returns:
Type:
boolean
  • True/False success status.

(async) createLocation(args) → {Object|string}

Create a Location

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Location

The new location details.

Returns:
  • Type:
    Object

    retVal - An object containing return values.

  • Type:
    string

    retVal.locationId - The new location unique identifier.

(async) updateLocation(args) → {boolean}

Update a Location

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

locationId string

The unique identifier of the location to update.

payload Location

The new location details.

Returns:
Type:
boolean
  • True/False success status.

(async) getProducts(args) → {Object|Array.Product}

Get the list of products for a given location

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

locationId Object

A location unique identifier to get the list of products.

Returns:
  • Type:
    Object

    retVal - An object containing return values.

  • Type:
    Array.Product

    retVal.products - An array of matching products.

(async) createProduct(args) → {Object|string}

Create a Product

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

locationId string

The unique identifier of the location that will contain the product.

payload Product

The new product details.

Returns:
  • Type:
    Object

    retVal - An object containing return values.

  • Type:
    string

    retVal.locationId - The new location unique identifier.

(async) updateProduct(args) → {boolean}

Update a Product

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

locationId string

The unique identifier of the location that contains the product.

productId string

The unique identifier of the product to update.

payload Product

The new location details.

Returns:
Type:
boolean
  • True/False success status.

(async) searchBooking(args) → {object|Array.<Booking>}

Search for bookings with a criteria.

Source:
Parameters:
Name Type Description
args Object

Booking search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search criteria object.

Name Type Description
bookingId string

a Booking Id.

dateFormat string

Date format sent, using momentjs formatting.

purchaseDateStart string

Date of purchase start.

purchaseDateEnd string

Date of purchase end.

travelDateStart string

Date of travel start.

travelDateEnd string

Date of travel end.

holder Holder

Search for a particular holder.

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Array.<Booking>

    retVal.bookings - Array of Bookings matching the criteria.

(async) searchProducts(args) → {object|Array.<Hotel>|Array.<Product>}

Search for bookable products

Source:
To Do:
  • Define search criteria and Hotel/Product spec.
Parameters:
Name Type Description
args Object

Product search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search criteria object.

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Array.<Hotel>

    retVal.hotels - Array of bookable hotels.

  • Type:
    Array.<Product>

    retVal.products - Array of bookable activities.

(async) searchAvailability(args) → {object|Array.<Availability>}

Search for availability of products winthin dates of travel.

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search spect object.

Name Type Description
dateFormat string

Date format sent, using momentjs formatting.

travelDateStart string

Date of travel start.

travelDateEnd string

Date of travel end.

occupancies Array.<Occupancy>

Occupancy detail.

Returns:
  • Type:
    object

    retVal - the return object

  • Type:
    Array.<Availability>

    retVal.availability - Array of availability objects

(async) availabilityCalendar(args) → {object|Array.<Availability>}

Retrieve an availability calendar over a date range

Source:
Parameters:
Name Type Description
args Object

Availability search arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search spect object.

Name Type Description
dateFormat string

Date format sent, using momentjs formatting.

travelDateStart string

Date of travel start.

travelDateEnd string

Date of travel end.

occupancies Array.<Occupancy>

Occupancy detail.

Returns:
  • Type:
    object

    retVal - the return object

  • Type:
    Array.<Availability>

    retVal.availability - Array of availability objects

(async) searchQuote(args) → {object|Quote}

Quote an availability.

Source:
Parameters:
Name Type Description
args Object

Availability quote arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search spect object.

Name Type Description
id string

An availability Id.

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Quote

    retVal.quote - A Quote Object instance.

(async) createBooking(args) → {object|Booking}

Create a Booking

Source:
Parameters:
Name Type Description
args Object

Booking arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search spect object.

Name Type Description
id string

A quote id.

holder Holder

Contact information of the booking holder.

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Booking

    retVal.booking - A Booking object.

(async) searchProductsForItinerary(args) → {object|Array.<ItineraryProduct>}

Search for bookable products

Source:
Parameters:
Name Type Description
args Object
Name Type Description
token Object

Authentication token

payload object

Search criteria

Name Type Attributes Description
productId string <optional>

Optional specific product to search for

optionId string <optional>

Optional specific product option to search for

searchInput string <optional>

Optional text search across all fields

forceRefresh boolean <optional>

Optional flag to bypass cache

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Array.<ItineraryProduct>

    retVal.products - An array of products spec objects.

(async) searchAvailabilityForItinerary(args) → {SearchAvailabilityForItineraryResponse}

Search for product availability

Source:
Parameters:
Name Type Description
args Object
Name Type Description
token Object

Authentication token

payload object

Search criteria

Name Type Attributes Default Description
optionId string

ItineraryProduct option ID

startDate string

YYYY-MM-DD format

paxConfigs Array.<PaxConfig>

Required for room-based products

chargeUnitQuantity number <optional>
1

Number of units to book

(async) addServiceToItinerary(args) → {AddServiceToItineraryResponse}

Create an itinerary

Source:
Parameters:
Name Type Description
args Object
Name Type Description
token Object

Authentication token

payload object

Booking/Quote details

Name Type Attributes Description
QB string

'Q' for quote, 'B' for booking

quoteName string

Name of the booking/quote

quoteId string <optional>

identifier of the booking/quote, if one is provided, we are expecting the service line to be inserted to an existing booking/quote

lineId string <optional>

identifier of the service line in the booking/quote, if one is provided, we are expecting an existing service line to be updated

rateId string <optional>

Rate identifier, we are sending 'Default' if no rates are provided by the check availability call

optionId string

Option identifier of the service line

startDate string

Start date always in (YYYY-MM-DD) format

reference string <optional>

Reference number from external system

paxConfigs Array.<PaxConfig>

Passenger configurations

extras Array.<Object> <optional>

Additional extras

Name Type Description
selectedExtra Extra

Selected extra

quantity number

quantity

puInfo PUDOInfo <optional>

Pickup information

doInfo PUDOInfo <optional>

Dropoff information

notes string <optional>

Additional notes

customFieldValues Array.<CustomFieldValue> <optional>

Custom field values

(async) getCreateItineraryFields(args) → {object|Array.<CreateItineraryCustomField>}

Some additional fields available for the addServiceToItinerary call

Source:
Parameters:
Name Type Description
args Object
Name Type Description
token Object

Authentication token

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Array.<CreateItineraryCustomField>

    retVal.customFields - An array of custom fields spec objects.

(async) searchItineraries(args) → {object|Array.<ItineraryBooking>}

Search for itineraries

Source:
Parameters:
Name Type Description
args Object
Name Type Description
token Object

Authentication token

payload object

Search criteria

Name Type Description
purchaseDateStart string

Start date for purchase search (YYYY-MM-DD)

purchaseDateEnd string

End date for purchase search (YYYY-MM-DD)

travelDateStart string

Start date for travel search (YYYY-MM-DD)

travelDateEnd string

End date for travel search (YYYY-MM-DD)

name string

Search by customer name

bookingId string

Search by booking ID

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Array.<ItineraryBooking>

    retVal.bookings - An array of itinerary bookings matching search criteria.

(async) queryAllotment(args) → {object|Array.<Allotment>}

Query Allotment

Source:
Parameters:
Name Type Description
args Object

Allotment query arguments.

Name Type Description
token Object

A token definition, it's content varies between integrations.

payload Object

Search spect object. dateFormat = 'DD/MM/YYYY', startDate, endDate, keyPath,

Name Type Description
dateFormat string

Date format to use for params and return value (i.e. DD/MM/YYYY

startDate string

Start date for the query of allotment objects

endDate string

End date for the query of allotment objects

keyPath string

End date for the query of allotment objects

Returns:
  • Type:
    object

    retVal - the return object.

  • Type:
    Array.<Allotment>

    retVal.allotment - An array of allotment spec objects.