BioduxPMS Booking API
    • Back to home
    • Booking Flow
    • Book On Hold
    • Pay Now
    • Pay At Hotel

    Pay Now

    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.
    payMethodId: 4

    Page Flow Overview#

    Image-3.png

    🏠 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#

    Response:
    {
        "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."
    }
    Response — New Guest:
    {
        "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#

    DataSource
    Room type & rateAvailability Page → POST /Reservation/Availability
    Check-in & check-out datesAvailability Page → guest input
    Number of adults & childrenAvailability Page → guest input
    Guest name & contactGuest Page → GET /Guest/Detail or manual input
    Total amountCalculated: 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#

    Response:
    {
        "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#

    Response:
    {
        "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.
    Response — Success:
    {
        "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#

    Response:
    {
        "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/AddSource PageAPI / Input
    guest.countryIdGuest PageGET /Country/GetSelectList → id
    guest.stateIdGuest PageGET /State/GetSelectList → id
    reservations[].roomTypeIdAvailability PagePOST /Reservation/Availability → types[].roomTypeId
    reservations[].rateAvailability PagePOST /Reservation/Availability → types[].rate
    reservations[].checkInDateAvailability PageGuest input (YYYY-MM-DD)
    reservations[].checkOutDateAvailability PageGuest input (YYYY-MM-DD)
    reservations[].arrivalTimeGuest PageGuest input (HH:MM AM/PM)
    payment.payMethodIdPayment PageGET /Paymode/ActiveList → items[].id
    payment.referencePayment PagePOST /Paystack/Initialize → data.reference
    payment.amountReservation PageCalculated: rate × nights × quantity
    Modified at 2026-03-25 08:42:17
    Previous
    Book On Hold
    Next
    Pay At Hotel
    Built with