SavaPay Developers

Errors and retries

Handle API failures predictably, retry safely, and preserve the information needed for support.

BuildNode.js and ExpressApproved merchant pilot
Browse developer documentationErrors and retries

SavaPay returns a stable machine-readable code so your server can choose a safe response without relying on message wording.

Error response

Response
{
  "success": false,
  "code": "idempotency_conflict",
  "error": "The idempotency key was used with different request data"
}

Log the HTTP status, error code, affected resource, and response correlation ID. Never add API keys, webhook secrets, or customer credentials to your logs.

How to respond

CodeHTTPSafe action
invalid_request400Fix the request. Do not retry unchanged input.
authentication_required401Check the server-side API key before retrying.
forbidden403Check key permissions and merchant activation.
not_found404Confirm the resource ID belongs to this merchant.
idempotency_conflict409Do not reuse the key with different request data.
invalid_state409Fetch current status before choosing the next action.
rate_limited429Wait, then retry with bounded exponential backoff.
internal_error500Retry safely; preserve the idempotency key on writes.

Retry policy

  • Retry connection failures, timeouts, rate limits, and temporary server errors.
  • Use exponential backoff with a maximum attempt limit.
  • Keep the original idempotency key for every retry of a write.
  • Add random delay so many workers do not retry at the same moment.
  • Do not automatically retry invalid requests, missing resources, or permission errors.
  • Reconcile payment status when the final outcome remains uncertain.

Next

Exercise the recovery paths

Test duplicate requests, invalid signatures, cancellations, and refunds with the: Sandbox checklist

Maintained byPayments Engineering

Last reviewed

Was this page helpful?