A supplier catalog is only useful when the local copy can be trusted. Travel platforms may refresh hotel descriptions, activity listings, transfer locations, rental vehicle categories, or other supplier reference data through paginated APIs. Fetching several successful pages does not, by itself, establish that the catalog is current. A connection can fail midway, a cursor can expire, a filter can change, or an item can appear twice while another is missed.
A reliable api solution treats catalog refresh as a controlled synchronization process rather than a loop that stops when there is no next page. It preserves the supplier's documented pagination sequence, records durable progress, reconciles repeated records, and distinguishes a completed enumeration from an interrupted one. Most importantly, it never assumes that a missing item has been deleted without appropriate evidence about the supplier's data model and snapshot semantics.
Define What the Catalog Refresh Must Prove
Before implementing pagination, define the result that downstream systems actually need. A refreshed catalog might feed search indexes, destination pages, inventory matching, merchandising rules, or an operations dashboard. Each consumer needs to know whether the published data reflects a validated supplier run or a partially updated working set. Without that distinction, an innocent network interruption can become a customer-facing content problem.
Separate transport success from synchronization correctness. An HTTP success response establishes that one request was accepted and answered; it does not prove that every relevant record was returned. Similarly, an empty page does not always mean the collection ended. The supplier's documented termination signal, not an inference from page length, must determine when traversal ends.
Agree on the scope before the first request
Write down the endpoint, tenant or account, market, language, supplier status, catalog category, sort controls, and any other selection parameters. Include the access permissions and feed version needed for the intended dataset. A hotel feed filtered to active properties in one market is not interchangeable with an unfiltered global feed, even if both return similar records.
Also define the meaning of a record identity. Prefer the supplier's stable identifier within a documented namespace and combine it with the supplier or account identifier when necessary. Titles and display names are poor keys: they can change or repeat. If the supplier lacks stable IDs, agree on an explicit matching policy before publishing updates or interpreting absence as removal.
Finally, classify the endpoint. Does it enumerate a complete current collection, return changes since a watermark, or expose an event stream? The answer determines what completeness and deletion can mean. Treat an undocumented assumption as a risk to investigate, not as an implicit feature of the api solution.
Read the Supplier Contract, Not the Token
Pagination interfaces differ in field names, ordering, request rules, and end conditions. Some carry a continuation token in a JSON response; others expose an authorized next-page URL. The adapter should follow the actual documentation and preserve the query context that gives each continuation meaning. Avoid creating a generic interpretation that silently overrides supplier behavior.
Google AIP-158, Pagination, is a useful design reference for token-based collection APIs, not a universal contract imposed on travel suppliers. Its guidance describes an opaque page token, a next-page token for continuation, and an empty next-page token as the end of a collection under that particular design. It also allows responses with fewer items than requested, including a zero-item page before the end. Implement those rules only when the supplier documents a matching interface.
Keep opaque tokens genuinely opaque
Do not base64-decode, parse, increment, trim, or manufacture a pagination token. Its contents may be an implementation detail that changes without notice. Store the exact value received, protect it as operational state, and send it back only in the manner required by the supplier. Even a token that looks like a page number should be treated as an uninterpreted continuation handle.
The token is not proof of authorization or record consistency. Authenticate every request normally, and ensure the next request is issued against the intended endpoint and account. If the supplier rotates credentials or changes account access during a run, treat the result as a state change requiring review rather than assuming the previous cursor still refers to the same data.
Freeze filters throughout a traversal
Persist the canonical request parameters alongside the initial page. Subsequent requests should use the same filters and sort choices unless the supplier expressly permits specific changes. If a client changes language, date range, resource status, or account halfway through, the returned sequence may no longer represent one coherent enumeration. Reject such a resume attempt and begin a newly scoped run.
Google AIP-158 expects pagination requests to preserve other arguments while allowing page size to change. That exception is guidance for AIP-compliant APIs, not permission to change page size for every supplier. For a conservative integration, pin the page size too unless the documentation explicitly supports variation. Stable request context is easier to audit and reproduce.
Use HTTP links only where documented
Some APIs supply a next-page URL through an HTTP Link header. RFC 8288, Web Linking, defines link relations and their representation in HTTP headers. It provides a standards-based mechanism for discovering related resources, but does not require supplier catalog APIs to offer pagination links or guarantee what their pages contain.
When a supplier documents a next relation, parse the header according to its syntax and follow only approved targets. Preserve authentication rules, validate permitted hosts, and avoid combining a supplied next URL with guessed query parameters. A Link header is an alternate transport for navigation information, not evidence that a refresh is a consistent snapshot.
Make Checkpoints Durable and Replayable
A production refresh can outlive a process, deployment, worker lease, or temporary outage. Durable checkpoints allow the next worker to understand what has already been committed and what remains uncertain. The checkpoint should describe a synchronization run, not merely store one cursor in an unlabelled configuration field.
Give each run a unique identifier and persist its supplier, endpoint, account, scope hash, creation time, current state, page sequence number, continuation token, cumulative counts, and last successfully committed page. Keep operational metadata separate from customer-facing catalog records. This separation makes it possible to inspect a failed attempt without accidentally presenting its staging data as authoritative.
Commit data and progress together
For each page, validate the response, normalize records, and write them to a run-specific staging area. Advance the checkpoint only after the records and their identifiers are durably stored. Ideally, use one database transaction for both actions. If the architecture cannot support a single transaction, use an idempotent page ledger and explicit reconciliation to avoid recording progress that the database never actually committed.
A safe retry may request the last uncommitted page again. Therefore, processing must tolerate replay: use deterministic keys, upserts with version checks where supported, and a page-attempt history. Do not assume a response can be replayed forever, because the supplier may expire its token or change the collection. The checkpoint proves local durability; it cannot create upstream snapshot guarantees.
Choose a defensible resume point
Resume with the exact continuation token attached to the last committed page, under the original scope and identity, if the supplier allows it and the token is still valid. If the worker crashed after storing records but before acknowledging the checkpoint, replay the page through the deduplication path. If the state cannot be reconciled, mark the run incomplete and start a fresh enumeration rather than guessing which page should follow.
Maintain a bounded history of token fingerprints and page transitions for diagnostics. Store raw tokens only in appropriately protected operational storage, because they may carry sensitive implementation context. A repeated token, self-referential next URL, or circular transition may indicate a supplier fault or client bug. Stop and alert rather than allowing an infinite loop to consume API quota.
Measure Page Progress Separately from Record Coverage
Page counts and record counts answer different questions. A page count indicates how many responses were processed, while a record count describes the volume of data encountered. A supplier can return a short page, an empty page with a continuation, or several pages containing the same identifier. Consequently, dividing records by the requested page size is not a sound way to infer the number of remaining pages.
Track pages requested, pages accepted, raw records received, unique identifiers staged, duplicates observed, invalid records rejected, retries, and terminal conditions. Keep supplier-reported totals in a separate field, along with their documented meaning. A total might be optional, estimated, filtered, or measured at a different moment. Never convert it silently into an exact completeness guarantee.
| Signal | What it establishes | What it cannot establish alone |
|---|---|---|
| Accepted pages | Validated page responses reached staging | That the collection was fully traversed |
| Raw record count | Number of items received, including repeats | Number of distinct supplier records |
| Unique identifiers | Distinct keys observed in the current run | That no records were skipped upstream |
| Duplicate count | Repeated keys needing reconciliation | That the supplier made an error |
| Documented terminal signal | Traversal ended according to the interface | Snapshot isolation or deletion authority |
| Reconciliation status | Local validation and publish checks passed | Unpromised guarantees about source consistency |

