-
Notifications
You must be signed in to change notification settings - Fork 41
Booking phase
The booking phase is more complex: in a transactional way the MP has to book all the legs/assets at (different) TOs.
First, the default workflow for booking is described. This is generic for every booking. Book the offer from the Planning phase, for each leg in the trip, and after that, commit all the legs. more...
The one-stop booking was introduced in version 1.4, to optimize the booking flow for many operators, who don't work with offers. The 'offer' can be constructed from external sources (like GBFS, GTFS, NeTEx or many others), and in the booking request you can request a bike of a specific type or a specific asset. more...
The TO can request personal information for validation or to check its terms and conditions. This can be done by returning a specific condition in the planning phase, this information has to be delivered in the booking. more...
See also Require data in planning phase.
Some TOs provide tickets or access data directly in the booking process. Others might postpone this until the trip starts. But for those who want to provide it immediately, this information is needed.
Since version 1.5.0, you can request to extend the expiry time of a to commit a booking. In the result of the POST /bookings, there is a header field 'expires', indicating the validity of the offer. If this is too short, the MP can request additional time using the POST /bookings/{id}/event - EXTEND_EXPIRY_TIME.
POST https://exampleTO.com/bookings/746ac-48792bb-746dac3/events
{ "operation": "EXTEND_EXPIRY_TIME" }
Step 1: The MP wants to book the selected leg from the planning phase.
POST https://exampleTO.com/bookings/
{ "id": "746ac-48792bb-746dac3", <= this is the ID provided in the planning phase
...
}
The result must be a booking in PENDING
state, unless it is rejected by the TO for some reason.
{ "id": "746ac-48792bb-746dac3",
"state": "PENDING",
...
}
Remark: the state could also become CONFIRMED (or IN_USE) when using the process identifier AUTO_COMMIT
(or ATOMIC_BOOKING_SET_IN_USE
). See processIdentifiers
Step 2: After sending the request to all needed TO's - and they all responded positively, the MP will have to send a POST request with the operation COMMIT
in it to change the booking-option into a real booking.
POST https://exampleTO.com/bookings/746ac-48792bb-746dac3/events/
{ "operation": "COMMIT" }
The result will be a booking object, in state COMFIRMED
. The leg is now committed (guaranteed) by the TO.
{ "id": "746ac-48792bb-746dac3",
"state": "CONFIRMED",
...
}
If any of the TOs responds negative (state: REJECTED
), the other TOs have to be informed that the complete trip is cancelled. This must be done using the same endpoint again, only now with a CANCEL
operation:
POST https://exampleTO.com/bookings/746ac-48792bb-746dac3/events/
{ "operation": "CANCEL" }
The one-stop workflow uses another endpoint to book: POST /bookings/one-stop, instead of POST /bookings/. The request looks quite similar to the planning request, but additional information is required:
- OR useAsset (to indicate which asset you want to book, like a license plate or external visible reference) OR useAssetType (derived from a routeplanner or external data sets, like GBFS' asset-types).
- required booking information, like a driver's license or discount cards. This information is the same as normally supplied in the booking process.
The generic flow will be changed a little to cope with TOs that cannot directly guarantee the leg ("Postponed commit scenario"). Instead of ending a booking in a
CONFIRMED
state, the state beCONDITIONAL_CONFIRMED
. The MP has to wait for aCOMMIT
or aDENY
from the TO side. more...
See also Postponed commit in planning phase.
The main objects in this phase are the BookingRequest, the Booking object and the BookingOperation.
Introduction
- Roadmap
- Semantic versioning
- Use cases
- Changes per version
- Contribution
- Participants
Workflow
- Operator information
- Planning phase
- Booking phase
- Trip execution phase - start
- Trip execution phase - on route
- Trip execution phase - end
- Support
- Payment
Points of attention
- Modalities
- Specifying locations
- GDPR
Eco system
- Relations
Introduction
Scope of the TOMP-API
Versioning and releases
Process Flows
- Authentication
- Operator Information
- Privacy and Registration
- Planning Module
- Booking Module
- Trip Execution Module
- Payment Module
- Support Module
Meta-Information
Reference implementations
To-dos and risks
Technical Specifications
A1 List of terms and definitions
A2 Passenger characteristics dictionary
A3 APIs available on the transportation ecosystem
A4 Overview of the User stories
A5 Authors, Architects, collaborators and stakeholders involved
A6 Adoption and Implementation of the TOMP-API