● Travel Never Stops. Neither Do We. 365 Days a Year.

Hotel Booking Guest Data Validation

Validate hotel room occupancy, lead guests and supplier-required traveller details. Define clear correction paths for rejected booking requests.

Hotel receptionist assisting a family with room arrangements

Hotel api guest data validation is not merely a check that a name field contains characters. A production booking flow must preserve who will stay in each room, calculate children's ages for the property-local arrival date, respect the supplier's rate eligibility, and submit the correct traveler and payment contacts. It also requires renewed consent for changed offers and safe reconciliation of uncertain submissions.

This is an integration design, not a universal supplier schema. Expedia Group Rapid, HBX Group Hotelbeds, and Booking.com Demand API have separate contracts. All names, dates, prices, identifiers, responses, and business rules in the worked scenario are illustrative fictional test values, not customer history, live inventory, actual supplier responses, or valid credentials.

Define the booking's immutable guest intent

An illustrative agency operator books two rooms at the fictional Harbor Lantern Hotel in Lisbon, using a property-local check-in date of 16 June 2027 and checkout of 20 June 2027. Room A contains Ana Costa and a child, Lia Costa. Room B contains Daniel Costa. A separate agency booker, Maya Silva, communicates with the supplier, while a fictional corporate payer, Northwind Travel Operations, authorizes payment through an approved payment channel.

These roles must remain distinct. A payment contact need not be a resident. Room identifiers must remain stable across search, correction, preview, submission, confirmation, and voucher generation, even when the supplier issues a different rate or product token.

Illustrative canonical traveler and room fixture, not a customer record
Internal room ID Assigned traveler Check-in age Role Expected occupancy
ROOM-A-01 Ana Costa; illustrative birth date 1992-01-12 35 Adult; room lead One adult and one age-12 child in canonical guest records
ROOM-A-01 Lia Costa; illustrative birth date 2015-06-14 12 Child; accompanying guest Birthday occurs two days before check-in
ROOM-B-02 Daniel Costa; illustrative birth date 1988-04-02 39 Adult; room lead One adult, no children

The fictional hotel prices children only through age 11. That is a scenario-specific illustrative cutoff, not an Expedia, HBX, or Booking.com universal threshold. The age-12 traveler remains a child in the agency's demographic record, but may require an adult-priced allocation under that selected property's rules. The adapter must resolve this distinction explicitly rather than erase Lia or silently edit her age.

Maintain a canonical contract before vendor translation

Keep guest identity, room membership, rate occupancy, and commercial approval in separate structures. The booking aggregate identifies travelers using internal IDs, stores the local stay date and property time zone, and references supplier selections without treating opaque tokens as permanent room identities. Use calendar dates for stays and zoned instants for deadlines.

The following application-level JSON is illustrative pseudodata, not a wire request for any named supplier. Fictional email addresses use an example domain; the payer record deliberately excludes payment credentials and legal tax identifiers.

{
  "case_id": "TEST-0334-001",
  "property": {
    "id": "HOTEL-DEMO-41",
    "zone": "Europe/Lisbon"
  },
  "stay": {
    "checkin": "2027-06-16",
    "checkout": "2027-06-20"
  },
  "booker": {
    "id": "STAFF-7",
    "name": "Maya Silva",
    "email": "maya@example.com"
  },
  "payer": {
    "id": "CORP-9",
    "name": "Northwind Travel Operations",
    "payment_reference": "PAYMENT-TEST-17"
  },
  "rooms": [
    {
      "id": "ROOM-A-01",
      "lead_id": "GUEST-ANA",
      "guests": [
        {
          "id": "GUEST-ANA",
          "name": "Ana Costa",
          "birth_date": "1992-01-12",
          "arrival_age": 35,
          "canonical_type": "adult"
        },
        {
          "id": "GUEST-LIA",
          "name": "Lia Costa",
          "birth_date": "2015-06-14",
          "arrival_age": 12,
          "canonical_type": "child"
        }
      ]
    },
    {
      "id": "ROOM-B-02",
      "lead_id": "GUEST-DANIEL",
      "guests": [
        {
          "id": "GUEST-DANIEL",
          "name": "Daniel Costa",
          "birth_date": "1988-04-02",
          "arrival_age": 39,
          "canonical_type": "adult"
        }
      ]
    }
  ],
  "consent": {
    "revision": 2,
    "status": "pending"
  }
}

A fixture assertion should verify that the set of room IDs is exactly ROOM-A-01 and ROOM-B-02, that each traveler appears once, and that every lead belongs to the specified room. A rate-key change cannot move Daniel into A or make Ana the payer. Reject missing relationships before calling a supplier.

Compute age locally and validate the supplier cutoff

Birthday semantics

Calculate completed years at the property's local check-in calendar date: subtract birth year from arrival year, then subtract one if the birthday has not occurred in that arrival year. Lia turns twelve on 14 June 2027, before the 16 June arrival. A cached age of eleven from an earlier quote is therefore incorrect. Do not use checkout, inquiry date, or the agent's clock.

Rate eligibility is not demographic identity

For the illustrative cutoff of eleven, Room A's original shopping request, one adult plus one age-eleven child, is invalid for the actual party. Re-shop Room A using the supplier-supported pricing occupancy for a twelve-year-old. The commercial occupancy may become two adult-priced places while canonical ages remain Ana 35 and Lia 12. Room B remains one adult aged 39. Do not automatically convert a child into a different traveler type when a vendor schema or property's rule does not permit that representation.

Suppose the illustrative initial total was EUR 540, consisting of Room A at EUR 320 and Room B at EUR 220. A fresh eligible Room A selection costs EUR 380, changing the illustrative total to EUR 600. Preserve ROOM-A-01 and ROOM-B-02 but replace the affected Room A offer identifier. Disclose the EUR 60 change, occupancy, payment and cancellation terms; obtain fresh consent.

If Room A cannot legally or technically hold the revised allocation, offer a different product or a different room grouping. Never drop Lia from the request, place her invisibly in Room B, or submit a knowingly mismatched occupancy. Record the cutoff source and its effective selection context as test evidence.

Hotel employee sorting two key sleeves beside a guest assignment sheet

Make identity and authority explicit

Use separate typed roles for booker, payer, property-level lead, and each occupying guest. The booker is Maya Silva in this test; she can receive correspondence without being checked in. A corporate payer may provide authorized billing details without appearing as a resident. Ana is the Room A lead; Daniel is the Room B lead. A supplier requiring a booking-level holder must receive a qualifying lead traveler, not an arbitrary staff or billing contact.

Validate the displayed names against the original travelers and the vendor's accepted character constraints. Preserve the exact Unicode presentation string, including accents and combining characters, in the canonical source. A practical additional fictional name test is Zoë Núñez. Normalize for comparison where appropriate, but never silently transliterate, discard diacritics, or substitute a different name merely to pass a restrictive downstream field. Ask for an approved alternative representation only if the supplier demonstrably requires it.

Reject a swapped-lead payload that assigns Daniel as Room A's main guest while he remains allocated to Room B. An update to a lead is a deliberate reassignment requiring membership validation and a new preview or quote where relevant. HTTP success cannot validate guest identity.

Check-in identification instructions are a separate concern. A property may ask travelers to present government photo identification at reception. That does not justify collecting passport numbers, document photographs, or nationality in every online booking payload. Request those fields only when the particular supplier contract, property, law, and transaction genuinely require them, with an explicit purpose and retention rule.

Implement provider-specific field mapping

Each adapter emits only fields supported by its active contract. The mapping is illustrative; fields are not interchangeable.

Illustrative mapping of two-room guest intent to provider-specific interfaces
Business fact Rapid lodging HBX Hotelbeds hotels Booking.com Demand accommodations
Room identity Application maps ROOM-A-01 and ROOM-B-02 to corresponding booking rooms and price-checked selection. Application maps the stable IDs to individual rooms, rateKey values, and applicable roomId pax associations. Map stable IDs to each selected accommodation.products[].id from current availability and preview.
Room leads rooms[].given_name/family_name: Ana Costa for A; Daniel Costa for B. holder represents a real lead passenger; named paxes represent room occupants subject to contract. Provide product-specific accommodation.products[].guests[].name and email at create; maintain local lead assignment.
Occupancy Search occupancy carries per-room adult count and child ages when supported; repeat displayed ages at checkout. Availability occupancies and child pax age; booking rooms[].paxes with roomId, type, names and applicable age. Preview products[].allocation.number_of_adults and children age array; inspect occupancy_mismatch.
Booker and payer Itinerary contact and billing_contact/payment context remain distinct from room guest names. Do not replace holder or named paxes with agency contact; payment handled by agreed HBX workflow. booker details and applicable payment object are separate from each product's guests.
Offer freshness Fresh Price Check and its time-limited Booking link. Current rateKey; CheckRate if rateType is RECHECK before booking. Current product IDs, preview warnings, and fresh order_token before create.
Recovery key Unique affiliate_reference_id and subsequent itinerary lookup. Client reference plus verified booking status or supplier reference; no blind replay. Request tracing and returned order/reservation identifiers; reconcile before resubmission.

For a populated adapter test, assign the illustrative supplier-selection aliases RAPID-A-NEW and RAPID-B-KEEP to the two Rapid room entries; HBX-A-NEW and HBX-B-KEEP to the selected rateKey references; and DEMAND-A-NEW and DEMAND-B-KEEP to the Booking.com room-product selections. These aliases are local test labels, not valid supplier-generated tokens. The adapter's reverse map must recover ROOM-A-01 from each A alias and ROOM-B-02 from each B alias. Test guest values remain Ana Costa, Lia Costa, and Daniel Costa throughout. One adapter may transmit an age-derived occupancy while another requires named paxes or product-specific guests; neither may discard the original guest-to-room relationship. Any changed rate reference invalidates previously recorded consent for the superseded commercial selection, even if the displayed price happens to remain the same.

Expedia Group Rapid: point of sale is not nationality

Rapid's lodging launch requirements direct shopping country_code to represent the traveler's point of sale. Do not fill it from Ana's nationality, a passport's issuing country, the hotel's country, or the agency's registered office. Record the actual storefront market. Rapid requires real room leads, contact and billing details, child ages, and a unique affiliate_reference_id.

Rapid documents tax_registration_number only for some transactions in INR or BRL requiring a valid individual tax ID of the paying traveler. Neither nationality nor country alone triggers this field. The fixture contains no tax ID; tests omit the field unless the eligible currency, transaction and payer conditions apply. A documented HTTP 400 tax-field rejection requires correction, not fabricated identity data.

Respect the short-lived, price-checked Booking link. Rapid notes that an HTTP 503 on a first attempt may indicate an expired link: check the original booking reference before creating another reservation, then obtain a fresh link and revalidate the terms if the original attempt did not create a booking. See the Rapid lodging launch requirements and Rapid Booking API overview.

HBX Group Hotelbeds: holder and paxes are not synonyms

HBX certification guidance says the voucher holder must be a lead passenger, and at least one passenger name should be supplied per room; children's ages must appear when children are included. HBX booking examples use holder and rooms[].paxes, with roomId, type, name and surname. For this scenario, Ana can be the designated booking-level holder when permitted by the chosen HBX booking, but Daniel must still be associated with Room B. Map stable room IDs to provider roomId values per booking.

The HBX workflow distinguishes BOOKABLE rate keys from RECHECK rate keys that need CheckRate. Check occupancy, rate comments, conditions and room association. HBX certification guidance specifies a booking confirmation response timeout of at least sixty seconds. After timeout, reconcile before retrying. See the HBX certification process and HBX hotel booking workflow.

Booking.com Demand: preview belongs to selected products

Demand API preview preserves accommodation, current product IDs, stay dates, and allocations. Each product has its own number_of_adults and children age array, and preview reports occupancy_mismatch for unallocated guests. Ages zero through seventeen are valid inputs, but product eligibility still governs age twelve. Do not reuse Room A's old product after the allocation changes.

Display revised price, payment, policy and warnings before collecting create details. In the documented accommodation create shape, each product's guests include name and email, while booker information is a separate object. Create requires the current order_token; an expired token requires a new preview. Preview never confirms a reservation. See Booking.com Demand order preview and creation.

Treat property instructions as disclosures, not automatic data fields

Booking.com's Connectivity Property Settings documentation defines the standard phrase GuestIdentification as guests presenting photo identification and a credit card at check-in. This is a property-information setting, not evidence that Demand /orders/create universally requires a passport number, passport scan, or nationality. A displayed check-in instruction belongs in the traveler disclosure and voucher context. Any online identity-document capture requires a separately verified integration requirement.

Arrival-time and local-tax notices affect disclosure, not guest-name fields. Record rule source, product, locale and retrieval time. Do not turn free-text instructions into invented mandatory JSON properties. Consult the Booking.com Connectivity standard phrases within its own Property Settings API scope.

