● Travel Never Stops. Neither Do We. 365 Days a Year.
Connected thinking. Practical technology.

REST

Design REST APIs with clear resource ownership, predictable HTTP behaviour, secure access, recoverable failures and documented contracts that support dependable integration across travel and enterprise applications.

Professional using a business application on a laptop
Illustrative application workspace

REST: A Practical Guide to Resource-Oriented API Architecture

Representational State Transfer (REST) is an architectural style for designing distributed systems. It provides principles for identifying resources, exchanging representations, separating clients from servers and making interactions understandable through a consistent interface. REST is not a programming language, commercial product, software framework or API provider. It is a technology capability that can be implemented using different languages, frameworks and infrastructure components. HTTP is commonly used to implement REST-style APIs, while JSON is a frequent representation format.

The distinction matters because an API can exchange JSON successfully without following REST's architectural principles. An endpoint may respond correctly during a demonstration yet remain difficult to integrate because its resource ownership, authentication rules, update behaviour or failure responses are unclear. A useful REST-style API should tell consumers what they can access, which operations are supported, what each response means and how to recover when an operation does not complete as expected. These concerns become particularly important when APIs connect independently maintained applications. A travel platform, for example, may expose internal reservations, customer accounts, supplier mappings and agency permissions while communicating with external systems that follow different technical conventions.

REST can provide a consistent interface for those internal resources. It does not automatically make external supplier systems consistent, eliminate distributed transaction failures or guarantee the availability of information obtained from another service. TravelTech365 approaches REST as an architectural design decision rather than a collection of endpoint naming conventions. The purpose is to establish understandable contracts that can be implemented, tested and maintained without exposing unnecessary internal complexity. The foundational explanation remains Roy Fielding's original REST architectural description. HTTP request semantics are defined separately in RFC 9110.

Understanding the Architectural Principles Behind REST

Client-server separation and stateless communication

REST separates client responsibilities from server responsibilities. A browser, mobile application or partner system can request a resource representation without needing to understand how the server stores or calculates that resource. This separation allows the user interface and backend implementation to change independently, provided their agreed interface continues to behave as expected. Stateless communication is another central constraint. Each request should contain the information necessary for the server to interpret it. The server should not depend on an undocumented sequence of earlier requests held in conversational session state.

Statelessness does not mean that an application cannot use databases, store reservations or maintain authentication records. It means individual requests should be understandable without relying on hidden client-session context. For example, a reservation retrieval request should identify the requested reservation and carry appropriate authentication information. Its correctness should not depend on which search page the user visited immediately beforehand.

Uniform interfaces and self-descriptive messages

REST places particular importance on a uniform interface. Resource identity, request methods, representations and response metadata should help clients interpret interactions consistently. A client should not have to learn an entirely different meaning for GET, PUT or DELETE whenever it accesses a new resource. HTTP methods, status codes, content types and conditional headers contribute to this consistency. Their general semantics are described by the HTTP specifications rather than invented independently for every application. REST also includes hypermedia-driven application state. Representations can provide links describing available resources or transitions, allowing clients to discover permitted next actions instead of constructing every interaction from undocumented assumptions.

Many commercial JSON APIs use resource-oriented HTTP conventions without implementing comprehensive hypermedia controls. Such systems are commonly described as REST APIs, but their use of REST constraints may be partial. This distinction should be recognised when describing an architecture rather than hidden behind a label.

Layered systems and cacheability

REST allows intermediary components such as gateways, proxies and caches to participate in communication without requiring clients to know every internal processing layer. A request might enter through an API gateway, reach an application service and involve another backend component before a response is returned. Layering can support responsibility separation, but additional network calls also introduce operational overhead and more failure points. Cacheability is another REST constraint. Responses should communicate whether reuse is permitted. A reference-data response may have different caching requirements from a customer-specific reservation response. The precise rules are defined in RFC 9111: HTTP Caching.

Where REST Fits in Modern Software Applications

REST-style APIs are well suited to applications that expose identifiable resources through standard request-response interactions. Typical resource categories include customer profiles, account settings, product records, agency configurations, reservations, documents, administrative permissions and reporting requests. A client can retrieve a resource, request an authorised modification or create a related resource through a documented interface. The server retains responsibility for validation, business rules and persistence. REST is particularly useful where different consumers need access to a common application backend. A web portal, mobile application and authorised integration partner may use the same underlying resources while receiving different access permissions or representations.

This does not require every consumer to receive identical data. Responses can be scoped according to identity, role and legitimate business requirements.

REST in B2B and B2C travel technology

A B2B travel agency platform may expose agency profiles, booking records, wallet information and permitted administrative operations through REST-style interfaces. The resource model must distinguish an agency, its sub-agents, individual users and the organisation operating the platform. A B2C online travel agency platform may use REST-style APIs to coordinate customer accounts, saved travellers, search requests and reservation records. Both applications can share backend services, but authentication, pricing visibility, permissions and customer-data boundaries may differ. REST helps standardise communication between components. It does not prescribe commercial policies, supplier entitlements, customer eligibility or the underlying reservation lifecycle.

Where REST may not be the best choice

REST should not be selected automatically for every communication problem. Applications requiring continuous bidirectional communication may benefit from WebSockets or another streaming mechanism. Highly coupled internal services may find a remote procedure call interface more suitable. GraphQL can be useful when consumers require flexible selection of fields across connected data structures. Event-driven messaging can be more appropriate for asynchronous notifications and durable background processing. Large data exports may require specialised file delivery or batch-processing arrangements rather than one synchronous HTTP response. These alternatives are not inherently better or worse. Their suitability depends on interaction patterns, operational requirements, client capabilities and acceptable complexity.

A practical architecture can combine REST with messaging, streaming and other interfaces instead of forcing every workload into one communication style.

Engineering colleagues reviewing software together
Illustrative software review — make decisions, dependencies and acceptance evidence explicit.

Resource Design: The Foundation of a Maintainable REST API

Identify resources before defining endpoints

Resource modelling should begin with the business entities and responsibilities that need to be exposed. A resource is not necessarily a database table. It represents something the application can identify and communicate about through an interface. Consider an application that manages agency accounts, booking requests and confirmed reservations. These concepts may need distinct resource identities because they have different ownership rules, lifecycles and permissions. A search request may expire, while a reservation record may remain available for operational or historical purposes. Combining them into one poorly defined object makes lifecycle management difficult. Resource names should reflect meaningful concepts rather than internal function names.

For example, /reservations/{reservationId} identifies a reservation resource. A route such as /getReservationDataNow describes a procedure and makes the interface more dependent on implementation terminology. The former is generally easier to integrate into a resource-oriented contract.

Define resource ownership explicitly

Resource ownership is one of the most important REST API design decisions. Every protected resource should have a clear access model that identifies which organisation, tenant, account or user is authorised to retrieve or modify it. Ownership must not be inferred merely from a client-supplied identifier. An authenticated agency user requesting a reservation belonging to another agency must not gain access simply because the reservation identifier is valid. The server must evaluate the requested resource against the authenticated principal and relevant authorisation policy. For multi-tenant applications, resource queries should enforce tenant boundaries at the appropriate service and data-access layers.

Administrative privileges need separate treatment. A platform operator may require controlled support access without granting ordinary agency users equivalent visibility. Ownership rules should also cover resource creation, transfer, reassignment and deletion. If an agency is suspended, the design must state whether its reservations remain available to designated administrators, whether existing integrations retain access and how the policy is enforced.

Separate representations from internal storage

An external representation should contain the information a consumer needs, not everything stored internally. A reservation representation might include an identifier, current state, permitted actions and relevant timestamps. Internal database keys, supplier credentials, debugging information and operational secrets should remain outside the public contract. Representations can also differ according to consumer permissions. A customer-facing response may omit internal settlement details that an authorised finance user can access through a separately controlled interface. This separation allows database structures and internal services to evolve without requiring every external consumer to change. It also helps prevent accidental exposure when new internal fields are added.

HTTP Methods and Their Intended Behaviour

HTTP provides standard methods for interacting with resources. Their semantics should guide API design rather than being treated as interchangeable route labels. The HTTP Semantics specification defines the central behaviour of these methods.

HTTP Methods and Their Intended Behaviour
HTTP methodIntended useImplementation decision or risk
GETRetrieve a resource representationMust not request a state-changing business operation; define caching and access rules
POSTSubmit data for processing or create a resourceDefine duplicate prevention, uncertain outcomes and successful response behaviour
PUTCreate or replace the state of a target resourceEstablish complete-replacement semantics and protect against conflicting updates
PATCHApply a partial modificationSpecify the patch format, valid fields and concurrency requirements
DELETERemove a resource association or state as defined by the APIClarify whether deletion is physical, logical or restricted by business rules
HEADRetrieve response metadata without the representation bodyKeep relevant response metadata consistent with GET
OPTIONSCommunicate supported communication optionsConfigure method support and browser preflight handling where applicable

Use status codes to describe actual outcomes

A successful HTTP response should distinguish a completed operation from one that has only been accepted. For example, 200 OK can describe a successful request with a response representation. 201 Created identifies successful resource creation, while 202 Accepted indicates that processing has been accepted but is not necessarily complete. 204 No Content can be appropriate when an operation succeeds without a response body. Client errors and server failures must also remain distinct. An invalid request, unavailable permission or missing resource should not routinely return 200 OK with an error message hidden inside the JSON body. Correct status codes help SDKs, intermediaries, monitoring systems and integration teams interpret behaviour consistently.

Design PUT and PATCH carefully

PUT and PATCH serve different modification purposes. PUT represents replacement semantics for the target resource. PATCH describes a partial modification, with the precise meaning determined by the patch document format. RFC 5789 defines HTTP PATCH. For JSON documents, JSON Patch provides operation-based changes, while JSON Merge Patch describes modifications through a document resembling the target structure. These formats are alternatives, not automatically interchangeable mechanisms. JSON Merge Patch uses null values to express removal, which can be unsuitable where explicit null is an important application value. A well-designed API must document which format it accepts and how invalid modifications are rejected.

