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

Travel API Integration: Workflows and Testing

Plan travel API integration through commercial access, data mapping, booking workflows, testing, error recovery and production support.

Travel integration engineers reviewing a booking test

A travel API integration is ready for use only when the application can explain what happened to each booking attempt, recover safely from uncertain outcomes, and prove that the same rules hold across flights, hotels, and activities. This travel API integration guide presents a reusable engineering verification matrix rather than a supplier connection tutorial. It combines consumer contracts, partner evidence, controlled failure fixtures, transaction reconciliation, and release gates without treating a successful HTTP response as proof of a successful trip.

Define the verification target before writing adapters

The unit under test is a customer journey crossing independently managed inventory systems. Search and availability are useful inputs, but the significant engineering questions arise when an offer changes, a reservation times out, a hold expires, or one product confirms while another remains uncertain. A robust integration records those distinctions instead of flattening them into a single booking flag.

Use a shared internal record for a trip, with separate immutable attempts for every product. Each attempt should identify its selected resource, authorization context, displayed terms, submitted terms, outgoing correlation, observed replies, and final disposition. Supplier identifiers belong beside internal identifiers; they are not interchangeable. The internal trip view is an aggregation of evidence, not an alternative source of supplier truth.

Five invariants worth testing everywhere

First, an expired selection cannot be reused. Second, an ambiguous booking response cannot automatically produce another create call. Third, approval applies to the exact terms shown, not any later price. Fourth, money movement has a state independent of inventory confirmation. Fifth, customer-facing completion requires resolved product states and a consistent financial record. These invariants should be executable tests, operational rules, and review questions.

Separate wire format from business capability

JSON and XML describe how messages are represented. They do not establish that an integration supports ticketing, payment capture, booking modification, cancellation, or retrieval after timeout. An XML response can describe a rich workflow; a JSON response can describe search only. Treat protocol parsing and capability verification as different acceptance columns.

Decision table: what a transport result proves and what it does not
ObservationEvidence establishedAdditional decision required
Valid JSON or XMLPayload can be decoded against the tested schema.Check field meaning, required actions, and supported booking lifecycle.
HTTP 200 on searchOne request produced a transport-level success.Verify sellable availability, restrictions, and price freshness separately.
HTTP 200 on createProvider responded without an HTTP error.Interpret the booking status and authoritative confirmation identifier.
HTTP 504 on createA gateway did not return a timely result.Resolve outcome by supported retrieval before any resubmission.
Capability documentedAn operation exists in a specification.Verify availability for the actual integration scope and environment.

Normalize technical concepts such as money, time zone, passenger or guest count, cancellation terms, status, and identifiers. Keep provider-specific semantics accessible. An internal CONFIRMED status should require a documented mapping, not merely the presence of an ID or a successful parser.

Design the workflow as independent product state machines

A reusable itinerary orchestrator coordinates three adapters but does not make their operations atomic. Flights may have offer validity deadlines, hotels may return delayed results, and activities may reserve capacity under a time-limited hold. Model these differences explicitly while using shared transitions for display, approval, submission, reconciliation, and customer communication.

Suggested state boundaries

DISCOVERED means candidate inventory was observed. QUOTED means comparable terms were recorded. APPROVED means the traveler accepted a specific version. SUBMITTED means a create or confirm request left the application. UNKNOWN means no authoritative outcome can yet be asserted. HELD, CONFIRMED, REJECTED, and EXPIRED capture distinct supplier outcomes. RECONCILIATION_REQUIRED is an operational escalation, not a substitute for resolving the underlying booking.

Every transition needs a guard and an evidence pointer. For example, approval cannot move to submission after its associated offer expires. Unknown cannot move to rejected merely because a timeout is displayed. Confirmed requires retrieval or a reliable confirmation response with a mapped supplier identifier. A later notification may update the state only through an authenticated, deduplicated event handler.

Fictional fixture TEST-752: one itinerary, three different hazards

