Workflow sequence Diagram#

The following diagram presents the sequential calls needed to successfully book a product.

!theme cerulean-outline
actor "Consumer" as user
participant "Amadeus Backend" as backend

alt Get availabilities for a certain time range
    note left of user: STEP 1 - Get availabilities for a product
    user->backend: GET /booking-flow/v1/products/{productId}/availabilities
    backend-->user:
else Get next existing availabilities
    note left of user: STEP 1 alternative - Get next availabilities for a product
    user->backend: GET /booking-flow/v1/products/{productId}/availabilities/next
    backend-->user:
end

note left of user: STEP 2a - Get options
user->backend: GET /booking-flow/v1/products/{productId}/availabilities/\n{date}/options
backend-->user:

note left of user: STEP 2b - Set options
user->backend: PUT /booking-flow/v1/products/{productId}/availabilities/\n{availabilityId}/options
backend-->user:
user->user: (UI may loop if multiple options)

note left of user: STEP 3a - Get pricing
user->backend: GET /booking-flow/v1/products/{productId}/availabilities/\n{availabilityId}/prices
backend-->user:

note left of user: STEP 3b - Set pricing
user->backend: PUT /booking-flow/v1/products/{productId}/availabilities/\n{availabilityId}/prices
backend-->user:
user->user: (UI may loop to set/re-set numbers of tickets)

note left of user: STEP 4 - Create booking
user->backend: POST /booking-flow/v1/bookings
backend-->user:

note left of user: STEP 5a - Get list of questions
user->backend: GET /booking-flow/v1/bookings/{bookingId}/questions
backend-->user:

note left of user: STEP 5b - Set list of questions/answers
user->backend: PUT /booking-flow/v1/bookings/{bookingId}/questions
backend-->user:

note left of user: Payment collection step
user -> user:  Payment

note left of user
    Consumer System should refresh the booking
    data before asking for a confirmation
end note

note left of user: STEP 6 - Confirm booking (final)
user->backend: POST /booking-flow/v1/bookings/{bookingId}/confirm
backend-->user:

note left of user: STEP 7 - Get booking info / get voucher
user->backend: GET /booking-flow/v1/bookings/{bookingId}
backend-->user:

note left of user: Cancel a booking
user->backend: DEL /booking-flow/v1/bookings/{bookingId}
backend-->user: