Core Concepts

Recovery Cases

Every failed invoice payment creates a Recovery Case — the central object Savby uses to track the full lifecycle of a payment recovery attempt.

State machine

A Recovery Case moves through a defined set of states. All transitions are recorded in an immutable audit trail.

OPEN
RUNNING
PAUSED
RECOVERED|EXHAUSTED
OPEN

The case has been created following a payment failure. Actions are scheduled but not yet executing.

RUNNING

Actions are actively executing — charge retries are queued or in progress.

PAUSED

Execution has been temporarily halted, either by you or automatically.

RECOVERED

A retry attempt succeeded — the invoice has been paid and the revenue recovered.

EXHAUSTED

All retry attempts have been made without success, or the case was manually dismissed.

Action types

Each Recovery Case has a sequence of RecoveryAction records — the individual steps Savby executes to recover the payment:

RETRY_CHARGE

Savby calls stripe.invoices.pay() with a unique idempotency key. If the charge succeeds, the case moves to RECOVERED. If it fails, the action is marked failed and the next scheduled action takes over.

SEND_EMAIL

Savby sends a transactional email to the customer via Resend. For notify-only codes, this email contains a secure link for the customer to update their payment method.

MARK_MANUAL

Savby marks the case as requiring human intervention and transitions it to EXHAUSTED. Used for high-risk decline codes or when all retries have been exhausted.

Bulk actions

From the Payments dashboard you can select multiple cases and apply bulk actions:

ActionWhat it doesPermission required
RetryImmediately enqueues a RETRY_CHARGE for each selected caseOwner or Admin
DismissMarks selected cases as EXHAUSTED and sets resolvedAtOwner or Admin

Audit trail

Every state transition is recorded in an immutable RecoveryCaseAudit entry that captures the previous state, the new state, the reason for the transition, the actor (user ID or "system"), and a timestamp. This gives you a full history of every action taken on a case.