Partial updates should also enforce field-level permissions. Allowing customers to update contact details must not accidentally permit changes to payment status, tenant ownership or internal approval fields.

Caching Without Returning Incorrect or Sensitive Data

Caching can reduce repeated retrieval work, but inappropriate caching can expose information or produce misleading results. REST APIs should define caching based on the resource's sensitivity, freshness requirements and intended audience. Public reference information may be suitable for controlled caching. Customer-specific reservations and confidential financial records generally require more restrictive policies. Cache-Control: private restricts storage by shared caches but does not prohibit storage in a private cache. Cache-Control: no-store directs conforming caches not to store the response. It is not, by itself, a complete privacy or data-protection mechanism. These distinctions are documented in RFC 9111. Conditional requests using entity tags can help clients revalidate a previously retrieved representation.

For example, a client can use If-None-Match to ask whether its cached representation remains current, potentially receiving 304 Not Modified. However, a cached travel offer should never be treated as a contractual guarantee that the original price or inventory remains available. A current supplier validation may still be necessary before a transaction is committed.

API Contracts: Document What Consumers Can Depend On

A REST API contract should define more than a collection of URLs. Consumers need to understand accepted request formats, mandatory fields, authentication requirements, response structures, error conditions and operational limits. The contract should explain which fields are authoritative, which are optional and which may change during the resource lifecycle. For each operation, documentation should establish the expected successful result and the possible failure outcomes.

OpenAPI and machine-readable documentation

The OpenAPI Specification provides a language-independent mechanism for describing HTTP API interfaces. An OpenAPI document can describe operations, parameters, request bodies, response formats, authentication schemes and reusable schemas. This allows documentation tools, testing utilities and code-generation systems to work from a shared description. However, a valid OpenAPI document does not prove that an implementation follows REST constraints or correctly enforces its business rules. Generated documentation also cannot replace explanations of business transitions, retry safety or uncertain supplier outcomes. A useful specification therefore combines machine-readable structure with written behavioural rules and examples.

Documentation should be reviewed whenever implementation behaviour changes. A contract that appears complete but describes outdated responses creates integration risk.

Field meanings must be unambiguous

Fields such as status, reference, amount and updatedAt frequently cause confusion when their meanings are assumed rather than defined. A status might describe an internal workflow, a supplier response or the final state visible to a customer. A monetary amount must have a defined currency and clear treatment of components, rounding and tax-related data where applicable. Timestamps should use a documented format and time-zone convention. Clients should not have to guess whether a value represents local time or UTC. Optional fields require explicit handling. A missing field, a null value and an empty string may communicate different information.

These decisions appear minor during development but become significant when multiple applications depend on the same contract.

Error Handling That Supports Real Integration

Use structured, machine-readable error responses

An error response should help consumers identify what failed and decide what action is appropriate. RFC 9457: Problem Details for HTTP APIs defines a standard representation for communicating HTTP API problems. It uses fields such as type, title, status, detail and instance, with support for application-specific extensions. An API can use this format to distinguish invalid input, missing permissions, stale resource versions and other documented conditions. The general HTTP status remains important. The problem response provides additional meaning rather than replacing the status code. An error body should not expose stack traces, access tokens, database queries or confidential upstream responses.

Technical diagnostics belong in protected monitoring and logging systems, where they can be correlated with an external request identifier.

Define actionable error categories

Validation errors should explain which submitted information is unacceptable without disclosing internal implementation details. Authentication failures should indicate that valid authentication is required. Authorisation failures should communicate that an authenticated consumer lacks permission. Conflict responses should explain when a resource state prevents the requested operation. Rate-limit responses should distinguish temporary request restrictions from ordinary validation failures. Upstream service failures need careful treatment. An integration service should not invent a successful outcome simply because an external supplier response is missing. Equally, it should not automatically declare an operation unsuccessful when its result is uncertain.

A good error contract tells consumers whether to correct data, request new permission, retry after a delay, retrieve current state or contact an authorised support channel.

Pagination, Filtering and Resource Discovery

Collection endpoints should establish clear limits on the amount of information returned. An agency with a small number of records may not notice pagination weaknesses. The same API becomes difficult to operate when records accumulate across many months or organisations. Offset pagination can be straightforward, but concurrent inserts and deletions may cause inconsistent traversal. Cursor-based pagination can provide more stable continuation for certain datasets when implemented with an appropriate ordering and cursor design. Neither approach is universally correct. The API should document its ordering guarantees, continuation behaviour, maximum page size and handling of expired or invalid cursors.

Filters should be explicit and validated. Unsupported field names or excessively broad queries should not silently trigger expensive unbounded operations. Resource representations may also contain links to related resources or permitted transitions. For example, a reservation response might identify an associated payment resource or a supported action link, subject to authorisation. These links should be generated from the actual resource state, not presented as proof that a future external operation will necessarily succeed.

Safe Retries and Duplicate Prevention

Network failures create one of the most consequential design problems for transactional APIs. A client can send a request successfully and lose the response before learning whether the server completed the operation. Repeating the same request without understanding its semantics can create duplicate resources or repeated external actions.

Understand idempotency correctly

