Flags and state machine Diagram#

The GET /booking-flow/v1/bookings/{{bookingId}} endpoint is crucial for tracking the status of a booking within the Amadeus system.

The booking process initiates with a product ID. Each step in this process has certain pre-conditions that must be met. Our API performs validations at each step, using flag checks as specified in the subsequent diagram.

!theme cerulean-outline
start
:GET options;
note left
    Creation of an availability ID
end note
repeat
    :PUT options;
repeat while (isOptionStepCompleted) is (false)
note left
    Choosing some option values
    can trigger the creation
    of new options to set
end note
->true;
:GET prices;
repeat
    :PUT prices;
repeat while (isPricingStepCompleted) is (false)
->true;
:Create booking;
note left
    Create a booking based on
    the information referenced
    by the availability ID
end note
:"status": "ON_HOLD";
:GET questions;
repeat
    :PUT questions;
repeat while (isQuestionStepComplete) is (false)
->true;
:"status": "ON_HOLD";
:POST confirm booking;
note left
    Consumer system should
    update booking info before
    asking for a confirmation
end note
:"status": "PENDING_CONFIRM";
if (Provider sends confirmation) then (yes)
    :"status": "CONFIRMED";
    stop
else
    :"status": "REJECTED"
    or
    "status": "EXPIRED";
    stop

Cancellation of a confirmed booking is supported.

!theme cerulean-outline
start
:"status": "CONFIRMED";
:DEL booking; <<input>>
:"status": "CONFIRMED"
"cancellationRequestDatetime": "2023-12-14T08:53:05.349043Z";
if (Provider accepts cancellation) then (yes)
    :"status": "CANCELLED";
    stop
else (no)
    :"status": "CONFIRMED";
    stop