Skip to main content
This page explains the concepts. To turn it on step by step, follow the dunning setup guide.

Automated Payment Recovery

Dunning campaigns automate failed payment recovery through multi-step communication sequences. When a payment fails, Recurso executes your configured steps — sending emails, SMS messages, and optionally activating a payment wall.
  • Multi-channel sequences — Combine email, SMS, and payment wall steps
  • Configurable timing — Set day offsets for each step relative to the failure date
  • Payment wall — Block access with configurable grace periods
  • Custom templates — Use your own email/SMS templates or inline content
  • Default campaigns — Automatically apply to all failed payments
Dunning campaigns handle customer communication. For optimizing retry timing, see Smart Payment Retry, which uses reinforcement learning to determine when to retry the actual payment.

Campaign Lifecycle

Create a Campaign

Campaign Parameters

The campaign is a container; the recovery behaviour (including the payment wall) lives on its steps, added next.

Add Campaign Steps

Build your recovery sequence by adding steps at specific day offsets. A step can also raise the payment wall by setting is_payment_wall: true (independent of channel). Each step fires delay_hours after the trigger event. POST /v1/dunning-campaigns/{id}/steps:
1

Hour 0: immediate email

2

Day 3: follow-up SMS

3

Day 5: urgent email from a template

4

Day 7: raise the payment wall

Steps execute in step_order, escalating from a gentle reminder to a hard payment wall. If the invoice is paid at any point, the campaign stops immediately and any remaining steps are canceled:

Step Parameters

Payment Wall

The payment wall blocks customer access until payment is resolved. Customers are redirected to a payment page instead of your application.

Check Payment Wall Status

Manage Campaigns

List and Get Campaigns

Update Campaign and Steps

Execution Tracking

Every step execution is logged with its status for monitoring and debugging.

Recovered Revenue

Recurso attributes revenue back to the recovery machinery: whenever an invoice is paid after at least one failed payment attempt (or while an active dunning action or campaign was driving it), a recovery record is written with the amount, the number of attempts it took, the strategy that was in effect, and how many days the invoice took to recover.
  • Qualification — paid on the first try counts as nothing recovered; at least one failed attempt or an active dunning action/campaign must precede the payment
  • Strategy attribution — the tenant-wide retry strategy (DUNNING_STRATEGY, defaulting to the smart retry engine), or campaign when a dunning campaign execution was driving the invoice
  • Idempotent — one record per invoice, however many success paths fire
Query totals and a last-12-months series:
Amounts are in minor units, keyed by currency (never summed across currencies). The dunning dashboard renders the same data as a recovered revenue panel. See the API reference for details.
Recovered revenue is the number that justifies your dunning configuration: it is literally the money that would have churned without retries and campaigns.

Webhooks

Best Practices

Escalate Gradually

Start with a friendly email and escalate through SMS and payment wall over days, not hours.

Set a Default Campaign

Always have a default campaign so no failed payment goes unaddressed.

Use Templates

Use template IDs for consistent branding rather than inline body content.

Test Before Deploying

Create a non-default campaign first and test with internal invoices before making it the default.
The campaign stops immediately. Pending steps are canceled and any active payment wall is deactivated automatically.
Yes. Only one campaign can be the default, but you can assign specific campaigns to subscriptions or customer segments. The default is a fallback for invoices without an explicit assignment.
Available variables include {{customer_name}}, {{amount}}, {{currency}}, {{plan_name}}, {{invoice_id}}, {{payment_link}}, {{due_date}}, and {{grace_days_remaining}}.