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

API Types, Specifications and Documentation Explained

Explore what is API definition types specifications documentation with practical guidance on requirements, integrations and delivery options. Read the TravelTech365 guide.

Developers discussing an interface contract

Choosing an API is not simply choosing how two systems exchange data. A workable integration needs an interface that can be called, a specification that defines what the interface means, documentation that teaches teams to use it, and evidence that the promised behavior actually occurs. This guide explains API types, specifications and documentation through a fictional travel-booking integration, with particular attention to data contracts, failure handling, compatibility and business acceptance.

What a usable API contract needs to describe

An application programming interface, or API, exposes defined interactions between software components. A search request, a booking submission and a confirmation notification may belong to one customer journey, but they do not have to use the same communication pattern. The correct choice depends on whether a caller expects an immediate answer, must exchange an established message format, or needs to react to a later event.

An API type describes the interaction style or architecture: HTTP request and response, SOAP messaging, or event-driven communication, for example. A specification expresses machine-readable or normative rules about operations, messages, fields and constraints. Documentation gives implementers the surrounding context: credentials, examples, workflows, business meaning, operational procedures and release notes. These categories overlap, but they are not interchangeable.

Common API Interaction Types and Their Trade-offs

HTTP Request-Response Interfaces

HTTP APIs commonly expose resources or actions through endpoints and methods. A consumer sends a search filter, receives matching offers, and may later submit a write request. JSON is a frequent representation, but it is not the definition of HTTP itself. An interface might allow retrieval, updates or action-style commands; the contract must say which behavior applies.

For an HTTP interface, document paths, methods, query parameters, headers, request bodies, media types, responses, status codes and authorization requirements. The OpenAPI Specification 3.1.2 supplies a standard description format for HTTP APIs, including operations and schemas. It describes an interface; it does not independently establish that the deployed service follows that description.

SOAP and XML Message Interfaces

SOAP is a messaging framework built around XML structures. An integration may use it to communicate with an existing reservation component through a dedicated adapter. SOAP should not be reduced to “an older JSON alternative”: its envelope, headers, body and processing expectations matter, and the transport binding must be identified separately.

The W3C SOAP 1.2 Messaging Framework defines its message model and fault structure. The project still needs its own operation-level definitions, XML namespaces, field mapping, required headers, transport configuration and response semantics. An XML parser accepting a message is not proof that its business content is acceptable.

Event-Driven and Asynchronous Interfaces

Event-driven interfaces convey changes without requiring the original caller to keep a request open. A booking-accepted event may arrive after a write request has returned an acknowledgement. Consumers must understand which event confirms a final state, how to correlate it with the initial request and what happens if messages are duplicated or delivered out of order.

The AsyncAPI Specification 3.0.0 models message-driven APIs using concepts such as channels, operations and messages. The specification can describe the message contract, while an implementation guide must additionally explain the chosen broker or transport, subscription lifecycle, delivery assumptions and recovery practices.

Other Styles and Integration Boundaries

Teams may also encounter GraphQL queries, remote procedure calls, webhooks, file exchanges and scheduled batch imports. These labels answer different questions. A webhook describes a delivery arrangement; a query language concerns how data is requested; a batch file is an exchange process rather than an interactive endpoint. Do not select one solely because its label sounds modern. Identify the consumer, latency needs, payload control, state transitions and failure modes first.

From Interface Description to Usable Documentation

Machine-Readable Specification

Machine-readable artifacts help reviewers compare expected requests and responses. An OpenAPI description should declare field types, required properties, examples and documented outcomes. A SOAP mapping should identify exact XML element paths and namespaces. An AsyncAPI description should specify event payloads, channels and the perspective from which an application sends or receives messages.

Human-Readable Implementation Guide

A practical guide explains the environment and purpose of every operation, the distinction between test and production credentials, illustrative requests, response interpretation, access prerequisites, timeouts, retry advice and escalation paths. It should state whether calling a write operation creates a booking, merely starts processing or reserves an item pending another confirmation.

Field documentation should describe units, precision, nullability, absence, defaults, enumeration handling, timezone rules and the meaning of identifiers. Operational documentation should define correlation IDs, safe redaction in logs, support evidence and retention expectations agreed for the project. These are implementation decisions, not claims supplied by a generic interface standard.

Version and Change Communication

Every released contract needs an identifiable version and an owner. A release note should identify additions, removals, changed requirements and consumer action. A field that becomes mandatory may break older consumers even when its JSON type stays the same. Adding a new enum value can also break a client generated with a closed set of cases.

Illustrative Integration: Fictional SPEC-782

All names, paths, identifiers, amounts, timestamps and outcomes in SPEC-782 are illustrative fiction. They are a teaching fixture, not a live API, TravelTech365 deployment, provider capability, customer case or benchmark. The scenario combines HTTP travel search and booking writes, a SOAP XML reservation adapter, and asynchronous booking-status events.