Interpret differences instead of hiding them
If the raw count exceeds the unique count, investigate whether records legitimately repeat across pages, represent updates, or reveal unstable ordering. If unique coverage drops sharply compared with the previous accepted run, flag the difference even when the supplier indicates that traversal has ended. Catalogs do change, but an abrupt reduction warrants evidence before destructive action.
Schema validation should distinguish mandatory identity and routing fields from optional descriptive content. A record missing a stable key must not be silently assigned a guessed identity. A record with an absent optional image may still be usable if the business rules allow it. Report both categories separately so a rising parse success rate does not conceal deteriorating catalog usefulness.
Set thresholds relative to catalog size and business sensitivity, not as universal magic numbers. A small optional-category feed may naturally fluctuate more than a large hotel master catalog. Record which rule caused a run to be accepted, warned, or quarantined. A complete local processing loop with poor data quality is still a poor source for publication.
Recover from Interruptions Without Inventing Progress
Failures occur at different boundaries: before a request is sent, after a supplier responds, during response parsing, while writing a page, or immediately after committing it. The recovery rule depends on that boundary. A generic retry wrapper that restarts requests without examining durable state can introduce both gaps and double processing.
Retry transient network failures and documented retryable server responses with bounded attempts, jitter, and any supplier-provided rate-limit guidance. Do not treat every client error as transient. A malformed token, unauthorized scope, or incompatible filter usually needs a different path from temporary server overload. Preserve the request ID and error classification so engineers can reproduce the actual failure.
Recognize expired and unusable continuations
Token expiry deserves an explicit policy. Google AIP-158 allows page tokens to expire, but its design guidance does not define an expiry period for every third-party service. A token may become invalid while a worker is paused or after prolonged backoff. Check the supplier's documented error codes and expiry rules; do not infer expiry simply because a request failed once.
If a token cannot be resumed, stop that run and record its partial status. Restart from the beginning when the endpoint supports a safe fresh enumeration, or use a documented recovery operation where available. Never manufacture the next token or jump ahead by estimating an offset from page counts. Keep partial records isolated until the replacement run satisfies its own publication checks.
Handle changing collections carefully
Even uninterrupted cursor traversal can observe a moving catalog. A property might be added, removed, or revised between page requests. Stable cursor syntax alone does not establish point-in-time snapshot isolation. Unless the supplier explicitly guarantees a snapshot, the run proves only that the client followed the documented traversal protocol, not that every item belonged to a single frozen version of the source.
Use documented snapshot IDs, export jobs, revisions, or change watermarks if offered. If none exists, consider reconciliation runs, supplier timestamps where reliable, or conservative acceptance rules. Report the remaining consistency limitation transparently. A well-engineered api solution can detect suspicious gaps and protect downstream records without claiming certainty it was never given.
Make Deletion a Separate, Evidence-Based Decision
Deletion is the highest-risk part of catalog reconciliation. A record missing from an interrupted sweep could simply be on an unfetched page. A record missing from a successfully traversed but non-snapshot feed might have moved between pages. Neither case authorizes a destructive delete. Design the deletion pathway as a separate decision gate with stricter conditions than ordinary updates.
For a supplier that contractually provides complete, consistent snapshots of a defined scope, compare the validated new snapshot's identifiers against the previous accepted snapshot. Items absent from the new complete snapshot can then enter a removal workflow, subject to supplier-specific deletion semantics and business rules. Prefer soft deletion or temporary unpublishing first when customer reservations, mappings, or content dependencies may still reference those identifiers.
Distinguish incremental changes from full inventories
Incremental endpoints describe changes, not necessarily the complete current catalog. Reaching the final page of a change feed means the fetched change sequence ended under its documented semantics; it does not mean that every unchanged record has been seen. Therefore, never delete all existing items absent from an incremental response. Apply explicit delete events or tombstones only if the supplier documents them and their ordering semantics.
When change feeds provide a watermark, persist it at the correct commit boundary and honor the stated inclusion or overlap rules. If a gap is suspected, use a documented replay or full-reconciliation method rather than treating the newest timestamp as a repair. A watermark is progress through change history, not automatic proof that the current inventory is exhaustive.
Maintain a deletion audit trail containing supplier scope, accepted snapshot IDs where applicable, evidence of completeness, reconciliation counts, proposed removals, approval policy, and final action. Quarantine any run whose scope changed, terminal evidence is missing, or consistency guarantees are unverified. The default under uncertainty should preserve previously trusted listings while visibly marking their freshness status.
Worked Hypothetical Example: A Tour Activity Catalog
The following scenario is illustrative and describes no real supplier. An imaginary activities provider offers a documented full-export endpoint with opaque continuation tokens and a snapshot identifier that remains fixed for the export. Its contract explicitly guarantees that a successfully completed export covers all active activities for one selected market as of that snapshot. Those hypothetical guarantees are necessary for the deletion decision below; they should not be assumed for other APIs.
A travel platform begins run R-204 for the fictional market WEST, language en, and status active, requesting up to 100 records per page. Page one returns 100 records, snapshot S-51, and token T-A. Page two returns 100 records and token T-B, but two activity IDs have already appeared on page one. The client stages both pages and counts 200 raw records but only 198 unique IDs.
The third request using T-B times out before any response is committed. The run remains incomplete, with two committed pages and the untouched continuation T-B. The worker retries according to policy, receives 60 records and an explicit terminal indication defined by this imaginary endpoint, and stages them. Three IDs on page three were already seen, so the final totals are three accepted pages, 260 raw items, five duplicates, and 255 unique activities.
The platform validates the common snapshot ID on every accepted page, confirms that all required fields passed validation, and checks that the supplier's documented terminal condition was reached. It then compares these 255 IDs with 258 IDs in the previous accepted snapshot for exactly the same scope. Four old IDs are absent and one ID is newly present, yielding the net difference of three. This is a comparison between two provably complete hypothetical snapshots, not an inference from a page-count estimate.
Because the example's contract grants full snapshot coverage, the four absent IDs may be queued for the platform's controlled unpublish process. They are not immediately hard-deleted: operations checks references, retains audit evidence, and applies the local retention policy. If page three had failed permanently, the new run would remain quarantined and none of those missing IDs could be treated as deleted. If the endpoint were incremental instead, this absence comparison would be invalid even after its final page.
Operate the Synchronization as an Auditable Service
Reliable operation requires observability that reflects correctness, not just throughput. A dashboard should distinguish running, paused, retrying, incomplete, quarantined, validated, and published runs. Show last successful publication time separately from last API contact. A supplier may be reachable while its latest catalog refresh is unusable.
Alert on overdue completion, token loops, repeated invalid pages, unusually low unique counts, excessive duplicates, unexpected schema changes, and deletion candidates above the agreed review threshold. Include the supplier, scope fingerprint, run ID, safe error category, and checkpoint position in diagnostic events. Avoid logging raw credentials or exposing continuation tokens in routine application logs.
Test failure paths before launch
Exercise response loss, empty nonterminal pages, duplicate IDs, changing filters, token expiry, worker restart after a partial commit, and a missing terminal signal. Confirm that reruns do not double-publish entries and that an incomplete sweep cannot trigger removals. Test a supplier-reported total that differs from observed unique records without assuming either value must be universally exact.
Schedule refreshes to respect documented supplier quotas, but avoid overlapping writers for the same catalog scope unless the merge strategy explicitly supports concurrency. Use a run-level lease or equivalent coordination, with fencing against an old worker publishing after its lease ends. Parallelism across independent scopes may improve throughput, yet it should never permit one scope to inherit another scope’s cursor or checkpoint.
Document a recovery playbook for operators: identify the affected scope, examine the last durable checkpoint, classify the error, choose resume or restart according to contract, compare reconciliation metrics, and authorize publication only after validation. The playbook should explicitly prohibit manual cursor manipulation or deletion based solely on absence from an uncertain run.
Build Reliability into the Publishing Boundary
Separate collection, validation, and publication. Working data belongs in staging until the run has passed protocol checks, quality gates, and any required consistency checks. Downstream search and booking systems should continue using the last accepted catalog or a defined degraded mode while refresh status remains uncertain. Publishing each page directly may be appropriate for some documented incremental workflows, but it needs different guarantees and must not be presented as an atomic full refresh.
For TravelTech365-style travel platforms, the practical goal is traceability from the supplier request to the listing a traveler sees. A sound api solution can explain which scope was requested, which continuation chain was followed, which records were accepted, why a run was considered complete, and what evidence authorized any removal. It cannot substitute local confidence for supplier guarantees.
Design from the supplier's documented semantics, preserve every durable boundary, and treat uncertain completeness as a first-class state. That combination keeps catalog refresh recoverable during outages, makes duplicates and gaps visible, and prevents a temporary pagination failure from becoming permanent catalog loss.