TEST-752 is entirely illustrative. Its identifiers, prices, confirmations, and outcomes are invented for reproducible engineering review. They describe no TravelTech365 customer, actual supplier transaction, commercial arrangement, or live vendor incident. The fixture combines a flight offer change, a hotel timeout, and an activity reservation hold to test cross-product behavior.

Fixture ledger: expected events and authoritative resolution
ProductInitial observationRequired resolutionForbidden shortcut
FlightF17, EUR 180, expires before checkout.Refresh to F18, EUR 192; obtain explicit approval for F18.Resubmit F17 or silently accept EUR 192.
HotelH09 create returns 504; local intent HT-9 is unknown.Retrieve through approved original correlation; discover confirmed H-303.Retry create while HT-9 is unresolved.
ActivityA-31 reserves two places under an accepted hold.Freeze hold evidence; confirm during the supported window.Treat a hold as a final booking or extend it by assumption.

Flight: authorization belongs to F18, not F17

The application displays F17 at EUR 180 and records the offer reference, currency, passenger mix, included services, and expiry. Before the traveler completes checkout, the offer expires. The submission guard blocks F17 even if the cached screen still displays its original amount. The application refreshes availability and receives F18 at EUR 192.

F18 is a new commercial decision. Display the revised total and material conditions; require a new explicit confirmation bound to F18. Only then may the adapter submit against F18, subject to its own validity check. The expected test must fail if a background task resubmits F17, transfers approval automatically, or records an order for an unapproved amount.

This design is consistent with the documented notion that Duffel offers have an expires_at value and cease to be usable for order creation after expiry. The example identifiers and amounts are fictional; this reference supports the expiry concept, not the fixture's numbers or a universal rule for every flight supplier.

Hotel: a 504 is an unresolved outcome

The hotel adapter submits a create request for H09 and receives HTTP 504. Set the local booking intent HT-9 to UNKNOWN, quarantine further create attempts for that intent, and retain the original correlation and guest lookup values. Do not recast the response as an automatic failure. Do not infer whether the payment was authorized, captured, reversed, or untouched.

Run the provider-approved retrieval procedure using the original booking correlation. In TEST-752, retrieval eventually returns a confirmed itinerary, H-303. Attach that supplier confirmation to HT-9, release the quarantine only after recording the authoritative outcome, and verify that exactly one local hotel confirmation exists. Keep the payment ledger separate until processor and supplier records reconcile.

The Expedia Group Rapid error guidance specifically warns that a booking timeout or 5xx response does not necessarily mean creation failed. It describes itinerary retrieval using affiliate_reference_id plus email for relevant Rapid workflows. Use that procedure only where it is supported by the actual provider integration; TEST-752 adopts the principle, not a claim that H09 is a live Rapid booking.

Activity: an accepted hold is still provisional

A-31 covers two places. The adapter receives an accepted reservation hold, stores the exact participant count, product option, time slot, hold identifier, and documented expiration evidence, then freezes the submission snapshot. Confirmation is allowed only if the supplier-supported hold window remains valid and every required condition is met. If the hold expires, reacquire availability and approval as required; never invent an extension.

The OCTO endpoints and capabilities documentation distinguishes core availability and booking actions, including creating an ON_HOLD booking and confirming it. Optional capabilities are separate from core actions. This is a useful verification pattern, not proof that every activities supplier implements identical hold timing or optional behavior.

Integration staff comparing test cases

Build the reusable engineering verification matrix

Each matrix row should state its injected condition, expected behavior, evidence needed, and accountable owner. Reuse the rows for flights, hotels, activities, and future products. For an unsupported operation, record NOT_SUPPORTED with an approved customer journey; do not mark it passed because no endpoint was called.

