# Dunning Queue block

> Expandable Dunning Queue for SaaS Failed Payment Recovery

Sortable, filterable dunning queue for SaaS billing operators to recover failed charges. Expands inline to retry timeline. Features ReUI DataGrid, Frame, Filters; shadcn Button, Separator. Payment recovery, dunning list, failed billing.

- Type: Pro block
- Category: [Billing](https://reui.io/blocks/solutions/billing.md)
- Page: https://reui.io/blocks/solutions/billing/solution-billing-6
- MCP: `get_block("solution-billing-6")`
- Built with: Avatar, Badge, Button, Data Grid, Dialog, Dropdown Menu, Field, Filters, Frame, Item, Select, Separator, Spinner, Textarea
- Installs with a ReUI Pro or Ultimate license; setup: https://reui.io/docs/license-setup

## Best for

Failed charges with the attempt history under each row, a Retry now that flips status to Retrying and a templated contact dialog

## Agent notes

- `getRecoveryStats` reads the static `PAST_DUE_INVOICES`, so the stat strip does not move when Retry now changes a row
- `markRetrying` only flips status to Retrying in state and never appends to `attempts`, so the attempt history does not grow
- `handleRetryAll`, `handleExport` and `handleRules` in the header only toast; the grid's own `handleRetryDue` is what flips status

## When not to use

- A full invoice ledger with bulk collector assignment and a void action: use [Invoice Ledger](https://reui.io/blocks/solutions/billing/solution-billing-1.md) (`get_block("solution-billing-1")`)
- One customer's account with its invoices, payment methods and activity: use [Billing Account Detail](https://reui.io/blocks/solutions/billing/solution-billing-4.md) (`get_block("solution-billing-4")`)

## Third-party libraries

- TanStack Table v9: [API reference](https://tanstack.com/table/v9/docs/framework/react/reference/index), [docs](https://tanstack.com/table/v9/docs/framework/react/quick-start)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/solution-billing-6
```

## About Billing blocks

### When to use

- A billing back office: the invoice ledger, subscriptions, dunning, metered usage, plans and coupon rules
- One customer's account seen by staff, a plan change with proration, or an invoice built line by line
- A tenant's own billing settings, where plan, card and invoice changes hand off to Stripe hosted pages

### When not to use

- A public page where visitors compare plan tiers and pick one before signing up: use the [Pricing blocks](https://reui.io/blocks/marketing/pricing.md)
- A user's account page where billing is one tab beside personal details and security: use the [Profile blocks](https://reui.io/blocks/application/profile.md)
- A stepped intake flow with no money in it, such as vendor onboarding or team invites: use the [Wizard blocks](https://reui.io/blocks/application/wizard.md)

### Agent notes

- Each block sets a `min-h-svh` wrapper with `bg-background`, padding and a max width in page.tsx or its root component; drop it inside an app shell
- No block calls an API: sends, retries, saves and exports update `useState` or fire a sonner `toast`; post to your billing backend from those handlers

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
