Testing

See week-six behaviour on day one

Dunning is slow by design: a reminder on day one, another on day seven, a suspension after the grace period. A test clock lets you move a test customer through that timeline in a few calls.

The situation

You should see your own reminder emails and your own webhook handler fire before real customers do. Waiting two weeks to find out is not a test plan.

A clock has a frozen time that only moves forward. Customers attached to it are evaluated at the clock’s time instead of the wall clock, and advancing the clock runs the same reminder and grace-period sweeps the worker runs, for that clock’s customers only.

How it works in TenaBill

  1. Create a clock and attach a customerCreate a clock, then attach a test customer. A customer that already has a provider-linked subscription cannot be attached.
  2. Create an invoice due in 30 daysSet the invoice due date from the clock’s time, and set your dunning config, for example a grace period of 7 days and auto-cancel after 14.
  3. Advance 35 daysExpect the first reminder. Advance another 10 days to see suspension, then another 15 to see auto-cancel.
  4. Check your sideConfirm your webhook receiver handled subscription.suspended and subscription.canceled, and that the emails read the way you want.
  5. Delete the clockDeleting a clock returns its customers to the wall clock.
POST /api/v1/console/test-clocks
{ "name": "dunning walkthrough", "frozenTimeUtc": null }

POST /api/v1/console/test-clocks/<clock id>/customers
{ "customerId": "<customer id>" }

POST /api/v1/console/test-clocks/<clock id>/advance
{ "frozenTimeUtc": "2026-12-01T00:00:00Z" }

Planned, not available yet

What is still to come

  • Renewal invoices, trial expiry and proration are created by the payment provider, so they do not move with the clock yet. Use the provider’s own test clocks for those until a provider-independent renewal scheduler exists.

Good to know

Limits to plan around

  • Test mode only. Every create, attach and advance is refused with test_clocks_unavailable_in_live_mode when payments run live.
  • Limits: one advance can move at most 400 days, a clock can be at most 800 days from the real date, 25 clocks per merchant, 3 customers per clock.
  • The calls use console sign-in, not a merchant API key, and changing a clock needs the Edit permission.

Keep reading

Try it with test cards