OuiPay
Transactions

Idempotency

Replay the same key safely; business retry is a new attempt under the same payment.

OuiPay separates HTTP replay from business retry. Both use durable keys; they mean different things (ADR 0020 sync/async boundary, ADR 0017 multi-attempt retry).

Replay (same idempotency key)

Send the same idempotency_key (body field on financial POSTs) with the same money/recipient payload after a network timeout or client retry.

  • The platform returns the original acceptance record.
  • No second wallet debit, collection, or biller purchase.
  • A different payload with the same key returns 409 IDEMPOTENCY_PAYLOAD_MISMATCH.

Replay is safe precisely because acceptance is recorded before the HTTP response — not because the provider has finished.

Business retry (new attempt)

When a collection attempt fails in a retryable way, call POST /api/v1/payments/{id}/retry with a new idempotency key for that retry request. That creates attempt #N under the same payment (platform transaction), not a brand-new payment history row.

Do not call POST /payments/initiate again for “pay again” on the same customer intent — that would mint an unrelated payment.

Ambiguous outcomes

If the sync path returns pending / processing / unknown, or the client timed out after submit:

  1. Requery status (GET payment/transaction) or wait for webhooks.
  2. Never blindly re-submit the same provider purchase.
  3. Platform sweeps (payments:requery-stale, service-order requery) resolve callbacks that never arrived.

Accept ≠ complete: a 201/202 with pending status means the platform accepted the operation; fulfilment and settlement may still be in flight.