Dunning and Retry Engine

Classify a decline, then hard-fail or schedule a backoff retry until recovered or exhausted

Dunning and Retry Engine Classify a decline, then hard-fail or schedule a backoff retry until recovered or exhausted 01 / Billing Service 02 / Retry Engine EX / Terminal States Attempt Classify Recover Charge · recurring invoice · Billing Service › Attempt Charge recurring invoice Gateway Result · decline code · Retry Engine › Attempt Gateway Result decline code Classify · hard vs soft · Billing Service › Classify · policy table Classify hard vs soft policy table Schedule · backoff + budget · Retry Engine › Recover Schedule backoff + budget Retry · token refresh · Billing Service › Recover Retry token refresh Recovered · post to ledger · Retry Engine › Recover Recovered post to ledger Dunning · notify + cancel · Terminal States › Classify Dunning notify + cancel Exhausted · budget spent · Terminal States › Recover Exhausted budget spent declined soft success hard max retries Legend User UI Agent logic Policy Tool action Context / trace

Classification first

  • • Normalize processor codes to one taxonomy
  • • Hard declines cancel, never retry
  • • Unknown codes get one cautious retry

Retry discipline

  • • Backoff aligned to the decline reason
  • • Per-instrument retry budget caps attempts
  • • Refresh token before consuming an attempt
  • • Stable idempotency key per attempt