Dual Approaches for a single Use case

Dual Approaches for a single Use case

There are identified dual approaches usable for a single use case in the OSDM API. Each of the use cases is described here with identified preferred and alternative request.

Requesting Offers for known Vehicle Number

When the reseller/distributor performs trip planning in its own system and wants to intruct the distributor/fare provider on desired trip and legs, there is trip specification structure to describe the trip. This is also usable when purchaser requests specified products for specified vehicle number, e.g. direct seat/berth reservation booking.

The preferred solution uses the trip specification. The alternate solution uses trip search criteria with vehicle filter. It is used for HERMES compatibility as well as when the carrier of the service is not known.

Offers for known Vehicle Number by Trip Specification

{
    "tripSpecifications": [
        {
            "legs": [
                {
                    "timedLeg": {
                        "start": {
                            "stopPlaceRef": {
                                "stopPlaceRef": "",
                                "objectType": "StopPlaceRef"
                            },
                            "serviceDeparture": {
                                "timetabledTime": ""
                            }
                        },
                        "end": {
                            "stopPlaceRef": {
                                "stopPlaceRef": "",
                                "objectType": "StopPlaceRef"
                            },
                            "serviceArrival": {
                                "timetabledTime": ""
                            }
                        },
                        "service": {
                            "vehicleNumbers": [
                                ""
                            ],
                            "carriers": [
                                {
                                    "ref": ""
                                }
                            ]
                        }
                    }
                }
            ]
        }
    ]
}

Offers for known Vehicle Number by Trip Search Criteria-Vehicle Filter

{
    "tripSearchCriteria": {
        "departureTime": "",
        "origin": {
            "objectType": "StopPlaceRef",
            "stopPlaceRef": ""
        },
        "destination": {
            "objectType": "StopPlaceRef",
            "stopPlaceRef": ""
        },
        "parameters": {
            "dataFilter": {
                "vehicleFilter": {
                    "vehicleNumbers": [
                        ""
                    ]
                }
            }
        }
    }
}