---
path: /learn/payout-api-idempotency-retries/
title: "Payout API idempotency: retries without duplicate payments"
description: Prevent duplicate payouts with scoped idempotency keys and durable payment records. Use a retry decision table to handle timeouts and server errors safely.
image: /images/opengraph/og-learn.png
publishDate: 2026-11-18
updatedDate: 2026-11-20
keywords: payout API idempotency, payout API retries, idempotency keys, duplicate payouts, payment retry backoff
label: Payments
timeToRead: 8
faq:
  - question: What is a payout API?
    answer: A payout API lets an application create outgoing payment instructions and track their outcomes. Acceptance of a request does not prove that the recipient has received the funds.
  - question: What is an idempotency key in a payout API?
    answer: An idempotency key identifies repeated submissions of the same operation. Within the API's documented scope and retention window, retrying an identical request with the same key should return the existing operation rather than create another payout.
  - question: Is a payment reference the same as an idempotency key?
    answer: No. A payment reference connects a transfer to a business record. An idempotency key controls duplicate request processing, and reusing a reference alone does not prevent another transfer.
  - question: Should a payout be retried after a timeout?
    answer: Treat a timeout as an unknown outcome. Look up the existing payout or submitted transaction before creating another instruction, and reuse the original key and payload when the provider's retry contract permits it.
  - question: Does a successful stablecoin transaction prove bank delivery?
    answer: No. Verify the expected recipient transfer for the onchain leg. If the payout continues through an off-ramp, track the provider's bank-delivery status separately.
  - question: How should payout API retries use exponential backoff?
    answer: Use capped exponential backoff with jitter only for retryable errors, and honor the API’s documented retry delay. Keep the original idempotency key and payload when replay is supported. Backoff alone does not prevent duplicate payouts.
heroTitle: "Payout API idempotency: retries without duplicate payments"
seoTitle: "Payout API idempotency: retry without duplicate payments"
socialTitle: "Payout APIs: how to retry without paying twice"
primaryQuery: payout API idempotency
locale: en
canonical: https://tempo.com/learn/payout-api-idempotency-retries/
---

# Payout API idempotency: retries without duplicate payments

