Skip to main content
When a renewal payment fails, the subscription moves to past_due and enters dunning. The customer keeps service during this grace window while Commet retries the charge. Customers can reactivate sooner from the Customer Portal by retrying payment or updating their card.

What happens when a payment fails

  1. The subscription status changes to past_due
  2. The failed invoice is marked as outstanding
  3. The customer keeps service: usage events and seat events still work (usage accrues as debt)
  4. The customer receives an email notification
  5. Commet retries the charge on a fixed schedule (dunning)
If a retry succeeds, the subscription returns to active. If all retries fail, the subscription is canceled and the invoice is marked as uncollectible.

Provider error mapping

Commet translates provider responses into a common payment outcome and keeps the provider detail alongside it. For recurring failures, the payment.failed webhook exposes failureCode, failureMessage, and a recoveryUrl when a recovery path is available. The exact failureCode depends on the provider, so use the normalized outcome and the recovery URL for customer handling instead of matching only one provider’s raw codes. Initial checkout card declines do not emit payment.failed; the checkout response carries the failure state directly. Recurring failures use the dunning flow below.

Automatic retries

Retries run on day 1, day 3, day 5, and day 7 after the original failure (4 retries). The calendar is anchored to the failure and never moves. After the last failed retry the subscription is canceled. Manual retries from the Customer Portal or reactivate use the default payment method and have separate daily limits. They do not consume automatic retry slots or start another charge while an automatic retry is in progress.

Saved payment methods

Commet first tries the default saved method on the subscription’s payment connection. After a confirmed decline, it tries the other available methods on that connection, newest first. OXXO is excluded from these retries. Changing country routing does not change the connection used for these retries. Trying several methods counts as one scheduled retry. Commet stops when a payment succeeds. If a result is pending or unknown, it waits for that result before trying another method. A successful charge with another method does not change the customer’s default payment method.

Dunning communications

Commet sends a payment-failure notification when a recurring charge enters dunning. For product-specific messaging, subscribe to these webhooks:
  • payment.failed — a recurring charge failed; use failureCode, failureMessage, and recoveryUrl to explain the next step.
  • payment.recovered — the outstanding invoice was paid and the subscription returned to active.
  • payment.retry_failed — all retries were exhausted and the subscription was canceled.
Send your own email, SMS, or in-app message when you need product-specific copy. Do not create a second retry schedule in your app; use Commet’s events to close the communication loop.

Check subscription status

Gate access based on status

Commet keeps serving past_due customers during the dunning window — usage and seat events still work. You decide whether to gate your own product on past_due. To grant access only while billing is healthy, treat active and trialing as the access states:

Recover a subscription programmatically

The SDK exposes three server-side recovery primitives. For past_due subscriptions they all operate on the same outstanding renewal invoice — none of them void it. reactivate also reactivates canceled subscriptions.

Retry the charge server-to-server

reactivate charges the subscription’s saved payment method. It works on both past_due and canceled subscriptions, with different effects:
  • past_due: retries the same outstanding renewal invoice. The billing anchor stays fixed. On success the subscription returns to active and payment.recovered fires.
  • canceled: generates a fresh invoice, resets the billing period anchor to now, and charges the saved card. On success the subscription returns to active and subscription.reactivated fires. Requires the plan to still be available in the subscription’s currency, otherwise it returns PLAN_UNAVAILABLE (422).
On a declined charge or no saved card, the response returns a recoveryUrl in the error details — a hosted page where the customer adds a new card and pays. This matters for subscriptions canceled by dunning: they reached canceled precisely because the saved card kept failing. createRecoveryLink returns a hosted, signed link so the customer pays the outstanding renewal themselves. Deliver it through your own email, SMS, or dashboard. The link stays valid until the charge is paid or the subscription is no longer past_due. The payment.failed webhook already carries a recoveryUrl: the checkout URL for a first failed charge, a signed recovery link for a failed renewal. If you consume webhooks, no separate createRecoveryLink call is needed.

Update the payment method

updatePaymentMethod returns a hosted checkout where the customer updates the subscription’s default payment method. It works for active, trialing, and past_due subscriptions.
For a pending_payment subscription it returns 409 with subscription_not_active, as for any other status. After a first failed charge, the customer pays through the subscription’s payment checkout instead: the recoveryUrl on the payment.failed webhook.

Self-serve recovery

Customers in past_due see their subscription in the Customer Portal with a Reactivate Subscription button. They can choose:
  • Retry with their current card — useful when the failure was temporary (insufficient funds that are now available, a bank hold that cleared).
  • Update their payment method — enter a new card through the subscription’s payment provider and retry in the same step.
A successful retry settles the outstanding invoice, moves the subscription back to active, and emits a payment.recovered event. A declined manual retry preserves the automatic dunning calendar. Retry attempts are rate-limited to 3 per day per customer.

Prompt payment update

Redirect customers to the Customer Portal to reactivate: