bookachoo

Post Specific Search

Request up-to-date price information of a specific train journey.

Request
Query parameters
NameTypeDescription
from required string

Code of departure train station or airport

  • IATA code from=AMS
  • UIC code from=8400058
to required string

Code of arrival train station or airport

  • IATA code to=BER
  • IBNR to=8011170
date required string Departure date in YYYY-MM-DD format, pattern: /^\d{4}-\d{2}-\d{2}$/
departure enum Part of the day to depart inOne of:morning, afternoon, evening, night
return_date string Optional departure date of the return journey in YYYY-MM-DD format, pattern: /^\d{4}-\d{2}-\d{2}$/
return_departure enum Optional part of the day, for the return journey, to depart inOne of:morning, afternoon, evening, night
pax required string Number of adult passengers and children (between parentheses), pattern: /^\d\(\d\)$/
  • Single adult pax=1(0)
  • Two parents, one child pax=2(1)
JSON payload

This object should contain those details that will narrow the search to one specific journey.
At least one train or plane must be specified.

Property pathTypeDescription
planes string[]

List of flight numbers

Example: ["KL-204"]
time string Near exact time of departure in 24-hour hh:mm format
Example: "08:55"
trains string[]

List of train numbers

Example: ["ICE-140"]
transfers string[]

Optional list of train station and/or airport codes

pricePoint string

Optional monetary amount the ticket prices should be close to

Example: "72.50"
Responses
  • Successful response with specific offer

    Body
    Property pathTypeDescription
      ids string[]

    UUIDs identifying the itinerary segments

    origin object

    Location of departure

    destination object

    Location of arrival

    itinerary object

    Itinerary of the outbound travel segments

    returnItinerary optional object

    Optional itinerary of the inbound trip segments

    priceTiers object

    Offerings in various price categories

  • Bad request due to invalid query parameters or request payload.
    A non-unique result will also cause a 400.

    Body
    Property pathTypeDescription
    error object  
    error.description optional string

    Optional longer explanation describing the error.

    error.message string

    Concise error message.

    error.reason optional string

    Optional underlying reason that caused the error to happen.

    Empty trains and planes
    {
      "error": {
        "message": "Please specify trains and/or planes",
        "description": "To search for offers at least one train or plane needs to be specified."
      }
    }
    Ambiguous result
    {
      "error": {
        "message": "Non-unique search result",
        "description": "The search query resulted in more than one offer being found.",
        "reason": "Search criteria are not specific enough."
      }
    }
  • Unauthorized due to invalid or missing authentication token

    Headers
    NameDescription
    WWW-Authenticate

    Required authentication method

    Example: Basic realm="/calendar"; charset="UTF-8"
    Body
    Property pathTypeDescription
    error object  
    error.description optional string

    Optional longer explanation describing the error.

    error.message string

    Concise error message.

    error.reason optional string

    Optional underlying reason that caused the error to happen.

    Example
    WWW-Authenticate: Basic realm="/calendar"; charset="UTF-8"
    {
      "error": {
        "message": "Authorization required",
        "description": "Price calendar endpoint is for authorized consumers only.",
        "reason": "Unable to find authentication token in request"
      }
    }
  • No matching offer could be found

    Body
    Property pathTypeDescription
    error object  
    error.description optional string

    Optional longer explanation describing the error.

    error.message string

    Concise error message.

    error.reason optional string

    Optional underlying reason that caused the error to happen.

    Example
    {
      "error": {
        "message": "Offer not found",
        "description": "The search query did not return any matching offers.",
        "reason": "Search criteria may be too restrictive."
      }
    }