Under RFC 9110, GET, PUT and DELETE have idempotent method semantics, whereas POST is not inherently idempotent. Idempotency means repeating an identical request has the same intended server-side effect as performing it once. It does not mean every repeated request returns an identical response. An implementation must still respect these semantics. A DELETE operation should not create additional destructive effects merely because a client repeats it. POST operations that initiate transactions require additional controls when retries are supported.

Define an application-level idempotency contract

A transactional API can use an idempotency key to identify repeated attempts at the same logical operation. The contract must define how the key is supplied, its scope, retention period and behaviour when the same key is reused with different input. The server should record the operation's state durably enough for the chosen failure model. If the original request completed, an equivalent retry should not initiate a second operation. If processing remains incomplete, the server should communicate the relevant in-progress state rather than inventing a final result. Idempotency keys do not automatically create exactly-once execution across independent systems.

An external supplier may receive an operation even when the local application cannot confirm its outcome. The integration must then use supported status retrieval, reconciliation or controlled manual investigation.

Retry only when the operation is safe to repeat

Clients should not retry every failure indiscriminately. A temporary connection failure may justify a retry for an operation whose retry semantics are established. A validation error generally requires corrected input rather than repetition. Responses such as 429 Too Many Requests may include Retry-After guidance, as described in RFC 6585. Retry policies should account for deadlines, bounded attempts, backoff, jitter and downstream capacity. Repeated retries across multiple application layers can amplify an outage. The architecture should assign retry responsibility deliberately.

Managed server infrastructure in an illustrative data centre
Illustrative infrastructure — reliable integrations need monitoring, recovery and clear operational ownership.

Concurrency Control and State Consistency

A REST API may serve several clients attempting to modify the same resource. Consider two administrators reading the same agency configuration. One changes a credit setting while the other changes a separate permission. Without concurrency controls, the second update might overwrite the first administrator's work. HTTP conditional requests provide a mechanism to reduce such conflicts. A server can return an entity tag representing a resource version. The client can then submit If-Match with its update. If the resource has changed, the server can reject the outdated modification, commonly using 412 Precondition Failed. The client must retrieve the current representation and decide whether its intended change remains valid.

Applications may also use database transactions, row-version columns or other internal concurrency mechanisms. HTTP conditions do not replace the need for correct transactional logic. The application must decide whether a conflict can be merged safely or requires a fresh business decision. For financially significant operations, silently overwriting conflicting changes is usually inappropriate.

Handling Long-Running and Uncertain Operations

Some operations cannot be completed reliably within a short synchronous request. A report may take time to generate. An external integration may require additional processing. A reservation-related action may depend on a supplier whose response is delayed. A REST-style interface can represent such work as an identifiable operation resource. A request can return 202 Accepted with a reference that allows the client to check processing state. The operation should distinguish pending, running, completed, failed and uncertain outcomes according to the application's actual workflow. It should also specify when results become available and how long operation records remain accessible.

Where supported, callbacks or webhooks can complement polling. These mechanisms require their own authentication, delivery and duplicate-handling rules. An HTTP timeout does not establish that an external transaction failed. A reliable system must preserve the difference between confirmed failure and unknown outcome until appropriate evidence becomes available.

A Realistic REST API Architecture

Separate interface responsibilities from business processing

A maintainable architecture generally separates the public HTTP interface from application rules and persistence concerns. At the entry point, an API gateway or equivalent component may provide routing, traffic controls and common security enforcement. The application layer validates requests, checks permissions and coordinates business operations. Domain services implement resource lifecycles and business invariants. Persistence components manage stored data, transactional updates and concurrency. Integration adapters communicate with external services and translate their responses into an internal model. Background workers handle asynchronous operations where required. These layers describe responsibilities rather than mandatory independently deployed microservices.

A modular application can implement them within one deployable service. Separating every responsibility into a networked microservice may introduce complexity without providing a corresponding operational benefit.

Use adapters for external providers

External APIs do not necessarily follow the same conventions as the platform exposing the REST interface. A supplier may use REST-like HTTP, SOAP, XML, proprietary messaging or a specialised industry protocol. An adapter can translate supported supplier operations into the internal application's resource model. However, an adapter must preserve important differences rather than flattening them into misleadingly uniform data. Supplier references, returned conditions, availability limitations and operational restrictions may remain relevant to the consuming application. The adapter should record the actual external outcome and expose only capabilities supported by the approved integration arrangement. An internal REST resource does not establish permission to access a particular supplier product.

Actual capabilities depend on contracted services, authorised markets, account permissions and the provider's supported operations.

REST API Security and Access Control

Authentication is only the beginning

Authentication establishes the identity of the caller. Authorisation determines whether that caller may perform the requested operation on the specific resource. A valid token must not automatically grant access to every resource identifier. The OWASP API Security Top 10 identifies broken object-level authorisation, broken authentication and object-property authorisation as important API security risks. These problems are particularly relevant to multi-tenant applications. Every protected resource lookup should enforce the relevant organisation, account and role restrictions. An API must also check which fields may be changed. Preventing unauthorised retrieval is insufficient if a legitimate user can modify restricted properties.

