status === 'active' is not a billing policy
Updated 22 Nov 2026.
if (subscription.status === "active") looks like a policy. It is a single field.
Stripe documents eight subscription statuses:
incomplete, incomplete_expired, trialing, active,
past_due, canceled, unpaid, and paused.
A trial, a failed renewal, and a cancellation that has not reached period end are not the same door.
What a single check drops
trialingis paid access during the trial. A check foractivelocks that person out on day one.past_duemeans a renewal failed and Stripe is still retrying. The grace has no timer of its own. Stripe's retry schedule decides how long it lasts. You choose whether to keep access or cut it off.canceledwithcancel_at_period_endstill true, and a period end in the future, is access the customer already paid for. Cutting them off at the click is a different product than the one they bought.- If the period end has already passed and your stored status still says
activebecause you missedcustomer.subscription.deleted, a status check keeps the door open. incompletemeans the first payment is not done.incomplete_expiredis terminal after about 23 hours.pausedandunpaidare not access.
Write a function of stored state
Access should be a function you can call on a paid route, not a side effect of whichever webhook arrived today. After you have verified and stored the event, decide from the snapshot:
import { accessFor, billingEventFromStripe } from "hamichi-billing-kit";
// In the webhook handler, after the signature check:
const event = billingEventFromStripe(stripeEvent);
if (event) await saveBillingEvent(db, event, customerId);
// On a paid route:
const decision = accessFor(storedSubscription);
if (!decision.knownStatus) alertSomeone(decision); // Stripe added a status
if (!decision.canUsePaidFeatures) {
return res.status(402).json({ nag: decision.nag });
}
The policy Hamichi ships: trialing and active get access.
past_due gets access by default (pastDue: "deny" to cut off) and a
update_payment_method nag. unpaid, incomplete, and
paused do not. canceled and incomplete_expired do not,
with a resubscribe nag. An unknown status is a no, with knownStatus: false.
A scheduled cancellation (cancel_at_period_end with a known period end, or
cancel_at) that has already passed denies access even if the stored status still
says active. Stripe normally sends customer.subscription.deleted at
that moment. This covers the case where you missed it.
current_period_end lives on subscription items since API version
2025-03-31.basil. Read items first, then the old top-level field.
The Hamichi Billing Kit is this function, plus
applyBillingEvent for events that arrive late or in the same second.
Those events still have to be verified and deduped first:
Why Stripe sends your webhook twice. The rest of the production list is in Stripe webhooks: the production gotchas.