The intended journey is straightforward: a consumer searches for an itinerary, selects a priced offer, submits a booking request, receives a processing acknowledgement, and later observes a booking event. An internal adapter maps the submitted request into an XML message and interprets its response. Each boundary preserves identity and state so an apparent success at one interface cannot hide a failure at another.

Engineering team reviewing contract examples
SPEC-782 interface inventory — illustrative scope: one fictional booking journey, not a vendor integration
Boundary Interface and Input Output Primary Validation
Search client → HTTP GET /v1/offers?origin=AAA&destination=BBB&date=2027-02-18&adults=1 200; offerId OF-782 and price object Location tokens, calendar date, traveler count, schema
Booking client → HTTP POST /v1/bookings; offerId, traveler, clientRequestId 202; bookingId BK-782, status PENDING Identity, required fields, duplicate request policy
Adapter → SOAP XML SubmitReservation XML envelope with booking reference Accepted reference or SOAP fault Namespace, element sequence, mapped data, fault interpretation
Publisher → events booking.status channel; bookingId and eventId BookingAccepted or BookingRejected message Payload version, correlation, state transition, duplicate handling

The HTTP examples are local scenario conventions. The fictional location tokens AAA and BBB are not asserted to be real airports. A 202 response means the application accepted a request for processing in this fixture; it is deliberately not the same thing as a confirmed booking. The later event, after business validation, determines the scenario’s outcome.

Concrete Data Contracts: Type, Presence and Meaning

Search Request and Offer Response

The SPEC-782 search request requires origin and destination as distinct three-character uppercase fixture tokens, date as a valid ISO-style calendar date and adults as an integer from one through nine. A repeated query parameter, malformed date or unsupported traveler count is rejected before search processing. This rule belongs in the application contract, even if the transport can carry many other values.

The successful illustrative response contains offerId, currency, amountMinor and minorUnits. For fixture offer OF-782, currency is USD, amountMinor is 12550 and minorUnits is 2, yielding a displayed amount of 125.50 in the chosen currency. Display conversion is permitted only when the scale is known; an integer alone is insufficient evidence of a monetary amount.

Unavailable, Null and Absent Are Different

SPEC-782 intentionally distinguishes three states for minorUnits. A documented non-negative integer value describes an available decimal scale. An explicit JSON null says the producer intentionally supplied the field without a usable scale. An absent property means the producer did not include it at all. Neither null nor absence may silently become zero, two or another guessed default.

When the scale is unavailable, the consumer may retain the raw amount for diagnostic review but must not calculate a display amount, compare priced offers or authorize payment from that record. Documentation must say why a field can be unavailable, whether an absence is allowed under the current schema and which states require remediation.

SPEC-782 illustrative field contract — scope: search output and booking inputs only
Field Presence and Type Example Validation or Consumer Rule
offerId Required string OF-782 Nonblank; must reference selected offer
currency Required uppercase string USD Must match accepted fixture currency set
amountMinor Required nonnegative integer 12550 Retain integer without interpreting scale alone
minorUnits Optional integer or null 2, null, or absent Only integer 0–3 permits this fixture’s display conversion
clientRequestId Required string on write REQ-782-A Correlate retries; enforce documented duplicate policy
traveler.givenName Required nonblank string Alex Reject blank or structurally invalid input
bookingId Required string in write acknowledgement BK-782 Persist mapping to request and later event
status Required enum-like string PENDING Known states handled; UNKNOWN compatibility applies
eventId Required event string EV-782-1 Deduplicate within agreed retention window
occurredAt Required timestamp string 2027-02-01T10:00:00Z Parse timezone and retain original event time

Write Requests, Adapters and Booking Events

HTTP Booking Write Contract

The illustrative booking body includes offerId: OF-782, clientRequestId: REQ-782-A and traveler.givenName: Alex. The application validates content type, authorization, JSON shape, required fields, offer eligibility and price usability before submitting work. If the same request identifier arrives again, the agreed duplicate policy must prevent accidental double creation; the fixture assumes consistent replay of the original result for an identical payload and a conflict for a changed payload.

The expected initial response is 202 with bookingId: BK-782 and status: PENDING. A server error or timeout does not automatically mean the write failed; consumers should reconcile by request identifier before retrying. This is an illustrative workflow rule, not a promise that every HTTP API implements idempotency.

SOAP Adapter Mapping Contract

The adapter constructs an XML envelope with the SOAP 1.2 namespace, required header context and an operation-specific body. Its fictional SubmitReservation payload maps BK-782 to an internal reservation reference, carries the selected offer identifier and carries the validated traveler name. The exact namespace for the fictional business operation is project-defined; it must not be confused with the standard SOAP namespace.