Cross-product tests: minimum deterministic cases for every candidate release
Test caseExpected decisionRequired evidenceOwner
Create timeout or 504Quarantine intent as unknown; retrieve before retry.Original correlation, retrieval history, final disposition.Integration engineer
Stale price or offerBlock old reference; obtain fresh explicit approval.F17 expiry, F18 terms, approval event.Checkout engineer
Duplicate acknowledgementDeduplicate repeated responses or events; keep one booking.Event IDs, dedupe key, one ledger transition.Platform engineer
Missing servicing actionShow supported escalation, not a working cancel button.Capability map, UI rule, tested fallback.Product owner
Mixed itineraryReport confirmed, held, and unknown items separately.Trip projection and per-product source records.Orchestration engineer
Finance reconciliationResolve authorization and capture independently of booking.Ledger entries, settlement links, exception record.Finance systems owner
Operational monitoringAlert on unresolved unknowns, expiry risk, and retry spikes.Dashboard snapshot, alert test, routing proof.Operations engineer
Evidence ownershipReject unowned or untraceable pass assertions.Named reviewer, artifact URI, timestamp, version.QA lead

Predefine pass and fail semantics

A test passes only when the actual transition and its evidence both match the expected decision. A 504 test that ends in a plausible confirmation but contains no retrieval trace fails. A price-refresh test that shows EUR 192 but lacks a recorded approval fails. A servicing test without an available API may pass only when its documented fallback is genuinely usable and the limitation is disclosed.

For the composite fixture, final success requires flight F18 to be explicitly approved and validly submitted, hotel HT-9 to resolve to H-303 without duplicate creation, and activity A-31 to confirm within the supported hold. Finance reconciliation and coherent trip display must also pass. If one component remains unknown, the fixture remains open even when the other two are confirmed.

Use contracts to test expectations, not business permissions

Contract tests protect the boundary between the application and an adapter. Define the requests the consuming application emits and the minimum responses it uses. Test absent optional fields, alternate statuses, identifier shapes, and error envelopes. Keep schema checks separate from state-machine tests: a valid status string does not prove that the customer may cancel or that an offer remains available.

Where Pact helps and where it stops

According to the Pact explanation of consumer and provider verification, consumer tests exercise expected interactions against a mock, while provider verification compares real provider responses with the contract's minimum expected data. Provider states can prepare relevant preconditions. For an internally controlled adapter, this is valuable protection against incompatible field or message changes.

For an external supplier that does not participate in provider verification, passing consumer Pact tests establishes only the application's behavior against its mock. It does not establish that the supplier meets the contract, grants access, honors a booking hold, delivers timely responses, or supports live creation. Label those claims unverified until sanctioned integration evidence exists.

Contract evidence: consumer expectation versus provider confirmation
BoundaryConsumer expectationVerification needed
Flight offerExpiry and total are decoded; stale submission is rejected.Adapter tests plus supported provider offer behavior.
Hotel createTimeout maps to unknown, never automatic rejection.Failure injection plus permitted retrieval experiment.
Activity holdHold status and two-place quantity remain intact.Supported partner hold and confirmation evidence.
Internal booking eventDuplicate notification changes state once.Pact message contract and event-handler replay test.

Separate evidence layers instead of blending them

Evidence decision table: confidence and permissible conclusions
LayerWhat to runWhat may be concludedLimitation
Local fixtureDeterministic F17, H09, A-31 replay with injected failures.Internal decision logic behaves as designed.No actual supplier behavior proven.
Consumer contractRequest/response shape and error variants.Application handles the declared interface.Mock success is not provider verification.
Provider verificationReplay contract against an authorized provider environment.Observed interface matches verified interactions.Does not prove inventory or timing guarantees.
Partner sandboxPermitted create, retrieve, hold, and failure paths.Test-environment workflow behaves as observed.May differ from production data and rules.
Production-safe syntheticAuthorized read-only probes and permitted diagnostics.Selected deployed boundaries are reachable and observable.Does not prove an unexecuted live booking.

Attach environment, configuration, tested capability, and test-data classification to each result. If a partner environment cannot reproduce a delayed confirmation, the fixture can still test internal handling, but the matrix should retain a gap for provider behavior. Readiness requires explicit treatment of that gap, not silently converting a simulated pass into live evidence.

Respect product-specific behavior without losing one test language

The flight, hotel, and activity adapters must present shared concepts while exposing genuine differences. For flights, an offer reference and its expiry are material; an order or servicing action may have separate limitations. Duffel's offer reference documents expiry and notes that some permitted modifications may still require support or airline involvement. Do not infer that every allowed change is self-service.

For hotels, retrieval after ambiguous creation is central. Expedia Group's documented error handling covers 504 and booking 5xx ambiguity, duplicate-itinerary errors, and price mismatches. These are Rapid-specific reference behaviors. They justify targeted adapter tests, not a universal interpretation of every provider's 404 or retry instructions.

For activities, OCTO's published core operations include product, availability, booking, and confirmation flows; optional capabilities extend functionality. Record what the actual supplier implements. A capability described by OCTO is not necessarily enabled for a given partner, and a supported hold does not remove the need to preserve its real expiry and participant restrictions.

Establish version and compatibility boundaries

Capture the adapter release, schema revision, API version or documented revision when known, capability configuration, feature flags, and test suite revision with each artifact. The exact version boundary may differ between providers: a path version, header, schema snapshot, or documented behavior change. Never assume the same versioning system across all suppliers.

Introduce changes through a compatibility assessment. If an optional field becomes mandatory, contract tests should detect it. If a price field changes meaning, business tests must detect the impact even when the payload still validates. If retrieval semantics change, replay unknown-outcome cases before rollout. Preserve representative historical responses, with personal data removed, to guard against regressions.

Reconcile booking and money as separate systems

A hotel confirmation is not proof of payment settlement; a card authorization is not proof of supplier acceptance. Model the payment lifecycle independently, with records for authorization, capture, reversal, refund, and settlement where applicable. Link events through internal references while retaining payment processor and supplier identifiers. Never write card-sensitive payloads into general diagnostic logs.

For HT-9, freeze the booking-create intent when the 504 occurs, but do not freeze or invent the payment outcome. After H-303 is retrieved, compare the supplier amount, customer-approved amount, payment state, and accounting entry. If money moved without confirmed inventory, raise a controlled exception. If inventory confirmed but payment remains unresolved, protect the itinerary and escalate under a documented policy rather than collecting a second charge blindly.

Use balanced reconciliation checks for each product: one intended purchase, the permitted supplier reservations, corresponding payment movements, and a coherent ledger. Track variance by currency and amount without assuming conversion at a universal rate. Any difference outside approved business rules requires investigation and retained evidence, not a hidden adjustment to make dashboards appear balanced.

Monitoring should follow states, not just uptime

Measure counts and age of UNKNOWN intents, duplicate acknowledgements suppressed, expired offers blocked, holds approaching expiry, failed retrieve attempts, and unreconciled amounts. Segment by adapter version and environment. Alert thresholds must be established from operational policy and observed traffic, not invented provider service-level promises.

Every actionable alert needs a trip or intent lookup, correlation trail, last authoritative observation, permitted next action, and owner. A green HTTP success-rate chart cannot substitute for these signals. Sampled traces are useful for latency, but high-risk decisions such as a create retry must retain an auditable event record.

Run production-safe synthetic checks deliberately

A production-safe check must not create unapproved travel inventory or charge a payment instrument. Prefer authenticated health probes, schema-compatible read-only retrieval against authorized test records, configuration verification, controlled alert delivery, and synthetic events processed in an isolated internal pipeline. Record the permission basis and scrub personal data before storing results.

Distinguish three outcomes in the matrix: PASS for an executed and evidenced check, NOT_RUN for a prohibited or unavailable operation, and FAIL for a violated expectation. A read-only production check can support connectivity and monitoring claims; it cannot substantiate live booking, ticketing, refund, or hold behavior that was never exercised.

Make evidence ownership reviewable

Each assertion in the matrix needs an artifact and a responsible reviewer. A screenshot alone rarely suffices: prefer structured event traces, sanitized request and response excerpts, state snapshots, and test-run output. Evidence packages should be immutable or integrity-checked, access-controlled, and retained according to applicable organizational requirements.

Evidence register: suggested minimum record for TEST-752
ArtifactMust establishAccountable reviewer
Approval logF17 expiry and fresh consent to F18 at EUR 192.Checkout QA
Recovery traceHT-9 quarantine, original correlation, H-303 retrieval.Integration QA
Hold snapshotA-31 quantity two, window, confirmation time.Activities QA
Finance ledgerPayment outcome tied to confirmed or unresolved inventory.Finance reviewer
Release bundleSuite version, adapter revisions, exceptions, signatures.Release approver

Apply predefined cross-product release rules

Agree the gate before running tests. Prevent post-hoc reclassification of failures as acceptable quirks. A platform release may proceed with an explicitly disabled feature, but not with a checkout path that silently invokes an unverified operation. Record any residual exposure, containment control, responsible owner, and retest trigger.

Release gate: deterministic decision rules across travel products
GatePass conditionBlock condition
Offer approvalAll changed commercial terms receive renewed consent.Expired or unapproved reference can be submitted.
Unknown outcomesEvery ambiguous create has safe retrieval or escalation.Automatic duplicate create is possible.
Hold handlingAccepted quantity and valid confirmation window are proved.Hold is labeled final or assumed extendable.
Servicing disclosureUI aligns with verified actions and documented fallbacks.Unavailable supplier action is presented as supported.
Mixed trip displayIndividual statuses remain accurate under partial completion.One confirmed item marks the entire trip confirmed.
Finance and operationsExceptions reconcile or remain visibly controlled and owned.Missing ledger trace, owner, or alert for critical unknown.

Execute the matrix as a repeatable engineering runbook

Before the run

Freeze scenario inputs, contract revisions, environment details, and expected outcomes. Verify that test identities, price displays, dates, and clocks are internally consistent. Confirm that each supplier action is authorized in the chosen environment. Assign a reviewer to every high-risk row and capture the initial booking and payment states before injecting failures.

During the run

Execute happy paths only to establish a baseline, then induce F17 expiry, the H09 booking-create 504, and A-31 hold progression. Observe whether the system blocks stale submission, quarantines HT-9, retrieves H-303 through the original correlation, and retains the two-place hold conditions. Replay duplicate acknowledgements and interrupt the workflow while different products occupy different states.

Check the customer trip view, finance ledger, operations queue, and logs after every transition. Validate negative assertions: no F17 submission, no second hotel create, no activity confirmation outside its supported window, and no premature whole-trip confirmation. Negative evidence requires instrumentation capable of showing that the prohibited action did not occur.

After the run

Reconcile event counts and identifiers, inspect discrepancies, and attach raw and normalized evidence. Mark each matrix row pass, fail, not run, or unverified with a precise explanation. Require independent approval for waived noncritical items and rerun affected cases after code or configuration changes. Preserve the fixture so later adapter upgrades can be compared against the same expected outcomes.

Keep this guide distinct from adjacent technical references

This guide defines how to prove integrated behavior across products. An API reference should specify fields and endpoint signatures. An offer-expiry page should explore quotation validity and customer repricing in depth. A notifications page should cover delivery, ordering, signatures, and replay. A release checklist should assemble final operational tasks. Here those topics appear only when they establish a matrix expectation or a verifiable transaction boundary.

The engineering principle is straightforward: a travel integration is not complete when the adapter parses a response. It is complete for its declared scope when tested decisions, product-specific behavior, financial state, and human recovery paths agree with evidence. Treat unsupported claims and unknown outcomes as explicit states, and future products can join the same verification matrix without weakening the rules that protect the itinerary.