Reservation Flow — Pay Now#
This flow applies when a guest selects Pay Now as their payment method during booking. The guest pays in full online before the reservation is confirmed.
Page Flow Overview#
🏠 Home Page (Entry Point)#
The first page the guest lands on. Three API calls are made in parallel when the page loads to prepare the booking experience.API Calls#
Load All Room Types#
Fetches all room types with names, images, rates, and capacity. Used to display the room catalogue on the home page.
Load Hotel Details#
Fetches hotel name, address, contact info, slogan, and social media links. Used to populate the hotel branding and information section.
Load Hotel Rules#
Fetches check-in/out times, min/max stay length, and advance booking windows. Used to enforce booking constraints before the guest selects dates.
📅 Availability Page (Select Dates & Options)#
The guest selects their check-in date, check-out date, number of adults, and number of children. An API call is triggered to return only rooms available for those specific dates.API Call#
Check Availability#
{
"errorCode": 0,
"errorMessage": "Successfully retrieved available rooms.",
"types": [
{
"roomTypeId": 4,
"roomType": "Economy",
"rate": 35000,
"available": 2,
"currencySymbol": "₦"
}
]
}
💾 Store roomTypeId and rate for the room the guest selects — both are required on the Checkout Page.
⚠️ Only display rooms where available > 0.
👤 Guest Page (Entry for Guest Details)#
The guest fills in their personal details. An API call is made to check if the guest already exists in the system using their email address — this allows pre-filling the form for returning guests.API Call#
Look Up Existing Guest#
Response — Returning Guest:{
"detail": {
"title": "Mr",
"firstName": "John",
"lastName": "Doe",
"phone": "08030000000",
"email": "john.doe@example.com",
"sex": "Male",
"occupation": "Engineer",
"country": "Nigeria",
"state": "Lagos",
"address1": "1, Example Street",
"address2": "Off Example Road",
"city": "Lagos"
},
"errorCode": 0,
"errorMessage": "Guest detail retrieved successfully."
}
{
"detail": null,
"errorCode": -200,
"errorMessage": "Guest not found."
}
💡 If errorCode is -200, the guest is new — display a blank form for them to fill in their details manually.
💾 Store all guest details — they are required in the reservation payload on the Checkout Page.
Supporting Reference Data#
Load these in parallel to populate the form dropdowns:
📋 Reservation Page (Review and Confirm Reservation)#
The guest reviews their selected room, dates, guest details, and total cost before proceeding to payment. No new API calls are made on this page — all data displayed here is pulled from what was collected on the previous pages.Data Displayed#
| Data | Source |
|---|
| Room type & rate | Availability Page → POST /Reservation/Availability |
| Check-in & check-out dates | Availability Page → guest input |
| Number of adults & children | Availability Page → guest input |
| Guest name & contact | Guest Page → GET /Guest/Detail or manual input |
| Total amount | Calculated: rate × nights × quantity |
✅ This is the guest's last chance to review and edit before payment. Provide a Back button to return to the Guest Page if needed.
💳 Payment Page (Choose Method of Payment)#
The guest selects their preferred payment method. An API call loads the available options configured for the hotel.API Call#
Load Active Payment Methods#
{
"items": [
{ "id": 1, "name": "Book On Hold" },
{ "id": 4, "name": "Paystack" }
],
"errorCode": 0,
"errorMessage": "Successfully retrieved payment methods."
}
💾 Store the selected id as payMethodId — required in the reservation payload.
Since the guest selects Paystack, initialize a transaction to generate the checkout URL.💡 Amount must be in kobo (NGN × 100). For example, ₦35,000 = 3500000 kobo.
Initialize Paystack Transaction#
{
"status": true,
"message": "Authorization URL created",
"data": {
"authorization_Url": "https://checkout.paystack.com/kfx4ota680ptmpd",
"access_Code": "kfx4ota680ptmpd",
"reference": "sti58qbn3w"
},
"errorCode": 0,
"errorMessage": "Access code retrieved successfully."
}
💾 Store data.reference — required for payment verification and the reservation payload.
Redirect the guest to data.authorization_Url to complete payment on Paystack's checkout page.⚙️ Configure your callback URL in Paystack Dashboard under:
Settings → API Keys & Webhooks → Callback URL
Once verified, submit the full reservation:Add Reservation#
📌 payment.amount is in naira, not kobo. e.g. 35000.00 not 3500000.
{
"bookingRef": "F8AUA6",
"errorCode": 0,
"errorMessage": "Reservations made successfully"
}
💾 Store the bookingRef — used on the next page to retrieve and display the booking confirmation.
✅ Payment Success Page (Reservation Confirmed)#
The guest lands on this page after a successful reservation. An API call is made using the bookingRef from the previous step to retrieve and display the full booking summary.API Call#
Get Booking Detail#
{
"guest": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"reservations": [
{
"roomType": "Economy",
"bookingRef": "F8AUA6",
"checkInDate": "2025-09-15",
"checkOutDate": "2025-09-16",
"arrivalTime": "02:00 PM",
"quantity": 1,
"rate": 35000
}
],
"errorCode": 0,
"errorMessage": "Reservation details retrieved successfully."
}
📋 Display the bookingRef prominently. The guest will need it to look up or cancel their reservation.
📩 Send a confirmation email to the guest with their booking reference, check-in/out dates, room type, and total amount paid.
Field Sources — Quick Reference#
Field in POST /Reservation/Add | Source Page | API / Input |
|---|
guest.countryId | Guest Page | GET /Country/GetSelectList → id |
guest.stateId | Guest Page | GET /State/GetSelectList → id |
reservations[].roomTypeId | Availability Page | POST /Reservation/Availability → types[].roomTypeId |
reservations[].rate | Availability Page | POST /Reservation/Availability → types[].rate |
reservations[].checkInDate | Availability Page | Guest input (YYYY-MM-DD) |
reservations[].checkOutDate | Availability Page | Guest input (YYYY-MM-DD) |
reservations[].arrivalTime | Guest Page | Guest input (HH:MM AM/PM) |
payment.payMethodId | Payment Page | GET /Paymode/ActiveList → items[].id |
payment.reference | Payment Page | POST /Paystack/Initialize → data.reference |
payment.amount | Reservation Page | Calculated: rate × nights × quantity |
Modified at 2026-03-25 08:42:17