Idempotency¶
Networks fail. If your request times out you can't tell whether the payment was created, so you retry. An idempotency key makes that retry safe: the same key always returns the same payment.
- The
Idempotency-Keyheader is required onPOST /v1/payments. Requests without one get400 VALIDATION_ERROR. - The SDKs generate a random UUID for you, which protects retries within one process.
- To stay safe across restarts and deploys, pass your own key tied to your order, such as
order_1042. - Sending a key that was already used returns the original response again, without creating a second payment. Use a new key for a genuinely new payment.
- If a request with the same key is still in progress, you get
409 CONFLICT. Wait and retry.
Webhooks are at-least-once¶
The same idea applies to webhooks. Oura may deliver an event more than once, so your handler must be idempotent: check whether the order is already paid before you mark it paid.