Protect credentials and communications

HTTPS should be used to protect API traffic in transit. OAuth 2.0 can provide an authorisation framework where appropriate, but its selection and configuration require a defined trust model. RFC 9700 provides current OAuth 2.0 security best-practice guidance, including recommendations for modern authorisation flows and token protection. Access tokens should be validated against the expected issuer, audience, lifetime and applicable permissions according to the token format and deployment model. Credentials must be stored securely, rotated through controlled procedures and excluded from public documentation and diagnostic logs. Machine-to-machine integrations and browser-based applications may require different authentication arrangements.

Security choices should follow the actual client type instead of treating one token mechanism as universally suitable.

Browser access and CORS

Browser-based applications may use Cross-Origin Resource Sharing (CORS) when requesting APIs hosted on another origin. CORS determines whether browsers permit certain cross-origin access. It is not a replacement for server-side authentication or authorisation. Permitted origins, methods and headers should be configured deliberately. Credentialed cross-origin requests require particular care. The MDN CORS documentation explains browser preflight requests and the associated response headers. CORS behaviour should be tested alongside cookie policies, token handling and request-forgery protections where relevant.

Rate limits and resource protection

An authenticated API can still be overloaded by excessive or expensive requests. Rate limits, request-size restrictions, query-complexity controls and timeouts should reflect the resource's operational cost. A simple account lookup and an expensive multi-source query may need different limits. Controls may be applied by client, user, tenant, operation or another justified boundary. Sensitive operations also require audit trails recording who requested a change, which resource was affected and what result was established. These controls should protect service availability without preventing authorised users from resolving legitimate operational failures.

Testing REST APIs Beyond Successful Requests

Contract and integration testing

Testing should start with the documented contract. Requests must be checked against field requirements, allowed values, authentication rules and response schemas. Tests should verify that success and failure responses follow their documented status semantics. Contract tests can detect accidental changes that would break existing consumers. Integration tests should exercise the actual application layers, including persistence and relevant adapters, rather than validating only controller-level responses. Mocks are useful for repeatable testing, but they cannot prove that an external provider behaves exactly like the mock.

Failure cases that require deliberate coverage

A useful test suite should include expired authentication, inaccessible tenant resources, invalid identifiers, unsupported media types and malformed request bodies. It should test repeated POST submissions, stale update conditions, concurrent modifications and conflicting resource states. Network interruption deserves special attention. Tests should simulate a request reaching the server while the client loses the response, then verify that subsequent recovery follows the documented contract. Other cases include rate limiting, downstream timeouts, unavailable databases, partial processing and unexpected provider responses. For asynchronous operations, testing should verify that the operation cannot silently disappear between the initial acceptance and final processing.

The system should also be evaluated for sensitive-data leakage through logs, responses and error messages.

Performance and security validation

Performance evaluation should use realistic request distributions and data volumes. The meaningful measures depend on workload and may include response latency, error rates, concurrent requests, database contention and downstream dependency behaviour. No programming language or REST framework guarantees a particular throughput. Security testing should include attempts to access another tenant's records, update restricted properties and bypass function-level permissions. Automated testing is valuable, but sensitive business workflows also benefit from targeted manual review and adversarial test scenarios.

Deployment, Monitoring and Operational Maintenance

Release infrastructure without breaking consumers

REST services can be deployed through containers, virtual machines, managed application platforms or other supported environments. The infrastructure model should be selected according to operating requirements, security responsibilities and team capability. Production configuration should separate secrets from source code and distinguish development, test and production environments. Database migrations need compatibility planning, particularly when an application is deployed gradually across multiple instances. Health checks should distinguish basic process availability from genuine readiness to accept traffic. A service may be running while its database or essential dependency remains unavailable.

Deployments should support rollback or corrective recovery, but database changes and externally committed transactions may not always be reversible through a simple application rollback.

Make failures observable

Operational monitoring should connect client requests with relevant internal processing and downstream calls. Useful signals include request latency, HTTP status distribution, error categories, dependency failures and asynchronous operation backlogs. Correlation identifiers can help investigators connect an external request with protected internal records. The OpenTelemetry HTTP semantic conventions provide established terminology for HTTP-related traces and measurements. Monitoring must avoid unnecessarily collecting access tokens, payment details or personal information. Operational alerts should focus on conditions requiring action rather than generating notifications for every expected validation error. Maintenance also includes dependency security updates, certificate renewal, capacity review, documentation checks and periodic access-policy audits.

REST API Versioning and Compatibility Management

Version contracts deliberately

REST does not require one universal API versioning format. An application may version interfaces through URI paths, representation media types or another explicitly supported mechanism. The correct choice depends on consumer requirements, compatibility rules and the deployment model. Version identifiers alone do not guarantee compatibility. A change can break consumers even when a route remains unchanged. Examples include removing a response field, changing its meaning, introducing a new mandatory input or altering the semantics of an existing status value. Adding an optional field may be compatible for clients designed to ignore unknown fields, but strict clients can still fail if their implementation assumes a fixed structure.

Compatibility testing should therefore examine real consumer expectations rather than relying solely on version labels.

