Skip to content
Web Development6 min read

API Integration Reliability: Timeouts, Retries, Idempotency and Reconciliation

Making API integrations reliable: timeouts, retries with backoff, idempotency keys, rate limits, circuit breakers, queues, reconciliation and observability.

01

How do you make API integrations reliable?

Set timeouts on every call, retry only transient failures with exponential backoff and jitter, make every data-changing operation idempotent so retries cannot create duplicates, respect rate limits, use circuit breakers for failing dependencies, move non-urgent work to queues with dead-letter handling, reconcile records between systems regularly, and monitor every integration. Retry logic without idempotency can double-charge customers or amplify an outage.

This guide is for developers and architects building integrations between business systems, payment providers, ecommerce platforms and partner APIs. For the wider integration picture in Australia, see API integration for Australian businesses.

02

Key takeaways

  • Every call has a timeout appropriate to the operation.
  • Retries are limited, backed off, jittered and only for transient errors.
  • Data-changing operations use idempotency keys.
  • Rate limits are respected, with queuing rather than hammering.
  • Circuit breakers protect your system from failing dependencies.
  • Reconciliation catches what reliability patterns miss.
03

Timeouts and retries

FailureRetry?Notes
Connection timeout or resetYes, with backoffOnly if the operation is idempotent
HTTP 429 rate limitedYes, after the indicated delayRespect Retry-After headers
HTTP 5xx server errorUsually, limitedSome 5xx are not transient; cap attempts
HTTP 4xx validation or auth errorNoFix the request or credentials
04

Idempotency

Send a unique idempotency key with each request that creates or changes data, and store results keyed by it on the server side. Payment providers document this pattern; Stripe, for example, supports idempotent requests so that retrying with the same key returns the original result (Stripe). For incoming webhooks, store processed event IDs and ignore repeats; see webhook design and payment gateway integration.

05

Rate limits, circuit breakers and queues

  • Track each partner's rate limits and pace requests below them.
  • Use circuit breakers so repeated failures fail fast and trigger fallbacks (martinfowler.com).
  • Put non-urgent work, such as syncing records or sending notifications, on queues.
  • Process queue messages idempotently; they may be delivered more than once.
  • Send repeatedly failing messages to a dead-letter queue with alerts and an owner.
  • Design for out-of-order messages using timestamps or version numbers.

Pro tip

Our recommendation: write down, for each integration, what happens if the other system is down for an hour. If the answer is 'we lose data' or 'customers are charged twice', fix that before adding features. See queue architecture.

06

Reconciliation

Schedule reconciliation jobs that compare key records between systems, such as orders in the store and the ERP, payments and payouts, stock levels, and invoices in accounting, and report differences to owners. Fix root causes, not just individual differences. Reconciliation is also your evidence that integrations work.

07

Observability

Give each integration request a correlation ID, log requests and outcomes without sensitive data, and track success rate, latency, retries, queue depth and dead-letter counts. Alert on sustained failures and growing backlogs, with runbooks. See application monitoring and observability.

08

Common mistakes

  • No timeouts, so threads hang on a slow partner.
  • Retrying payments without idempotency keys.
  • Unlimited immediate retries during an outage.
  • Dead-letter queues nobody watches.
  • No reconciliation, so silent failures accumulate.
10

Webhooks, polling or both

Webhooks push changes to you as they happen; polling asks the other system for changes on a schedule. Webhooks are faster and lighter but can be missed, duplicated or delivered out of order. Polling is simple and predictable but slower and uses more API calls.

ApproachUse whenWatch for
WebhooksThe provider supports them and freshness mattersSignature checks, duplicates, ordering, outages on your side
PollingNo webhooks, or changes are infrequentRate limits, 'updated since' accuracy, delay
BothImportant data must not be missedWebhooks for speed, scheduled polling or reconciliation as a safety net
11

Testing integrations with third-party services

Third-party APIs fail in ways your own code does not: sandboxes differ from production, rate limits change and responses drift. Test at several levels.

  • Unit tests with recorded responses for parsing and mapping logic.
  • Contract tests that check the fields and formats you depend on, run against the provider's sandbox on a schedule.
  • Fault injection for timeouts, 429 and 5xx errors, duplicate webhooks and out-of-order events.
  • End-to-end tests in sandboxes before releases; note where sandboxes behave differently from production.
  • Synthetic monitoring in production: a small, safe transaction or read checked regularly with alerts.
  • See automated regression testing and API versioning.
12

Conclusion

Reliable integrations assume failure: they time out, retry carefully, never duplicate actions, slow down when partners struggle, queue what can wait, and reconcile to catch the rest. Build these patterns in from the first integration, and monitor them like any other production system.

Integrations dropping or duplicating data?

ZSpace Labs is an India-based, remote-first technology studio working with Australian and international businesses on reliable integrations and automation. If it would help to review your integration failure modes, we are happy to talk it through.

Start a Project
FAQ

Common questions.

Because a request can succeed on the server while the response is lost, for example through a timeout. If the client retries without an idempotency key, the server processes it again, creating a duplicate order, payment or record. Idempotency keys let the server recognise a repeated request and return the original result instead of acting twice.

Get in touch

Have a project in mind?

Whether you're building a new digital product, improving an existing website, or looking to automate part of your business — let's talk.