Renewals and days to pay
When a renewal invoice opens, when it is due, and what happens to the subscription and its access while it is unpaid.
Every subscription renews in the same order. The customer gets a notice before the period ends, the renewal invoice opens
at the period end, and the customer has daysToPay days from the period end to pay it.
The timeline
Take a period that ends on 1 February with the defaults: renewalNoticeDays 7, daysToPay 3 and usageGraceMinutes 60.
| When | What happens |
|---|---|
| 25 January, 7 days before the period ends | The invoice.upcoming event and one "renews on" email go out. Neither has a pay link. |
| 1 February, the period end | The renewal invoice opens, due 4 February. The customer gets the invoice email with its pay link. The subscription becomes past_due. |
4 February, daysToPay after the period end | If the invoice is still unpaid, the subscription expires and the invoice is voided. |
With a metered price the invoice opens when the usage period closes: the period end plus usageGraceMinutes, so 1
February at 01:00 in the example. It holds the fee for the next period and one usage line per meter and rate for the
period that ended, zero lines included. It is still due on 4 February, and the subscription is past_due from 1
February, before the invoice exists.
A free trial follows the same order, with the trial end as the period end. See Usage during a free trial.
The notice
renewalNoticeDays is how many days before a period ends the notice goes out, from 1 to 30. It is 7 when you leave it
out. The invoice.upcoming event carries the same body as
Retrieve a subscription's upcoming invoice: the amount,
the usage so far and the due date, with no ID and no pay link. The invoice is a preview and does not exist yet.
When a period or a trial is shorter than the notice, the notice goes out on the next scheduler pass, which is within a minute. A notice never goes out once the period has ended.
Days to pay
daysToPay is how many days after a period ends the customer has to pay, from 1 to 30. It is 3 when you leave it out.
The renewal invoice is due that many days after the period end, whether it opened at the period end or when the usage
period closed. It counts from the period end and never from the moment the invoice opened, so a later opening does not
give the customer more time.
A subscription collected by invoice (collectionMethod send_invoice) uses its own daysUntilDue, from 1 to 60,
in place of daysToPay.
The invoice is paid through its pay link: see Pay invoices. After the customer pays, the
subscription is active again. The period the invoice bought starts where the previous period ended, so paying on the
third day does not move the dates of the following periods.
Credit the customer holds is applied when the invoice opens. If it covers the whole invoice, the invoice is paid at once and the subscription renews. See Customer credit.
Past due and access
A subscription is past_due from the period end until its invoice is paid. accessWhileUnpaid decides what the
customer can use meanwhile:
accessWhileUnpaid | Access while the subscription is past_due |
|---|---|
true, the default | The features stay on until the subscription expires at the period end plus daysToPay. |
false | The features go off at the period end. |
The customer can still pay in both cases until the deadline. Paying turns the subscription active and the features
back on.
What you receive
| Event | When |
|---|---|
invoice.upcoming | The notice, renewalNoticeDays before the period ends. |
invoice.created | The renewal invoice opened. |
customer.subscription.updated | The subscription became past_due, and again when it is paid. |
invoice.paid | The customer paid. |
invoice.overdue | The due date passed with the invoice unpaid. It comes with the expiry. |
customer.subscription.deleted | The subscription expired because it was not paid. |
invoice.voided | The unpaid invoice was voided at the expiry. |
The customer also gets reminders for the open invoice, set by afterIssueReminders in days from the due date. The
default is 1 day before, on the due date and 3 days after. The invoice is voided on the due date, so a reminder after it
is not sent for a renewal invoice.
Set the days
Send the fields to Update billing settings. The call replaces all your settings, and a field you leave out takes its default, so retrieve the settings first and send every field back.
{
"renewalNoticeDays": 7,
"daysToPay": 5,
"accessWhileUnpaid": true,
"usageGraceMinutes": 60
}A change applies from each subscription's next scheduled step.