Tips

Marketplace Third-Party Integrations Without Slowing Transactions

Keep third-party integrations in a marketplace from slowing transactions: move work off the critical path, cache, use circuit breakers, measure p95 latency.

The reliable way to handle third-party integrations in a marketplace without degrading transaction speed is to move every request to a third-party service off the critical path unless the transaction cannot complete without it. The critical path is the chain of steps that must finish before the buyer sees a confirmation. Cache what changes slowly, tolerate partial failure, and measure the latency you actually create.

Where marketplace transaction latency actually comes from

Latency is the delay between sending a request and receiving a response. An API (application programming interface) is a defined way for one system to ask another for data or an action. A single checkout in a typical marketplace touches five to seven external APIs: a payment gateway, a fraud check, tax calculation, a shipping rate lookup, an inventory check, and a receipt email. Each API adds one request-response round trip and its own processing time.

Estimated, a well-run third-party API replies in 150 to 300 milliseconds from inside your network. A checkout that calls four services in series, one after another, waits for each response before sending the next request, so the buyer waits roughly one extra second before anything has failed. If a service times out, that wait can stretch to five or ten seconds, because most clients wait the full timeout period before giving up. A timeout is the maximum time you are willing to wait for a response before treating the request as failed.

Two structural facts make this worse. First, most marketplaces are multi-tenant, meaning one codebase serves many separate seller shops, so a slow integration hurts every shop at once. Second, third-party services you do not control can degrade without warning. The design has to assume latency and failure rather than treat them as exceptions.

How do you keep third-party requests off the critical path?

Move every integration not needed to confirm the order into an asynchronous queue, a buffer for work a background worker will handle. The buyer never waits on it. Only payment and fraud stay synchronous, waiting for their reply.

Asynchronous processing means the original transaction does not wait for the slower operation. A background worker is a separate process that reads messages from the queue and performs the work. The practical steps are:

  1. List every integration your marketplace talks to.
  2. Classify each as required to approve the order or only required after the order exists.
  3. Keep the required ones synchronous: payment authorization and fraud scoring normally belong there.
  4. Move the rest to a queue: receipt email, invoice generation, tax document creation, shipping label requests, inventory deduction in the seller's system, and analytics events.
  5. Add retry logic with exponential backoff, meaning each retry waits longer than the previous one, so you do not hammer a recovering service.
  6. Give each queued message an idempotency key, so the same operation can be repeated safely without creating duplicates.

Estimated, this single change removes 60 to 80 percent of the external latency the buyer feels, because most marketplaces only need two synchronous integrations per order. The pattern fits the way we structure marketplace projects, where the queue is part of the base architecture rather than an afterthought.

When should you cache third-party responses?

Cache responses when data changes slowly and stale data costs little. Product descriptions, shipping rate tables, tax rate lookups, and currency conversions qualify. Cache by the exact request and refresh before it becomes too old.

A cache is a fast local copy of data that was originally fetched from a slower source. Caching works when the third party's answer stays valid for minutes, hours, or days. Shipping rates from a carrier, for example, rarely change during a single day for most sellers. Tax tables change less often.

Set a time-to-live (TTL), the maximum age a cached value is allowed to reach. Use ten to thirty minutes for shipping rates and one to twenty-four hours for tax lookups. Use stale-while-revalidate, a pattern that serves the last known good value immediately while fetching a fresh one in the background. Estimated, a well-chosen cache can drop p95 checkout latency from 350 milliseconds to under 80 milliseconds on repeat requests.

Never cache payment authorization, balance checks, or fraud scores. Those answers are decisions, not data. Caching a decision means accepting a risk you cannot see.

Which integrations should stay synchronous?

Only the ones whose answer changes the transaction. Payment authorization, card network checks, and risk or fraud scoring decide whether the order can happen at all. Everything else is a consequence of the order, not a condition for it.

IntegrationCan it run after the order?Stale data riskRecommended mode
Payment authorizationNo, the charge must be approved firstCaching a charge decision is a financial riskSynchronous
Fraud scoringOnly if you accept the riskFraud decisions age within secondsSynchronous, with a short cache per checkout
Tax calculationDepends on the jurisdictionChanges slowly for most regionsCache with TTL, refresh in background
Shipping rate lookupYes, if you lock the rate at checkoutRates can expire before label purchaseAsynchronous with fallback to cached rates
Inventory deductionYes, if you hold the stockDouble selling is the main riskAsynchronous with idempotency key
Email receiptYesLowAsynchronous

The general rule: if an integration produces a decision, keep it synchronous. If it produces a record or a message, make it asynchronous. If it produces data the buyer can see a few minutes late, cache it.

What happens when the third-party service fails?

Treat failure as a normal state and route around it. A circuit breaker opens after repeated errors, so the marketplace stops calling a failing service. The transaction completes with a fallback value, and the failed work is recorded for retry.

A circuit breaker is a pattern that stops calls to a service after a set number of failures, giving the service time to recover before normal traffic resumes. Every integration needs a fallback value, the safe default you use when the third party is unreachable. For shipping, the fallback is the last cached rate marked as estimated. For tax, it is the rate from the previous successful lookup. For inventory, it is to accept the order but flag it for manual confirmation.

Build the retry path separately from the request path. When a background worker finally succeeds, a webhook, an HTTP call the third party makes to your server when something happens, can update the order. Messages that still fail after roughly five attempts go to a dead letter queue, a holding area where a human can inspect and replay them. One broken provider then never blocks a transaction.

How do you measure whether integrations slow down transactions?

Instrument every step of the transaction with a timestamp. Compare time spent inside your own code with time spent waiting on third parties. Track p95 latency, the time within which 95 percent of transactions complete, and error rate per integration.

Instrumenting means adding a timestamp at the start and end of each step so the investigation is exact rather than guessed. The metrics that matter:

  • p95 and p99 latency per integration. p99 is the time within which 99 percent of transactions complete.
  • Error rate per integration, counted as a percentage of all calls.
  • Timeout rate, the share of requests that exceed your configured timeout.
  • Queue depth, how many messages are waiting in each asynchronous queue. A growing queue means the slowdown has only moved.
  • Checkout completion rate before and after any integration change.

Set a budget before you integrate. A common baseline is a checkout that completes in one second, with p95 under two seconds. If an integration cannot fit inside that budget, it does not go on the critical path.

Frequently asked questions

Which marketplace integrations can run asynchronously?

Any integration that does not produce a decision needed to approve the order can run asynchronously. Email receipts, invoice generation, shipping label requests, and inventory syncing are typical candidates. Payment authorization and fraud scoring stay synchronous because their answer changes whether the transaction should happen.

How do you reduce third-party API latency at checkout?

Move non-critical integrations off the critical path into a queue, and cache slow-changing data such as shipping rates and tax tables. Set realistic timeouts so a failing service cannot stall the transaction, and use circuit breakers with fallbacks. Estimated, these changes remove most of the waiting a buyer experiences during checkout.

What should you do when a third-party API is down during a marketplace transaction?

Open the circuit breaker after repeated errors so the marketplace stops calling the failing service, and complete the transaction with a fallback value. Run the failed work again in the background and flag high-risk cases for manual review. The order should not be blocked by an integration that only produces a record.

Which metrics show if integrations are slowing down a marketplace?

Track p95 and p99 latency per integration, the error rate per integration, the timeout rate, and the depth of every asynchronous queue. A growing queue depth means work is piling up, so the slowdown has moved rather than disappeared. Also watch checkout completion rates before and after any integration change.

Back to blog