Plan deprecation and retirement

When an operation or representation must be retired, consumers need a documented migration path. A deprecation notice should explain what is changing, which replacement is available and when the existing contract is expected to stop working. RFC 9745 defines the HTTP Deprecation response header. The Sunset header specification provides a mechanism for indicating when a resource is expected to become unavailable. These headers support communication but do not replace direct coordination with important integration partners. A responsible retirement process includes usage visibility, migration testing, a defined support period and clear escalation ownership. Old interfaces should not remain active indefinitely without security maintenance merely because a consumer has not completed migration.

REST Implementation Across Programming Languages

REST is language-independent. Teams can select implementation frameworks based on their existing expertise, deployment environment and maintenance requirements. In Node.js, Express provides HTTP routing methods and middleware mechanisms. Developers must still design validation, authorisation, error handling and application boundaries. NestJS offers controller and decorator mechanisms for organising routes in Node.js applications. In Java, Spring Framework provides annotated request mappings, including method-specific mappings for GET, POST, PUT, PATCH and DELETE. In Python, FastAPI supports path operations, structured request validation and integration with OpenAPI documentation. These are examples of real frameworks, not mandatory components or claims that one framework is inherently superior. The architectural questions remain the same regardless of implementation language.

A framework can simplify request routing and data validation. It cannot determine which organisation owns a reservation, whether a supplier operation is safe to retry or what an uncertain financial outcome means. Those decisions require explicit application design.

REST Compared With Other API Approaches

Selecting an API style should begin with the actual communication requirements.

REST Compared With Other API Approaches
ApproachAppropriate use caseMain tradeoff
REST-style HTTP APIResource-oriented client-server operations and broadly accessible integration interfacesRequires careful resource, state, retry and contract design
GraphQLClients requiring flexible field selection across related dataQuery complexity, caching and access enforcement require deliberate controls
gRPCStrongly defined service operations, particularly within controlled environmentsClient support, tooling and operational model differ from conventional resource APIs
SOAPEnvironments with established SOAP contracts and related protocol requirementsXML-based contracts and protocol conventions may increase integration complexity
WebSocketsPersistent bidirectional communicationConnection lifecycle, state management and recovery need additional design
Event-driven messagingAsynchronous communication and decoupled processingDelivery guarantees, ordering, duplicates and eventual consistency require explicit handling

GraphQL documentation describes its query model, while the official gRPC documentation explains its service and protocol-buffer-based approach. REST and these alternatives can coexist. For example, a public platform might expose REST resources while internally using a message broker for background processing. The objective is not to standardise every interaction on one technology, but to assign the right communication mechanism to each responsibility.

Illustrative Example: A REST API for Reservation Records

Illustrative example only — this is a proposed architectural scenario, not a completed TravelTech365 customer project, deployed endpoint or representation of any supplier's actual API. Consider a travel platform that maintains internal reservation records for its authorised agency users. The application needs to allow reservation retrieval, limited customer-detail updates and submission of supported servicing requests.

Step 1: Establish resource identity

The platform defines an internal reservation resource identified by a stable application-generated identifier. The identifier is distinct from an external supplier's reference. This distinction allows the platform to preserve its internal resource identity even when different external systems use different reference formats. The API documentation explains which identifier consumers should store and which external references may be available to authorised users.

Step 2: Check ownership and permissions

An agency user requests the reservation. The service authenticates the user and determines the relevant agency and permitted role. The resource query enforces the agency's access boundary. If the user lacks permission, the API does not return protected reservation information. An internal support administrator may have separately defined access under a controlled policy.

Step 3: Return a documented representation

The successful retrieval returns the resource's current internal state, relevant timestamps and permitted information. The representation distinguishes internal status from any external supplier status. Sensitive administrative fields are excluded unless explicitly authorised. The response uses documented HTTP status semantics and an appropriate cache policy.

Step 4: Handle a controlled update

Suppose an authorised user needs to modify an internal contact field. The API first verifies whether that field may be modified in the current state. If conditional updates are supported, the client submits the resource version it previously retrieved. A conflicting change causes the update to be rejected rather than silently replacing another user's work. The API returns a documented result identifying whether the modification was accepted.

Step 5: Submit an external servicing request

The user requests an operation that may require communication with an external system. The platform creates an internal operation record and applies the relevant permission and input checks. If the work cannot complete synchronously, the API can return an accepted state with a reference for tracking. The operation is not described as completed until the application has sufficient evidence of the actual result.

Step 6: Recover from an uncertain response

Assume the external request reaches its destination, but the platform loses the connection before receiving confirmation. The operation record remains uncertain. The application follows the integration's supported status-verification or reconciliation process. It must not blindly repeat a potentially irreversible action. The consumer can retrieve the current operation state without initiating another transaction.

Step 7: Preserve an audit trail

The application records the internal operation identifier, authorised actor, relevant state transitions and externally established result. Sensitive request content is protected according to the data-handling policy. The final resource representation reflects only the outcome supported by available evidence. This example demonstrates the central value of REST design: clients receive a consistent resource interface while complex business and integration responsibilities remain controlled by the backend. For related domain considerations, see Flight Reservation Systems.

Planning a REST API Development Project

Begin with responsibilities and integration boundaries

A REST development project should begin by identifying consumers, resources, access boundaries and required business operations. Discovery should establish which data the application owns and which information comes from independently operated systems. The team should then define resource lifecycles, request formats, error semantics, concurrency policies and operational requirements. An initial contract should be reviewed with representative consumers before implementation becomes difficult to change. Security requirements belong in this planning stage rather than being added after the endpoints are complete.

Move from contract to controlled delivery

Implementation can proceed through resource modules, contract validation, integration adapters and operational controls. Testing should cover both normal behaviour and uncertainty caused by duplicate submissions, interrupted connections and unavailable dependencies. Deployment planning should address environment configuration, migration compatibility, monitoring and support responsibilities. TravelTech365's software development and API integration process explains the broader project stages from discovery through implementation, testing and operational support. The appropriate scope depends on the number of resource domains, consumer types, integration dependencies and reliability requirements.

Frequently asked questions

1. What is REST in API development?

REST stands for Representational State Transfer. It is an architectural style describing how components of a distributed system can interact through identifiable resources and a uniform interface. REST is not a particular framework or programming language. It defines constraints relating to client-server separation, stateless communication, cacheability, layered systems and resource interaction. In a typical HTTP implementation, clients interact with resource representations using standard methods and response semantics. A REST-style API should make its data model, permissions and supported operations understandable without exposing unnecessary internal implementation details. Simply returning JSON from an HTTP endpoint does not demonstrate that all REST architectural constraints have been implemented.

2. Is REST the same as HTTP or JSON?

No. HTTP is a communication protocol with standard request methods, response statuses and message semantics. JSON is a data format used to represent structured information. REST is an architectural style that can use HTTP and JSON, but neither technology independently defines REST. An API might exchange JSON through POST requests while treating every endpoint as a remote procedure call. Such an interface can work correctly without expressing the resource-oriented constraints associated with REST. Likewise, REST representations are not restricted to JSON. The important design question is whether resource identity, interaction semantics, representation metadata and client-server responsibilities remain coherent.

3. What makes a REST API suitable for travel platforms?

Travel applications contain many identifiable resources, including accounts, agencies, travellers, reservations and configuration records. REST-style interfaces can provide a consistent way for authorised clients to access these resources. This is useful when a web application, mobile application and partner integration consume the same backend services. However, the API must distinguish internal application resources from external supplier operations. A reservation identifier does not establish permission to modify an airline or hotel booking. The platform must preserve supplier-specific restrictions and confirmed outcomes. REST supports communication architecture, while actual booking authority depends on the approved external integration and business arrangements.

4. How should REST API resources be named?

Resource names should communicate stable business concepts. Collection names normally describe groups of resources, while resource identifiers select individual members. For example, a reservations collection and an individual reservation can be represented through related resource paths. Naming should remain consistent across the API without exposing unnecessary database structure. Developers should avoid creating a different procedural naming convention for every operation when standard HTTP semantics already express the intended interaction. However, some business actions are not simple resource updates. Such operations may be modelled as identifiable requests or operation resources with their own lifecycle. Good naming follows meaningful resource boundaries rather than rigid stylistic rules.

5. How should permissions be managed in a REST API?

Permissions should be enforced on the server for every protected operation. The service must establish the caller's identity, determine the appropriate role and verify access to the requested resource. An authenticated user must not gain access to another organisation's records simply by changing a resource identifier. Field-level permissions are equally important. A user who may update a customer contact number should not automatically be allowed to modify financial approval fields. Multi-tenant systems should enforce ownership consistently across service and data-access layers. Permission changes, administrative overrides and sensitive operations should be recorded through appropriate audit mechanisms. Authentication alone is never a substitute for resource-level authorisation.

6. Which HTTP status codes should a REST API use?

Status codes should reflect the actual outcome of a request. Successful retrieval commonly uses 200 OK, while successful creation may use 201 Created. 202 Accepted is appropriate when processing has been accepted but has not necessarily finished. Common client-side responses include 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found and 409 Conflict. Concurrency checks may produce 412 Precondition Failed. Temporary server or upstream failures should use appropriate failure semantics rather than presenting an unverified success. The API must also document its application-specific error information. Consistent status handling helps clients distinguish corrections, permission problems, retries and uncertain operations.

7. How should REST APIs prevent duplicate transactions?

Duplicate prevention begins with understanding which operations can be repeated safely. Standard idempotent HTTP methods have defined intended effects, but a POST operation may create a new resource or initiate an external transaction. For transactional POST operations, an application can define an idempotency-key mechanism. The server should associate repeated attempts with the same logical operation and document the key's scope and retention policy. Durable operation records are especially important when network failures occur. The implementation must not assume that losing a response means an operation did not happen. Where external systems are involved, duplicate prevention may also require status verification and reconciliation.

8. What should happen when an API request times out?

