Skip to main content

Error Classes

Common status codes


Retry Behavior

The SDK automatically retries on 429 (rate limit) and 5xx (server error): Non-retryable errors (4xx except 429) fail immediately. There is no point retrying a 404 or 422.

Example timing

With default settings (500ms base, 3 retries):
  • Attempt 1: immediate
  • Attempt 2: ~500ms delay
  • Attempt 3: ~1000ms delay
  • Attempt 4: ~2000ms delay
  • After attempt 4: throws RetryExhaustedError

Recovery Patterns

Idempotent retries

For creation endpoints, always use an idempotency key so retries are safe:

Handling rate limits

The SDK handles 429 automatically. If you need custom logic:

Handling state conflicts

Settlement operations may return 409 when the settlement has moved to a different state: