{"id":451,"date":"2021-12-20T16:21:50","date_gmt":"2021-12-20T15:21:50","guid":{"rendered":"https:\/\/tomp-wg.org\/?p=451"},"modified":"2021-12-20T16:21:51","modified_gmt":"2021-12-20T15:21:51","slug":"on-demand-standard","status":"publish","type":"post","link":"https:\/\/tomp-wg.org\/?p=451","title":{"rendered":"On-Demand standard"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright size-shuttle-column3-1\/3 is-resized\"><img loading=\"lazy\" src=\"https:\/\/tomp-wg.org\/wp-content\/uploads\/2021\/12\/pexels-rodolfo-clix-1521580-380x107.jpg\" alt=\"\" class=\"wp-image-484\" width=\"395\" height=\"112\" title=\"\"\/><figcaption><em>Standardizing data for on-demand services<\/em><\/figcaption><\/figure><\/div>\n\n\n\n<p>MobilityData is a non-profit organization that develops and maintains mobility standards such as GFBS and GTFS. It recently started the GOFS project, which will result in GTFS-GOFS. The first part of GOFS will be released this year, and the TOMP-WG has been able to give advice and input for this first release. Instead of creating another standard, we agreed together to get aligned. The TOMP-API moved a bit towards the GOFS needs, making them generic and the initial GOFS proposal moved a bit towards the TOMP-API. Altogether a great example of how alignment further enhances interoperability!<\/p>\n\n\n\n<h2>What is the impact?<\/h2>\n\n\n\n<p class=\"has-normal-font-size\">There are two major changes on the TOMP-API, but they are both non-breaking: a functional split of the &#8216;plannings endpoint&#8217; and a simplification of the booking for single legs.<\/p>\n\n\n\n<h4>Functional split of plannings endpoint<\/h4>\n\n\n\n<p class=\"has-normal-font-size\">We added 2 endpoints: &#8216;inquiry&#8217; and &#8216;offer&#8217;. Both are in the planning module and will replace the endpoint plannings in one of the upcoming versions (it is marked as deprecated).<\/p>\n\n\n\n<p class=\"has-normal-font-size\">Inquiry is actually the plannings endpoint with the query parameter &#8216;booking-intent&#8217;=false. It is supposed to return a set of (in case of GOFS containing one or none) options. These options are not yet offers, but just informational requests. This endpoint can be called very often and shouldn&#8217;t delay the process of creating offers and booking them.<br>That&#8217;s also a reason why it is handy to split those 2 functionalities.<\/p>\n\n\n\n<p>Offer, on the other hand, is a request to reserve an asset (although not final). This endpoint is the &#8216;bridge&#8217; between the planning and the real booking and will replace the plannings endpoint with &#8216;booking-intent&#8217;=true.<\/p>\n\n\n\n<h4>Simplification of booking option (single leg)<\/h4>\n\n\n\n<p>The other extension is actually a simplification. In the previous setup, it was mandatory to return an array of legs in each booking option. For most implementors, this is a bit awkward: they always return only one leg, containing one asset (or asset type). In version 1.3.0 it will be possible to return booking options, without the legs. But<br>in that case, you have at least to return the start and end time in the booking AND supply the &#8216;mainAssetType&#8217;. That should be the asset type that was returned in the leg.<\/p>\n\n\n\n<p>This example will clarify, this is in version 1.2.2<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em>{ \"validUntil\": \"2021-11-30T10:04:14.059Z\",\n  \"options\": &#91;\n    { \"id\": \"unique-booking-id\",\n      \"from\": { ... },\n      \"to\": { ... },\n      \"legs\": &#91;\n        {\n          \"id\": \"unique-leg-id (in case of single leg, recommended to use the booking-id)\",\n          \"from\": { ... },\n          \"to\": { ... },\n          \"departureTime\": \"2021-11-30T10:04:14.059Z\",\n          \"arrivalTime\": \"2021-11-30T10:04:14.059Z\",\n          \"assetType\": { \"id\": \"simple car\", \"assetClass\": \"CAR\" }\n        }\n      ],\n      \"pricing\": {\n      \"estimated\": true, \"class\": \"FAIR\", \"parts\": &#91; { \"amount\": 3.96, \"currencyCode\": \"EUR\", \"type\": \"FIXED\" } ]\n      }\n    }\n  ]\n}<\/em><\/code><\/pre>\n\n\n\n<p>And this in version 1.3.0:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em>{ \"validUntil\": \"2021-11-30T10:04:14.059Z\",\n  \"options\": &#91;\n    { \"id\": \"unique-booking-id\",\n      \"from\": { ... },\n      \"to\": { ... },<\/em>\n      <em>\"departureTime\": \"2021-11-30T10:04:14.059Z\",\n      \"arrivalTime\": \"2021-11-30T10:04:14.059Z\",\n      \"mainAssetType\": { \"id\": \"simple car\" }\n      \"pricing\": {\n      \"estimated\": true, \"class\": \"FAIR\", \"parts\": &#91; { \"amount\": 3.96, \"currencyCode\": \"EUR\" } ]\n      }\n    }\n  ]\n}<\/em><\/code><\/pre>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignleft size-large\"><img loading=\"lazy\" width=\"224\" height=\"180\" src=\"https:\/\/tomp-wg.org\/wp-content\/uploads\/2021\/12\/mobilitydata.png\" alt=\"\" class=\"wp-image-482\"\/><\/figure><\/div>\n\n\n\n<p>With those 2 adjustments, we can align with GTFS-GOFS, where GOFS will use the file-based structure to disseminate information (MaaS level 1), but we both (GOFS and TOMP-API) use the inquiry endpoint to get accurate options for a specific trip (in GOFS terms &#8216;accurate pricing&#8217;). Of course, it is free for TOMP implementors to return more data than GOFS demands. That would mean, that upgrading older versions of the TOMP-API for On-Demand Operators, implies you&#8217;ve already started with implementing GTFS-GOFS.<\/p>\n\n\n\n<p>As TOMP-WG we could have a look together to make a generic translator around the current &#8216;Operator Information&#8217; module, to produce the GOFS files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MobilityData is a non-profit organization that develops and maintains mobility standards such as GFBS and GTFS. It recently started the GOFS project, which will result in GTFS-GOFS. The first part<span class=\"post-excerpt-end\">&hellip;<\/span><\/p>\n<p class=\"more-link\"><a href=\"https:\/\/tomp-wg.org\/?p=451\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":484,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[58,57],"jetpack_featured_media_url":"https:\/\/tomp-wg.org\/wp-content\/uploads\/2021\/12\/pexels-rodolfo-clix-1521580-scaled.jpg","_links":{"self":[{"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/posts\/451"}],"collection":[{"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=451"}],"version-history":[{"count":8,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":486,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions\/486"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=\/wp\/v2\/media\/484"}],"wp:attachment":[{"href":"https:\/\/tomp-wg.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomp-wg.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}