A timeout means the client did not receive a result within its configured deadline. It does not necessarily mean the server failed to process the request. For a safe retrieval operation, a controlled retry may be reasonable. For a transaction, the client should first follow the documented recovery mechanism. That may involve retrieving an existing operation resource, reusing a supported idempotency key or requesting current state. If an external provider may already have acted, repeating the command could create a duplicate. The application should preserve uncertainty until it obtains sufficient evidence. A reliable contract distinguishes confirmed failure, confirmed completion and unknown outcome.

9. Can REST APIs support asynchronous operations?

Yes. REST-style interfaces can represent asynchronous work through identifiable operation resources. A client may submit a request and receive 202 Accepted when processing has been accepted but not completed. The response can identify a resource that exposes the operation's current state. Clients may poll that resource according to documented limits. Webhooks or other notification mechanisms can complement this model where supported. The API should define final states, retention periods, failure conditions and whether cancellation of pending work is possible. Asynchronous acceptance must not be represented as a completed business transaction. The underlying application remains responsible for processing reliability and recovery.

10. How does REST API caching work?

HTTP caching allows eligible responses to be stored and reused under defined conditions. The API can use cache-control directives to communicate whether responses may be stored and how they should be revalidated. Reference information may tolerate caching differently from personal account information or frequently changing availability data. Entity tags can support conditional retrieval and reduce unnecessary representation transfer. However, caching must respect authentication boundaries and resource sensitivity. A cached response should not expose one tenant's information to another tenant. For travel applications, cached search or descriptive information should not be confused with a confirmed current supplier offer. Caching policy and business validity are separate concerns.

11. How should a REST API handle concurrent updates?

Concurrent updates should be controlled when multiple clients may change the same resource. A common approach is optimistic concurrency control. The server returns a resource version or entity tag, and the client includes the expected version with its update. If another actor has changed the resource, the server rejects the stale modification. HTTP supports this pattern through conditional requests such as If-Match. The application then decides whether a client should reload, merge changes or obtain fresh approval. Database-level transactional safeguards may still be required. An HTTP precondition protects the interface only when the implementation checks and applies it correctly.

12. Is REST secure by default?

No. REST provides architectural constraints, not a complete security implementation. A REST-style API still requires protected transport, appropriate authentication, server-side authorisation, input validation and secure handling of credentials. Resource identifiers must not be treated as proof of permission. Multi-tenant systems require explicit tenant isolation. Applications should also protect against excessive resource consumption, unsafe external requests and accidental disclosure of sensitive information. CORS configuration alone does not secure an API. Security controls must be selected and tested according to the application's trust model, consumer types and business operations. Framework defaults should be reviewed rather than assumed sufficient.

13. How should REST API versions be managed?

Versioning should follow a documented compatibility policy. The team must decide which changes can be introduced without breaking existing consumers and which require a separate interface contract. Removing fields, changing field meanings and introducing mandatory parameters can create compatibility problems. Even an apparently additive change may affect clients that reject unknown properties. Version identifiers may appear in paths, media types or another documented mechanism. Migration planning should identify affected consumers and provide a supported transition process. When a resource is being retired, deprecation information and sunset communication can help clients prepare. Versioning is an ongoing compatibility responsibility, not merely a URL naming decision.

14. Should we choose REST, GraphQL or gRPC?

The decision depends on consumer requirements and interaction patterns. REST is often a practical choice for resource-oriented HTTP interfaces used by browsers, mobile applications and integration partners. GraphQL may be attractive when clients need flexible selection of related fields. gRPC can be suitable for strongly defined service operations, especially within controlled service environments. Each introduces different considerations around tooling, caching, security, observability and client support. The alternatives are not mutually exclusive. An organisation may expose REST externally while using another protocol internally. The strongest decision is one based on actual communication requirements and long-term operational responsibility rather than technology popularity.

15. What information is needed before starting a REST API project?

A project should begin with the intended consumers and the business capabilities they need. The initial requirements should identify resources, ownership boundaries, permitted operations, expected data formats and integration dependencies. Teams should also document authentication arrangements, resource lifecycles, error handling, retry rules, concurrency requirements and expected traffic patterns. Where external providers are involved, approved access and supported operations must be confirmed separately. Deployment requirements, environment ownership, monitoring responsibilities and maintenance expectations should be discussed before implementation. A clear initial contract reduces the risk of discovering fundamental ownership or transaction-recovery problems late in development. TravelTech365 can review these requirements through its project enquiry process.

Build a REST API With Clear Contracts and Operational Responsibility

A reliable REST interface begins with a well-defined resource model and a clear understanding of who is permitted to interact with each resource. The implementation must preserve HTTP semantics, communicate errors consistently, protect against unsafe retries and support controlled changes as consumers and business requirements evolve. REST is most valuable when its principles simplify communication without hiding operational realities. For travel and enterprise applications, those realities include multiple consumer roles, independently operated integrations, sensitive information and transactions whose final outcomes may not be immediately available. TravelTech365 supports requirements analysis, API architecture, backend development, integration planning, testing and deployment as part of a structured software engineering engagement.

The scope of each implementation depends on the resources, consumers, external dependencies and operational responsibilities involved. Explore our development process to understand the delivery approach, or request a quote to discuss your REST API architecture and integration requirements.

Related technology guides