Some organisations may have their own journey planner (i.e. SJ and SilverRail for now) and will use TripSpecifications when calling NDS for offers. In TripSpecification all legs in a trip are specified with enough information to find a match in the corresponding IMS. The source for the information in the journey planner must be Samtrafiken traffic data for sales channels (NeTEx).
The picture below shows the TripSpecification definition in OSDM v 3.0.2. Fields marked with a red star is mandatory in OSDM. In the Samtrafiken ACCESS implementation the mandatory fields are extended to the fields marked with yellow.
start
The stop and time for the start of the the trip.
In the Samtrafiken ACCESS API, the codelist for stops will contain all Samtrafiken’s sellable national stop IDs (known as “rikshållplatser”). The stop IDs contain 9 digits and they will be used according to the codelist urn:x_swe:stn:nnnnnnnnn, where nnnnnnnnn is the stop ID.
List of stops used in Samtrafiken ACCESS:
The timeTabledtime should be in local time
end
The stop and time for the end of the the trip.
In the Samtrafiken ACCESS API, the codelist for stops will contain all Samtrafiken’s sellable national stop IDs (known as “rikshållplatser”). The stop IDs contain 9 digits and they will be used according to the codelist urn:x_swe:stn:nnnnnnnnn, where nnnnnnnnn is the stop ID.
List of stops used in Samtrafiken ACCESS:
The timeTabledtime should be in local time
mode
The transport mode for the leg. Use the OSDM ptMode enum. The list of transport modes used in Samtrafiken ACCESS with the corresponding NeTEx value:
NeTEx - ServiceJourney.TransportMode
productCategory
In the Samtrafiken ACCESS API, the product categories are used according to the code list urn:x_swe:sbc:xx where xx is the product category code (service brand code).
NeTEx - ServiceJourney.productCode
vehicleNumbers
The vehicleNumber should be the published train number when possible. For buses and commuter trains without unique id:s use the line number.
Trains: NeTEx - TrainNumber.ForAdvertisment
Buses/trains without unique id:s: NeTEx - Line.PublicCode
carriers
In the Samtrafiken ACCESS API, the carrier IDs are used according to the codelist urn:x_swe:carrier:nnn, where nnn is the carrier ID.
publishedServiceName
Bör vi kräva att även det här fältet fylls i? Är väl oftast samma som vehicleNumbers
lineNumbers
Sammas om ovan. Men bör kanske anges vid RKM-trafik mm där linjebegreppet är centralt.
attributes
When the tickets are created by NDS attributes needed for creating the tickets may be needed in the request.This must be specified further.
Example SJ X2000 train Stockholm - Göteborg
{ "objectType": "OfferCollectionRequest", "tripSpecifications": [ { "externalRef": "05ba799b-2f92-4c23-9336-a625795006ad|0|48ee70c7-99db-4c12-bfe6-422a30afc069", "legs": [ { "externalRef": "leg1", "timedLeg": { "start": { "stopPlaceRef": { "stopPlaceRef": "urn:x_swe:stn:740000001", "objectType": "stopPlaceRef" }, "serviceDeparture": { "timetabledTime": "2023-09-15T06:27:00+02:00" } }, "end": { "stopPlaceRef": { "stopPlaceRef": "urn:x_swe:stn:740000002", "objectType": "stopPlaceRef" }, "serviceArrival": { "timetabledTime": "2023-09-15T09:35:00+02:00" } }, "service": { "vehicleNumbers": [ "421" ], "mode": { "ptMode": "HIGH_SPEED_TRAIN" }, "productCategory": { "name": "Snabbtåg", "shortName": "Snabbtåg", "productCategoryRef": "urn:x_swe:sbc:ST" }, "carriers": [ { "ref": "urn:x_swe:carrier:74", "name": "SJ" } ] } } } ], "isPartOfInternationalTrip": false } ], "offerSearchCriteria": { "offerMode": "INDIVIDUAL", "currency": "SEK" }, "anonymousPassengerSpecifications": [ { "externalRef": "Adult", "type": "PERSON" } ], "corporateCodes": [], "promotionCodes": [] }
Example SL subway
{ "tripSpecifications": [ { "externalRef": "05ba799b-2f92-4c23-9336-a625795006ad|0|48ee70c7-99db-4c12-bfe6-422a30afc069", "legs": [ { "externalRef": "8dff6e54-4444-4749-8a74-789281057f12|0|0", "timedLeg": { "start": { "stopPlaceRef": { "stopPlaceRef": "urn:x_swe:stn:740020757", "objectType": "stopPlaceRef" }, "serviceDeparture": { "timetabledTime": "2023-10-03T12:38:00+02:00" } }, "end": { "stopPlaceRef": { "stopPlaceRef": "urn:x_swe:stn:740021650", "objectType": "stopPlaceRef" }, "serviceArrival": { "timetabledTime": "2023-10-03T13:35:00+02:00" } }, "service": { "vehicleNumbers": [ "13" ], "mode": { "ptMode": "UNDERGROUND", "name": "Underground" }, "productCategory": { "name": "County traffic", "shortName": "LT", "productCategoryRef": "urn:x_swe:sbc:LT" }, "carriers": [ { "ref": "urn:x_swe:carrier:275", "name": "SL" } ] } } } ], "isPartOfInternationalTrip": false } ], "offerSearchCriteria": { "offerMode": "INDIVIDUAL", "currency": "SEK" }, "anonymousPassengerSpecifications": [ { "externalRef": "443a49be-3ff3-47a3-8efb-1def96c2be29", "type": "PERSON" } ], "corporateCodes": [], "promotionCodes": [] }