Find trips

Please make sure you read the Conventions before continuing with this guide.

Requirements.

You will need an X-API-KEY.

Finding trips

You will interact with the /inventory-trips/trips endpoint of the Inventory Bucket to find a trip given some parameters.

Parameter Type Example
departureDate Date formatted as yyyy-mm-dd 2017-10-28
returnDate Date formatted as yyyy-mm-dd if provided the results will include return trips 2017-10-28
fareIds Array 5910cfbafa1b904d0c000013:1,5910cfbafa1b904d0c000012:1
destinationId String 5910cfbafa1b904d0c000015
originId String 5910cfbafa1b904d0c000014
providersId String 5910cfbafa1b904d0c000017
productId String 5910cfbafa1b904d0c000016

Notice the fareIds is not only an array of fareIds, but they include the number of passengers for that fare Id as well. The fareId and the qty are separated by a colon :.

The originId and destinationId parameters are station ids.

The response will contain zero or more departure and return Trips. For each Trip, pricing information can be found in the fares property, or the fareClasses property if you performed a search for a product that has Fare Classes configured.