> **Docs:** [Documentation index](https://tempo.com/developers/llms.txt)
>
> **Site:** [All tempo.com pages](https://tempo.com/llms.txt)

_Payout API idempotency prevents repeated requests for one operation from creating duplicate payouts within the API’s documented scope and retention window. After a timeout, resolve the original attempt and reuse its key and payload only when the retry contract permits it. This guide covers that workflow above the settlement layer described in [cross-border payments on Tempo](/solutions/cross-border-payments/)._

Suppose a [marketplace payout](/learn/marketplace-payouts/) worker sends an approved seller payment. Its worker submits the instruction, but the connection drops before the response arrives. The payment might already be processing. Sending the same amount under a new request identifier can pay the seller twice.

## What is payout API idempotency?

Payout API idempotency prevents repeated requests for one operation from creating duplicate payouts within the API’s documented scope and retention window. A payout API creates outgoing payment instructions and tracks their outcomes, whether it coordinates bank delivery or submits a stablecoin transfer.

The API response confirms a particular stage of processing. An accepted instruction can still be awaiting execution or delivery. Define those stages in your application rather than displaying every successful HTTP response as a completed payout.

### Payment references vs. idempotency keys

A payment reference answers which obligation a transfer belongs to. An idempotency key tells an API that a repeated request belongs to an existing operation. Keep their roles separate even if your application derives both from a payout ID.

|Identifier|What it identifies|Where to keep it|
|-|-|-|
|Business payout ID|One approved obligation|Application ledger|
|API idempotency key|Repeated requests for one operation|Request record|
|Payment reference|A transfer's business association|Transfer and ledger|
|Transaction hash|One submitted blockchain transaction|Submission attempt|
|Transfer event key|One observed transfer|Receipt processing record|

A batch can contain several transfers under one transaction hash. A [transfer memo](/learn/transfer-memos/) can identify each payout within it, but a memo does not enforce uniqueness or prove delivery.

## Design the payout API request contract

Scope an idempotency key to the authenticated business and operation, such as creating a payout. Store a canonical representation or fingerprint of the validated request with the key. Include the destination and amount. Bind the asset to its exact network and token contract rather than a ticker alone.

For an illustrative API you operate, define the contract as follows:

- **Same key and payload.** Return the existing payout ID and its documented response. Do not enqueue another payment.
- **Same key with changed details.** Reject the request as a conflict. Require an explicit correction workflow.
- **Concurrent submissions.** Enforce a database uniqueness constraint on the scoped key so only one request can create the operation.
- **Expired request records.** Preserve the business payout record after the request cache expires. An expired key must not silently authorize paying the same obligation again.

Also enforce one durable payout record per approved obligation within each business, with an atomic dispatch guard. A new key must resolve to that record rather than release the obligation again.

Provider rules differ. Public [idempotent request documentation](https://docs.stripe.com/api/idempotent_requests) illustrates parameter matching and key retention. Read your provider's exact retry rules, including whether failed responses are cached. Do not assume that every payout API implements the example above.

Persist the payout and a durable dispatch job in one database transaction. A transactional outbox is one way to avoid saving an accepted payout without saving its work item. A worker should claim the operation before dispatch and preserve the provider key across job restarts.

That database transaction cannot also commit a remote payment atomically. Record the external attempt before dispatch where possible. For a signing flow, persist the signed transaction and its hash before broadcast. If a crash leaves the remote result uncertain, recovery must reconcile that attempt rather than create a fresh one.

### Example of an idempotent payout request

For an API you operate, a request might look like this. The endpoint and fields are illustrative, not a provider contract.

```http
POST /payouts
Idempotency-Key: seller-payout-1042-v1
Content-Type: application/json

{"payout_id":"seller-payout-1042","destination_id":"seller-88","amount_minor":12500,"currency":"USD"}
```

If the response is lost, first query the saved operation. If its retry contract allows replay, send the identical body with the original key. Both requests must resolve to one payout ID. Generate and persist the key before entering a retry loop, including when an SDK also retries requests. Changing `amount_minor` under that key must fail without another dispatch. For stablecoin instructions, also bind the exact network and token contract.

## Decide when a payout API retry is safe

A timeout means the outcome is unknown, not that the payout failed. Use the provider's documented status and retry contract to choose an action. HTTP codes alone do not prove whether funds moved.

|Observed outcome|Recovery action|Key handling|
|-|-|-|
|Accepted or pending payout|Monitor the existing payout|Do not create another instruction|
|Connection timeout or lost response|Query the original attempt, replay only if supported|Keep the original key and payload|
|Rate limit, such as HTTP 429|Honor the retry delay and documented retry rules|Keep the original key and payload|
|Server error, such as HTTP 500|Reconcile first, the result can be uncertain|Do not switch keys to bypass a cached error|
|Validation error or key conflict|Correct the cause through a controlled workflow|Do not blindly replay changed details|
|Definitively failed payout|Authorize recovery after ruling out a live attempt|Follow the provider's recovery contract|

An empty transaction lookup is not proof that a submission cannot settle. If you cannot establish a terminal result, leave the payout unresolved for review. A polling deadline must not release the obligation for another payment. Keep the business payout state separate from submission attempts.

### Exponential backoff with jitter

For retryable errors, increase the delay after each attempt and cap it. Jitter adds randomness so workers do not all retry together. One illustrative full-jitter schedule chooses a random delay between zero and the smaller of 30 seconds or `1 second × 2^attempt`, starting at attempt zero.

Honor `Retry-After` when the API documents it, including its date or delay format. Do not retry earlier than that deadline. Set a total retry deadline within the provider's key-retention window and send exhausted attempts to an operator. If that window has expired, reconcile against the durable payout record before authorizing recovery. Backoff controls request load, while idempotency and reconciliation control duplicate-payment risk.

## Verify stablecoin payout delivery

Blockchain settlement gives the application an independently inspectable receipt, but the application must verify what the receipt contains. Check the network and exact token contract. Match the recipient and amount, then confirm that the expected transfer succeeded.

Distinguish repeated notifications from repeated payments. Store a unique transfer-event key, such as the network plus transaction hash and log index, atomically with the ledger update. Reprocessing the same event must not book another payout. If a provider supplies events, deduplicate its event IDs and reconcile with its current payout record.

For [batch payments](/learn/batch-payments/), choose the failure boundary before submission. An atomic batch and a run of independent payments require different recovery rules. Do not resend successful recipients because another item failed.

Keep onchain delivery separate from bank delivery. An off-ramp can introduce conversion or local banking delays. Banking hours and capital controls still apply to the relevant fiat leg. The [payment reconciliation guide](/learn/payment-reconciliation/) covers connecting payment evidence to accounting records.

## Test the retry workflow before release

Exercise failure paths against a test environment before sending real funds.

1. **Replay a request.** Send identical requests concurrently and confirm they resolve to one payout. Change the amount under the same key and confirm rejection.
2. **Interrupt dispatch.** Stop the worker before and after broadcast. Confirm recovery inspects the existing attempt without issuing a new payment.
3. **Replay delivery events.** Process the same transfer notification twice. Confirm only one ledger update occurs.
4. **Test incomplete delivery.** Simulate a held transfer or delayed bank payout. Confirm the application does not mark the obligation delivered or retry it automatically.
5. **Test retention expiry.** Expire the request cache and resubmit an old obligation. Confirm durable payout records still prevent another release.

## Where Tempo fits

Tempo is a blockchain designed for stablecoin payments, providing an onchain settlement layer beneath an application's payout API.

- **Payment references.** TIP-20 supports a 32-byte memo. The [payment references documentation](https://tempo.com/developers/docs/guide/payments/transfer-memos) explains encoding and indexed memo lookup. Memos are public, so use opaque IDs rather than personal details.
- **Atomic batches.** Several payment calls can share one transaction. The [batch payment documentation](https://tempo.com/developers/docs/guide/payments/send-a-payment#batch-payment-transactions) specifies that a reverting call reverts the whole batch.
- **Delivery evidence.** The [delivery verification guide](https://tempo.com/developers/docs/guide/payments/send-a-payment#confirm-delivery) explains receipt checks. A successful transaction can still redirect funds to a receive-policy guard instead of the intended recipient, so verify the actual transfer.

Your application remains responsible for idempotency and payout approvals. It must also reconcile outcomes and any downstream bank delivery. Start with the linked payment documentation, then test the recovery cases above before accepting production payouts.

## FAQ

The following answers summarize the request and delivery rules for a payout integration.

### What is a payout API?

A payout API lets an application create outgoing payment instructions and track their outcomes. Acceptance of a request does not prove that the recipient has received the funds.

### What is an idempotency key in a payout API?

An idempotency key identifies repeated submissions of the same operation. Within the API's documented scope and retention window, retrying an identical request with the same key should return the existing operation rather than create another payout.

### Is a payment reference the same as an idempotency key?

No. A payment reference connects a transfer to a business record. An idempotency key controls duplicate request processing, and reusing a reference alone does not prevent another transfer.

### Should a payout be retried after a timeout?

Treat a timeout as an unknown outcome. Look up the existing payout or submitted transaction before creating another instruction, and reuse the original key and payload when the provider's retry contract permits it.

### Does a successful stablecoin transaction prove bank delivery?

No. Verify the expected recipient transfer for the onchain leg. If the payout continues through an off-ramp, track the provider's bank-delivery status separately.

### How should payout API retries use exponential backoff?

Use capped exponential backoff with jitter only for retryable errors, and honor the API’s documented retry delay. Keep the original idempotency key and payload when replay is supported. Backoff alone does not prevent duplicate payouts.

---

## Site links

- [Tempo home](/)
- [Privacy policy](/privacy-policy/)
- [LinkedIn](https://www.linkedin.com/company/tempo)
- [X](https://x.com/tempo)
- [YouTube](https://www.youtube.com/@tempo)

### Products

- [Earn](/earn/)
- [Routes](/routes/)
- [Zones](/zones/)

### Solutions

- [Agentic payments](/solutions/agentic-payments/)
- [Credit](/solutions/credit/)
- [Cross-border payments](/solutions/cross-border-payments/)
- [Institutional settlement](/solutions/institutional-settlement/)
- [Stablecoin accounts](/solutions/stablecoin-accounts/)
- [Tokenized deposits](/solutions/tokenized-deposits/)

### Developers

- [Documentation](/developers)
- [Tempo Explorer](https://explore.tempo.xyz/)
- [Tempo API](/developers/docs/api)
- [Performance](/developers/docs/protocol/blockspace/overview)
- [Status](https://status.tempo.xyz/)
- [GitHub](https://github.com/tempoxyz)

### Resources

- [Blog](/blog/)
- [Customers](/customer-stories/)
- [Learn](/learn/)
- [OUSD](/ousd/)
- [Partners](/partners/)
- [Reports](/reports/)
- [Stablecoin Advisory](/stablecoin-advisory/)

### Company

- [About](/about/)
- [Careers](/careers/)
- [Brand kit](/brand/)
- [FAQ](/faq/)
