The Reference Docs Developer Hub

Welcome to the Reference Docs developer hub. You'll find comprehensive guides and documentation to help you start working with Reference Docs as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Dunning Management

When a customer's payment fails, Recurly utilizes Dunning emails to notify the customer that their payment has failed in an attempt to entice the user to enter valid payment information or remit payment.


Dunning preferences can be accessed in your account's Configuration panel. On this page, users with Configuration user access, can change the failed payment notification intervals, number of notification attempts and the desired end-result when payment is unsuccessfully collected. Each invoice will follow the dunning configuration that was active at the time when an invoice entered dunning.

If you decide to delay the first email communication to the customer then Recurly will try to retry the transaction once before the customer email is sent. Also, if you have configured a delayed email to the customer then you have the option of letting Recurly send an email immediately for transactions with hard declines (since Recurly can't retry the transactions with hard declines).

Customer Communication

In the process of dunning an account, Recurly can send several emails to your customer notifying them of failed payment and any subsequent subscription changes due to non payment:

  1. First, Recurly will send a "Payment Declined" email letting the customer know their payment failed, and prompting them to update their billing information.

  2. Recurly will then retry the payments and send the appropriate notification emails (depending on the outcome) based on your dunning management settings.

  3. If the customer does not respond to these emails by updating their billing information, Recurly sends a "Subscription Canceled Nonpayment" email letting the customer know their subscription has been terminated for non-payment. This ends their subscription immediately.

Customizing Customer Communication

You must have Configuration permissions to perform this task.

  1. Navigate to your Dunning Management page.

  2. Adjust the number of emails you'd like your customers to receive by pressing the + and - buttons.

  3. Adjust the number of days in between emails. The total number of days should be fewer than your shortest billing cycle length.

  4. Choose an outcome if the payment fails at the end of the dunning cycle. You may either expire the subscription, or leave it active.

Coming Soon: Multiple Dunning Emails

Beginning in December 2017, Recurly opened a beta to send different emails per Dunning step. You can find more documentation for that feature here. To enable this feature, please email our support team.


Webhooks can be used to keep your service synchronized with payment issues inside of Recurly.

Dunning Event

Sent when invoices that enter and remain in dunning and will follow the same dunning schedule as configured under Dunning Management in Recurly. These push notifications are delivered regardless of whether or not merchants use Recurly to send customer communication. Recurly merchants use this push notification to customize customer email for each dunning step or to reach customers using different communication channels (email, SMS, Slack channel etc)

Failed Payment

Sent after each failed payment. Recurly merchants use this push notification to flag a user as past-due inside their application and encourage them to update payment information.

Successful Payment

Sent after a successful payment. Recurly merchants use this push notification to recognize when a previously past-due user is now back in good standing.

Subscription Expired

Sent if Recurly terminates a subscription due to non-payment or if the subscription is canceled and no longer valid. When this notification is received, the subscription should be immediately terminated in your system. This is the primary notification you should catch if you are receiving push notifications.

Learn more about Recurly's webhooks, or see our webhooks documentation for developers.

Updating Billing Info

When your customers receive a failed payment email, they need to know how to update their billing information. The default payment declined email template offers your customers a direct link to their hosted account management page, where the customer can provide updated billing information.

You can include a direct link to a customer's account management page from your website using the hosted_login_token parameter available on the Accounts API. API users can also update the email template to point to a billing update form on their own website.

Whenever billing information is updated successfully, Recurly will retry collection on any past due invoices on the account.

Stop Dunning

The Dunning process can be halted on an account by opening the past due invoice, clicking on the Stop Collection tab, and selecting either the Stop Collecting option, which will mark the invoice as failed, or the Mark Paid option, which will indicate that the invoice was successfully paid for (this option is typically used when funds are received outside of Recurly).

Either option will move the invoice to a Closed state and will stop all future collection attempts on the invoice.

Please Note: Stopping collection on an invoice will not automatically cancel the related subscription. The subscription needs to be canceled separately in order to stop the subscription from renewing again.

A subscription will only be canceled automatically if an invoice fails dunning (assuming your dunning settings are configured to expire a subscription at the end of the dunning process).


An invoice enters the dunning cycle when it's state moves to Past Due. For an automatic collection invoice, this is after the initial payment transaction fails. For a manual collection invoice, this is when the net terms are passed. Recurly allows you to configure separate dunning schedules for your automatic and manual collection invoices.

By default, dunning settings will automatically fail an invoice at the end of the dunning cycle if the invoice has not been paid. A failed invoice is Recurly's way of writing it off as bad debt, removing the owed balance from the customer's account. You can change your dunning settings to never auto-fail the invoice and leave the invoice past due. When you change the invoice dunning setting, all invoices currently in dunning (in a past due state), will still either fail or stay past due based on the previous setting, but new invoices entering dunning will start to follow the new setting. This is due to the fact that dunning settings are versioned to make sure an invoice currently in a dunning step doesn't all of a sudden get a new schedule.

Users with permissions to edit the Customer section have the option to reopen failed manual invoices. If a failed manual invoice is reopened, dunning will not restart (no dunning emails will be sent) and the associated subscription will not be effected. When a manual invoice is reopened, it will remain in an Open state indefinitely until it's closed and marked paid/failed.

After Dunning

If you leave your invoices past due after the dunning cycle is complete there are two ways to attempt collection again on the invoice. Both of the below actions will send all past due invoices on the account into collections.

  • Have the customer update their billing information
  • Add a new subscription to the account (resubscribe the customer)

Test Dunning Behavior

Merchants wanting to speed up the dunning behavior to test webhooks, delivery of email, and other variables may follow the below instructions to put an account through dunning in sandbox mode.

  1. Subscribe an account using the "Success" test card number: 4111-1111-1111-1111
  2. Update the account's billing information to use the "Fail, but save" test card number: 4000-0000-0000-0341 (note: it will appears this action returns an error, but this is expected. The card number will still save on the account).
  3. Speed up the renewal process by clicking "More info" on the subscription, then "Change Renewal Date" on the subscription details page
  4. Set the subscription's next renewal date 1 hour in the future
  5. The subscription will renew within the hour, kicking off your dunning process.

Dunning Management

When a customer's payment fails, Recurly utilizes Dunning emails to notify the customer that their payment has failed in an attempt to entice the user to enter valid payment information or remit payment.