Before transmission, validate well-formed XML, allowed namespaces, expected child elements, data types and any operation-specific schema. On receipt, separate transport failure, SOAP fault and business rejection. A success-shaped SOAP envelope with an unrecognized reservation state must not be treated as acceptance. Preserve the adapter request ID and safe diagnostic correlation without recording unnecessary personal data.

AsyncAPI Booking-Event Contract

After the adapter outcome has been reconciled, the event publisher emits one of two scenario messages: BookingAccepted or BookingRejected. Both include eventId, bookingId, occurredAt, schemaVersion and status. A rejection also contains a controlled reason code. The consumer validates the payload before changing its local booking state.

For this fixture, the transport may redeliver a message, so consumers deduplicate on event ID and tolerate out-of-order arrival using a documented state machine. An event referencing an unknown booking is quarantined for investigation rather than fabricating a booking. A booking acceptance event is the business confirmation point; an HTTP acknowledgement by itself is not.

Forward-Compatible UNKNOWN State

The consumer must tolerate an unfamiliar future status string by mapping it to an internal UNKNOWN outcome, preserving the raw incoming value for diagnostics and refusing to interpret it as ACCEPTED or REJECTED. It can continue processing unrelated bookings while placing the affected booking in a reviewable state. Producers still document introduced values through change management; consumer tolerance does not remove that responsibility.

Errors, Response Semantics and Test Evidence

HTTP Problem Details and Diagnostics

For HTTP failures, SPEC-782 uses a problem response with type, title, status, detail and instance where applicable. RFC 9457 defines the problem-details format for HTTP APIs. A problem document should help clients categorize failure without exposing credentials, sensitive traveler data or internal stack traces. Its details supplement the HTTP status; they do not replace the need to interpret that status.

In the fictional scenario, a malformed date returns HTTP 400 with an input-related problem type; an unchanged retry may return the earlier acknowledgement; and a conflicting reuse of clientRequestId returns 409 with a stable conflict type. These are chosen fixture outcomes, not universal status mappings imposed by the referenced standards.

Positive, Negative and Ambiguous Cases

SPEC-782 executed-result illustration — scope: invented fixture test outcomes, not production test evidence
Test ID Stimulus Expected Outcome Illustrative Observation
T01 Valid search and numeric minorUnits=2 Price 125.50 displayed PASS; formatted only after scale check
T02 Search offer omits minorUnits Search record parsed; price use blocked PASS; no default scale inserted
T03 Search offer sets minorUnits=null Explicit unavailable state retained PASS; not conflated with absence
T04 Malformed search date 400 problem response PASS; actionable validation category
T05 Identical booking retry with same request ID Original booking reused PASS; no second booking generated
T06 Same request ID, changed traveler 409 conflict, no overwrite PASS; original unchanged
T07 SOAP fault returned by adapter No acceptance event emitted PASS; fault retained for reconciliation
T08 Repeated BookingAccepted event Single effective transition PASS; duplicate logged once
T09 Status value REVIEW_LATER unseen by consumer Internal UNKNOWN, no final confirmation PASS; raw state preserved
T10 Event for missing booking ID Quarantine and alert PASS; no synthetic booking created

The PASS labels are invented fixture observations, not claims of software execution. A real project would attach sanitized request and response samples, validator output, message identifiers, test environment, contract version and reviewer sign-off. It should also document unresolved cases rather than hiding them behind aggregate pass percentages.

Validation Responsibilities at Every Boundary

Consumer and HTTP Edge

Validate search criteria before making a request and validate the returned schema after receiving it. The consumer must also enforce business usability: no offer comparison when price scale is unavailable, no booking against a stale selection, and no inferred success from a transport acknowledgement. Reject or quarantine data with a clear diagnostic classification so an operator knows whether to retry, correct input or escalate.

Booking Service and XML Adapter

The booking service checks authorization, payload structure, ownership of the selected offer, duplicate requests and allowed state transitions. The adapter separately checks its XML contract and mapping integrity. Mapping validation should prove that booking and offer identifiers survive translation without truncation or swapped values. If a SOAP response is ambiguous, do not manufacture a decisive event merely to complete the workflow.

Event Publisher and Subscriber

The publisher validates event completeness, allowable state and correlation before emission. The subscriber checks schema version, timestamp parsing, event identity, associated booking and transition legality. Retries must not duplicate side effects. Recovery documentation should explain how to investigate missed events and reconcile an uncertain booking against its authoritative record.

Business Acceptance Is Separate from Technical Scope

Technical scope establishes what is being built and connected. Business acceptance establishes which outcomes make the delivered workflow useful and safe for its intended operation. Passing a schema validator does not establish that confirmations are timely, prices are usable or disputed bookings can be traced. The two registers should be reviewed together without treating one as a substitute for the other.

