Billing · Guide

status === 'active' is not a billing policy

Updated 22 Nov 2026.

Hamichi the hamster pointing at a checklist of subscription statuses next to a traffic light

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

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.