Unpaid invoices and app access
An unpaid invoice on an active Chargebee subscription does not, by itself, stop the customer from logging in to Nutritionist Pro. The app never looks at Chargebee's payment state. Access is decided from the app's own database, and the only things that change it are the dates and the cancellation flag written there.
This page explains what the app does check, how an overdue renewal plays out over time, and what to look at when a customer with an unpaid bill asks why they can or cannot log in.
What login actually checks
Each time a customer logs in, the app sweeps every order on their account and recomputes the in-app access flag on each one. The rule is in SubscriptionAccess::sweptState in the nexgen backend and uses only local data:
- If the order's
until_datehas passed, the order is set to In-Active (or Cancelled, if it was already cancelled) and access is switched off. - If the order has been cancelled but the
until_datehas not passed, the order is left alone, so the customer keeps access to the end of the paid term. - Otherwise the order is Approved and access is switched on.
Freeze Plan orders and orders already marked as switched are skipped by the sweep.
After the sweep, login succeeds when at least one of the customer's orders has access switched on. If none does, the login is refused with the expired-subscription message and the customer is sent to the account management area, where they can buy or renew.
No payment-failure webhook exists
The app handles four Chargebee events: payment_succeeded, subscription_cancelled, subscription_renewed, and subscription_changed. There is no handler for a failed payment, an unpaid invoice, or any dunning event. Chargebee delivers every event type to every registered webhook URL, but the app ignores the ones it does not handle, so an overdue invoice writes nothing to the database. Which host the webhooks call, and what to do when Chargebee reports them failing, is on Chargebee webhooks.
Two other points about the events it does handle:
subscription_renewedis ignored on purpose. At the moment Chargebee renews, the renewal has not been paid yet.payment_succeededis the only event that extends the order'suntil_date. The order's expiry moves only when money actually clears.
What happens with an overdue renewal
Put together, this is the timeline for a customer whose renewal invoice goes unpaid:
- Until the local
until_dateof the current term passes, the customer logs in and works as normal. Nothing about the unpaid invoice is visible in the app. - Once that date passes with no successful payment, the next login flips the order to In-Active and refuses the login with the expired-subscription message. The customer is locked out because nothing extended the date, not because the app knows the invoice is unpaid.
- If Chargebee's dunning rules eventually cancel the subscription, the
subscription_cancelledwebhook also revokes access, using the cancelled-at or term-end date in the payload. For a customer already past theiruntil_datethis changes nothing they can see. - If the customer pays the overdue invoice, Chargebee sends
payment_succeeded, the app writes the newuntil_dateon the matching order, and access comes back at the customer's next login. They have to log out and back in for the sweep to run.
Because the until_date written at the last successful payment is the whole story, a customer can be days or weeks behind on an invoice and still have full access, and a customer who paid late regains access without anyone touching the app.
When paying does not restore access
The payment_succeeded handler finds the local order by the Chargebee subscription id on each invoice line. It never matches by customer or by plan. If the subscription that was paid is not the one the app knows about, the handler logs that no local order matched, sends the webhook alert email, and changes nothing. The customer has been charged but is still locked out.
This happens when the subscription was cancelled and recreated in Chargebee, switched to a different subscription, or paid under a new subscription that staff created in the Chargebee console. For how to diagnose and repair it, see the Permissions page in the nexgen V3 section, which covers the access grant command.
Answering the customer
- A customer with an unpaid invoice who can still log in is inside their last paid term. Their access ends on the
until_dateof that order, which is the same date Chargebee shows as the current term end at the time of the last payment. - A customer who paid the overdue invoice and is still locked out should first log out and log back in. If that does not restore access, check the webhook alert mailbox for a "no local order matched" message for that payment and follow the Permissions page.
- Cancelling the subscription in Chargebee ends access immediately or at term end, depending on the option chosen. See Refunds for the cancel steps.