SPEC-782 delivery and acceptance register — scope: illustrative contractual boundaries, not a commercial proposal
Area Included Technical Scope Business Acceptance Evidence Explicit Boundary
HTTP search Defined filters, offers, schema checks Usable price shown only with scale No external inventory guarantee
HTTP write Booking submission, acknowledgement, retry policy No duplicate booking for identical retry No immediate confirmation promise
SOAP adapter One reservation mapping and fault treatment Mapped references traceable end to end No undisclosed SOAP operations
Events Acceptance and rejection messages, correlation Confirmation only after accepted event No arbitrary event types assumed
Compatibility UNKNOWN status fallback, raw value preservation Novel values cannot falsely confirm No automatic interpretation of new states
Diagnostics Problem responses and sanitized audit IDs Operator can trace failed test fixture No exposure of secrets in evidence
Documentation Specifications, examples, ownership and version notes Reviewer can repeat agreed tests No assertion of future provider behavior

How to Review API Documentation Before Integration

Read the Contract in Workflow Order

Begin with the user journey rather than the endpoint list. Identify which operation starts work, which provides a durable identifier, which later message resolves the state and which source remains authoritative after a timeout. Follow that journey through examples and mark every point where data changes shape, ownership or meaning.

Next, compare each field across interfaces. Check whether amounts, times, passenger names, statuses and references retain their semantics when mapped from JSON to XML to an event. Verify explicit rules for unknowns, optional fields and partial results. A mapping spreadsheet that records source path, target path, transform rule, rejection behavior and owner is often more valuable than a large collection of disconnected sample payloads.

Separate Demonstrated Facts from Assumptions

Label examples as examples, contract requirements as requirements, and test results as results. Request sample errors as well as success responses. Ask how authentication is provisioned, how environment differences are expressed, what the versioning policy is, and how consumers learn about breaking changes. The answers should appear in controlled documentation rather than being left inside informal messages.

Implementation Checklist and Handover Evidence

SPEC-782 handover checklist — scope: illustrative minimum evidence before accepting the fictional integration
Check Artifact to Inspect Acceptance Condition
Contract versions OpenAPI, XML mapping, AsyncAPI revision IDs All identify the tested fixture release
Input validation Positive and negative request cases Every interface rejects malformed inputs safely
Missing money scale Absent and null minorUnits cases Both distinguished; neither silently defaulted
Write recovery Timeout and replay case records Duplicate policy protects booking identity
Adapter mapping Sanitized XML exchange and mapping review References and fault paths match contract
Event lifecycle Acceptance, rejection and duplicate traces Only valid final event confirms booking
Unknown status New enum fixture and consumer log UNKNOWN fallback preserves raw value
Operational handover Runbook, owners, escalation and release notes Reviewer can trace and reconcile a failed flow

Frequently Asked Questions

Is OpenAPI the Same Thing as REST?

No. OpenAPI describes HTTP interfaces. REST is an architectural style, and a service may use an OpenAPI description without establishing every REST constraint. Document the actual resource behavior and method semantics instead of relying on a label.

Does SOAP Always Mean Synchronous Processing?

No. SOAP describes a message framework, not a universal completion time or transport guarantee. The operation and binding determine how the system exchanges messages, while the application contract explains when the business task is complete.

Can an AsyncAPI Event Replace a Booking Response?

It may supply the final business result in a deliberately asynchronous workflow, but only if identity, delivery, state and reconciliation rules are documented. The initial HTTP response can still be necessary to acknowledge submission and provide the booking reference.

Why Is a Missing Numeric Field Different from Zero?

Zero is a known number. An absent or null property may indicate missing information or an explicitly unavailable value. Treating either as zero can create false pricing or validation conclusions. SPEC-782 blocks price-dependent action until minorUnits is known.

What Happens When a New Status Appears?

In the fictional consumer, it becomes internal UNKNOWN while the original value is retained. That preserves compatibility without converting an unrecognized state into a positive booking decision. Contract changes still require release communication and tests.

What Makes Documentation Ready for Handover?

Versioned interface descriptions, field semantics, examples, error guidance, mapping rules, authentication instructions, state diagrams or explanations, traceable tests and named owners. A handover is credible when another team can reproduce the agreed cases and investigate a failure without guessing.

Putting Specifications to Work

API types help teams choose the communication pattern. Specifications define the boundaries of what software may send and receive. Documentation makes those boundaries understandable and operational. The strongest integrations align all three with evidence: they check inputs at each interface, preserve uncertain data rather than inventing defaults, and separate an accepted request from an accepted booking.

SPEC-782 illustrates a method rather than a product: describe the journey, contract each boundary, validate the mapping, test ambiguity, retain compatible unknown states and obtain business sign-off against observable outcomes. For travel software projects, that method provides a more dependable basis for integration planning than an endpoint inventory alone.