Apply validation in layers and show failures clearly

Run schema validation first, then traveler and room invariants, then supplier capability checks, commercial eligibility, user confirmation, and finally pre-submit freshness checks. Use field-specific, accessible errors that preserve entered values.

Filled validation matrix for the illustrative TEST-0334-001 case
Test Input or fault Expected decision Audit evidence
V01 Age boundary Lia born 2015-06-14; arrival 2027-06-16 Compute 12; reject cached 11; re-shop A Local-date calculation and rate revision 2
V02 Room preservation Fresh rate for ROOM-A-01; B unchanged Keep both stable IDs; update only A token Before/after room-to-product map
V03 Swapped lead Daniel named as A lead Block; Daniel belongs to B ROOM_LEAD_NOT_MEMBER
V04 Changed price Illustrative total EUR 540 becomes EUR 600 Require new explicit consent Revision, amount, policy and acceptance time
V05 Expired preview Old order_token reused Block create; preview again TOKEN_STALE; new preview reference
V06 Field rejection Missing supplier-required guest email Repair field; no unchanged retry Sanitized 400 validation detail
V07 Unicode Zoë Núñez test guest Retain valid name; detect lossy conversion Unicode round-trip comparison
V08 Unneeded document Passport number added without requirement Exclude from outbound body and logs Payload allowlist test
V09 Ambiguous timeout Submit connection drops after send Hold further create; reconcile One outbound attempt and lookup result

Keep both room memberships visible; distinguish rejection from confirmation. Preserve the original sanitized failure and the later correction as separate immutable events.

Prove the failed request before retrying

The integration test must demonstrate a reproducible failure, not merely a happy-path retry. In the illustrative trace below, the operator's first candidate carries an age-eleven allocation although the canonical guest is twelve. Local validation blocks transport; there is no actual supplier response. This distinction matters: saying a supplier rejected a request that was never sent corrupts diagnostic evidence.

TEST TRACE: illustrative application events only
14:00:01 candidate=REQ-101 room=ROOM-A-01 child_age=11
14:00:01 checkin_age(GUEST-LIA, 2027-06-16)=12
14:00:01 result=LOCAL_REJECT code=AGE_ALLOCATION_MISMATCH
14:00:01 outbound_supplier_calls=0
14:02:10 reshop=SHOP-202 room=ROOM-A-01 priced_places=2
14:02:10 unchanged_room=ROOM-B-02 adults=1
14:03:40 revised_total=EUR600 consent=ACCEPTED revision=2
14:04:05 candidate=REQ-102 result=LOCAL_VALID
14:04:06 next_action=SUPPLIER_PRECHECK

For a true provider-side field rejection, retain a different illustrative test: request REQ-103 is sent once, a simulated HTTP 400 identifies a missing required guest email for Room B, and retry REQ-104 supplies an authorized email after local revalidation. Store request correlation, redacted error classification, changed fields, and the new attempt number. Do not resend REQ-103 unchanged. Likewise, never fabricate a valid tax identifier to repair a Rapid tax_registration_number rejection.

Recover uncertain submissions without duplicates

Timeouts, lost responses or refreshes can conceal completed bookings. Treat the attempt as outcome unknown, not failure. Lock the room set and revision against double-clicks, replays and concurrent agents. Persist the existing attempt's reference before the network call, preferably in a transactional outbox.

For Rapid, use a unique affiliate_reference_id and investigate the itinerary through the supplier's supported management flow. For HBX, preserve the client reference and use supported booking retrieval or supplier support processes to establish whether the reservation exists. For Booking.com Demand, retain its request and order identifiers when present, use the documented retrieval and reconciliation path applicable to the integration, and do not infer failure merely because the create response was lost. A local deduplication key alone does not guarantee supplier idempotency.

In the illustrative timeout fixture, REQ-105 starts at 14:05:00 and the connection closes without a response at 14:06:05. Reconciliation finds an illustrative confirmed reservation REF-TEST-9001 at 14:07:20. The application records one supplier submission, zero retries, and one confirmed booking. If no record is found, keep status unresolved until the supplier's recommended reconciliation window or support process establishes a defensible next action. Never generate a voucher or take another payment while status is indeterminate.

Timeout budgets must account for provider guidance and infrastructure behavior. HBX certification describes a minimum sixty-second booking confirmation response timeout; do not configure a shorter client or proxy limit that makes the required wait impossible. Configure per-provider deadlines and escalation.

Minimize personal data while retaining operational proof

Collect full names and email addresses only where the specific booking flow needs them, and dates of birth only when necessary to determine correct ages or meet a confirmed requirement. Age derived for shopping is not permission to retain a child's full birth date indefinitely. Restrict, encrypt and role-gate retained records.

Redact payment secrets, tax identifiers, passport numbers, tokens, and unneeded personal details from application logs, screenshots, test fixtures, analytics, and alerts. Use synthetic incident data and assert outbound allowlists. Configure purpose-based retention and deletion independently of supplier-required booking-management references.

Keep an auditable decision record without retaining every sensitive payload: room mapping hash, derived check-in ages, supplier capability version, cutoff evaluation, refreshed rate references, disclosed conditions, consent revision, request status, and reconciliation outcome. Limit child data access and exclude unnecessary documents from consent evidence.

Acceptance criteria and release gates

Automated contract, integration, and interface tests must be evaluated against each supplier's supported test environment and current documentation. The following acceptance criteria are specific to the fictional scenario; passing them does not certify live inventory or supplier partnership status.

Release acceptance criteria with observable pass evidence
Criterion Pass condition Required artifact
AC01 Identity Ana 35 leads ROOM-A-01; Lia 12 stays there; Daniel 39 leads ROOM-B-02; no duplicates. Canonical guest graph assertion
AC02 Rate policy Age 12 exceeds illustrative child-pricing cutoff 11; A re-shopped; B untouched. Cutoff test and selection diff
AC03 Consent EUR 540 to EUR 600 change explicitly accepted before create. Revision-2 consent event
AC04 Rapid Point of sale distinct from nationality; room leads correct; tax field conditional. Redacted adapter snapshot
AC05 HBX Holder is lead; required paxes and ages mapped; RECHECK handled; timeout budget valid. Adapter and timeout contract tests
AC06 Demand Fresh preview, product-specific guests, zero unresolved occupancy mismatch, valid token. Preview/create correlation trace
AC07 Negative cases Swapped lead, stale token, missing email, and lossy Unicode never silently pass. Four failing-then-corrected tests
AC08 Recovery Unknown outcome blocks replay; confirmed lookup produces one reservation. REQ-105 reconciliation timeline
AC09 Privacy No unneeded passport, tax ID, raw payment secrets, or child birth date in logs. Payload and log redaction report
AC10 Confirmation Voucher names, room assignments, dates and supplier reference match confirmed state. Fixture voucher comparison

Concrete verification and handoff checklist

  • Verify that the property-local check-in date is 2027-06-16, checkout is 2027-06-20, and Lia's completed age is exactly twelve after her 14 June birthday.
  • Compare canonical and supplier-mapped occupancy for ROOM-A-01 and ROOM-B-02; confirm both adult ages and the child's age survive every conversion.
  • Inspect the illustrative eleven-year cutoff decision, the re-shopped Room A product, unchanged Room B selection, and the explicit EUR 60 approval.
  • Verify that Ana and Daniel remain their respective room leads and that Maya Silva and Northwind Travel Operations remain separate booker and payer roles.
  • Run Rapid point-of-sale, lead-name, conditional INR/BRL tax-field, reference, and expired-link tests against the applicable contracted workflow.
  • Run HBX holder, paxes, child-age, rateType, CheckRate, voucher, and at-least-sixty-second response-timeout tests.
  • Run Booking.com Demand product allocation, occupancy_mismatch, product-specific guest, preview freshness, token expiry, and create-confirmation tests.
  • Show the original blocked age-eleven request and its zero outbound calls before the corrected request; retain separate provider-field rejection evidence.
  • Exercise Unicode preservation, swapped-lead blocking, local photo-ID disclosures, passport omission, payment-data redaction, and accessible errors.
  • Force an uncertain submission, verify the booking lookup outcome, and demonstrate that no duplicate booking, payment, or premature voucher is produced.
  • Hand over redacted fixtures, mapping version, validation matrix, consent evidence, supplier-specific test traces, monitoring thresholds, and an unresolved-booking escalation owner.

Release only when each acceptance artifact is reviewable, provider-specific requirements have been checked against the active contract, and support staff can trace a reservation from guest intent to confirmed supplier reference without guessing, losing a child, or repeating an uncertain charge.