Stripe sends customer.subscription.deleted when a subscription actually ends, whether it was canceled on the spot or a scheduled cancellation reached its date. Stripe never touches your app’s own access record. When a canceled customer still has access, one link between that event and your app’s access check failed to update, and the trace below finds which one.

What customer.subscription.deleted means, and the three controls that end access

The customer.subscription.deleted event is what Stripe sends when a subscription ends, at once or at the close of a scheduled cancellation, with the subscription and its canceled status inside. It changes nothing in your app. Access ends only when three controls hold: a handler that records the end, a server-side access check, and a reconciliation job.

Those three controls are the access half of the SaaS billing process best practices, the wider set of checks a billing setup needs before real money moves through it.

Stripe’s event types reference gives the event a one-line description, “Occurs whenever a customer’s subscription ends,” and lists a subscription as its data.object. Stripe’s cancellation guide names two causes of customer.subscription.deleted: a direct call that deletes the subscription, and a subscription with cancel_at_period_end: true reaching the end of its billing period. A subscription that Stripe cancels after its payment retries run out ends with the same event. The event arrives after the fact. Nothing in it grants or removes anything inside your product; your code has to read it and change the record your app checks.

ControlWhat it doesWhat a canceled customer keeps without it
Lifecycle handlingA handler turns the created, updated and deleted subscription events into one access recordThe plan written at checkout, which nothing ever rewrites
Server-side access checkEvery paid action reads that record on the server before it runsWhatever plan the browser, a session token or a cache still reports
ReconciliationA scheduled job compares the app’s records with Stripe and fixes the differencesAccess from any cancellation whose delivery was missed or failed

cancel_at_period_end or canceled now: when access should actually end

A cancel_at_period_end value of true schedules the end: the subscription stays active, Stripe sends customer.subscription.updated, and access should continue through the paid period. Canceling immediately ends it now, and Stripe sends customer.subscription.deleted. Only the second is a reason we’d remove access today, unless your own terms say otherwise.

Check for this first state before calling anything a bug. Stripe says a cancellation at period end “allows the subscription to complete the duration of time the customer has already paid for,” and the cancel_at_period_end field means the subscription will cancel at the end of the current period while its status is active. A customer who writes in with “I cancelled my subscription but it still says active” may be looking at exactly that. We’d let access follow what the customer paid for: a scheduled cancellation keeps access until its date unless your terms say access stops the moment they click cancel.

The other direction needs no setting at all. Stripe’s cancellation docs state that “by default, cancellation takes effect immediately,” so to cancel a subscription immediately in Stripe you call the cancel endpoint or use the Dashboard’s cancel action with the immediate option. The table maps each case to the event your handler receives.

What happenedSubscription statusEvent Stripe sendsAccess decision
cancel_at_period_end set to trueactive until the period endscustomer.subscription.updatedKeep access to the end of the paid period
cancel_at set to a future dateUnchanged until that datecustomer.subscription.updatedKeep access until that date
Canceled immediately (API DELETE or Dashboard)canceledcustomer.subscription.deletedRemove subscription-backed access now
The scheduled date arrivescanceledcustomer.subscription.deletedRemove access
A pending cancellation is stopped (cancel_at_period_end back to false)activecustomer.subscription.updatedClear the stored end date so nothing downgrades later

A status other than canceled can still mean no access. Stripe’s subscription guide tells you to revoke access when a subscription is unpaid; past_due means payment on the latest finalized invoice failed or wasn’t attempted; and an incomplete_expired subscription never activated and doesn’t bill. Every status and the events that move a subscription between them belong to the full subscription lifecycle in Stripe, so they are not repeated here.

Customers who cancel in the customer portal get whichever mode the portal is set to: Stripe’s portal configuration takes immediately or at_period_end. One detail catches handlers out. On subscriptions in flexible billing mode, a portal cancellation at period end sets cancel_at and leaves cancel_at_period_end as false, so code that only reads cancel_at_period_end never sees it. Choosing the mode is part of setting up the Stripe customer portal.

Failed renewals reach the end by another road. After invoice.payment_failed and the retries that follow, your failed-payment settings decide whether the subscription moves to canceled or unpaid or stays past_due, which is what happens when a renewal payment fails.

Which API version moved the period end date

Since Stripe API version 2025-03-31.basil, current_period_start and current_period_end are no longer on the subscription; each subscription item carries its own, at items.data.current_period_end, according to the 2025-03-31.basil changelog entry. A handler on that version or later that reads subscription.current_period_end gets nothing back, and a subscription with several items can carry several period ends. Store cancel_at whenever Stripe sets it, since the API describes it as “a date in the future at which the subscription will automatically get canceled,” and decide which item’s period end governs access when there is no cancel date. Code that reads either field should say in a comment which API version it was written for. Moving an integration between versions is covered under pinning a Stripe API version.

Why a canceled subscription still has access: six places the change stops

A canceled subscription still has access when the change stops somewhere between Stripe and the check your app runs on each request. The six usual stopping points are a cancellation that is only scheduled, no delivery, a failed delivery, a handler with no branch for the event, a write that never landed, and a cached plan.

Take one sub_... id from the Stripe Dashboard and follow it down the table. The first row where the state stops moving is your break.

Where it stoppedWhat you seeThe first check
Only scheduledStripe shows the subscription active with a cancel dateRead cancel_at_period_end and cancel_at; if either is set, access is meant to continue
No deliveryThe destination’s event deliveries list has no customer.subscription.deleted for that idThe destination is enabled, subscribed to the event and in the same mode as the subscription; a live destination has its own signing secret even when its URL matches a testing one
A failed deliveryAttempts marked Failed with an error statusIn live mode Stripe retries for up to 3 days with exponential backoff, in a sandbox three times over a few hours; fix the receiver, then resend (Dashboard up to 15 days after the event, the CLI up to 30)
No branchDelivered, and the handler only knows checkout.session.completedSearch the handler code for customer.subscription.deleted
A write that never landedA 200 in Stripe and no change in the rowThe lookup (email instead of the Stripe customer or subscription id), a swallowed error, or an update to a table the access check never reads
A stale copy of the planThe row says canceled and the screen still says ProA session, a token claim or a cache that still carries the old plan

The CLI resend for row 3 is stripe events resend <event_id> --webhook-endpoint=<endpoint_id>. When the fifth row is the break, the general checks for a Stripe webhook not updating the database apply as they stand.

If the trace ends inside your own code, paying customers are affected and you still can’t say which of the six it is, start with a free audit: a video call where we go over your cancellation path with you and agree which stopping point to fix first. In the Production Hardening Sprint, our engineers handle creation, updates, cancellation, payment failure, refunds and disputes, including delayed or out-of-order events, enforce paid-plan permissions and usage limits in backend actions, and compare the application’s billing records with the payment provider and correct mismatches.

Stripe shows a successful delivery, and the user is still Pro

Stripe’s webhooks docs treat a 200 as a successful delivery, and its retries exist for deliveries that fail. A handler that ignores customer.subscription.deleted and still answers 200 therefore gets no second attempt while the user stays on Pro. The same docs ask endpoints to return the 2xx quickly, before any complex logic, so even a well-built endpoint can show a green tick before the access row is written. A clean delivery list proves your receiver answered. It says nothing about the record your access check reads, so open that row by subscription id and compare its update time with the event’s.

The database says canceled, the app still says Pro

Every copy of the plan outside the database row lives on its own clock. A plan claim inside a session token lasts until the token expires. A cached plan lasts until its cache entry does, and a plan held in a client-side store lasts until the next full reload. Each one has to be cleared or re-read after the handler commits, or the customer keeps seeing Pro for as long as the copy survives. Clearing them by hand works once; the fix that holds is an access check that reads the stored record on the server for every paid action, set out under the access-check step in the next section.

How to make cancellation end access: handler, access check, reconciliation

Three changes, in this order, each in its own place: the handler writes the record, the server reads it, and a scheduled job catches what the handler missed. The event behavior below comes from Stripe’s docs, quoted where an order, a retry or a field matters; the code is a pattern written for this page, not run against a live account.

Handle the deletion event, and sync state instead of writing a plan flag

A cancellation handler listens for the three subscription events, reads the current subscription state, and writes one access record through one function, recording each event id so a repeat changes nothing. A plan flag written once at checkout and never rewritten leaves a canceled customer on the paid plan.

Stripe’s guide to webhooks with subscriptions lists customer.subscription.created, customer.subscription.updated and customer.subscription.deleted among the events to handle, and gives revoking a customer’s access when a subscription is canceled as an example. For renewals it tells you to retrieve the subscription and “confirm that its status is active before extending the customer’s access expiration date.” The pattern below applies the same habit to every subscription event: it reads Stripe’s current state instead of trusting the payload’s age.

// Stripe API 2025-03-31.basil or later (period ends sit on items). db helpers are placeholders.
switch (event.type) {
  case 'customer.subscription.created':
  case 'customer.subscription.updated':
  case 'customer.subscription.deleted':
    await syncSubscriptionAccess(event);
}

async function syncSubscriptionAccess(event) {
  const sub = event.type === 'customer.subscription.deleted'
    ? event.data.object // canceled is terminal
    : await stripe.subscriptions.retrieve(event.data.object.id); // current state, not the event's
  await db.transaction(async (tx) => {
    if (!(await tx.insertIfAbsent('stripe_events', { id: event.id }))) return; // seen before
    await tx.lockRow('subscriptions', sub.id); // one writer per subscription
    await tx.upsert('subscriptions', {
      id: sub.id, customer: sub.customer, status: sub.status,
      cancel_at_period_end: sub.cancel_at_period_end, cancel_at: sub.cancel_at,
      has_access: ['active', 'trialing'].includes(sub.status), // your rule for past_due goes here
    });
  });
}

Stripe can retry failed live webhook deliveries for up to three days and does not guarantee event order. That is why the sync function takes a lock per subscription and refetches the subscription for created and updated events: a late customer.subscription.updated then writes today’s state, never the state from three days ago. Stripe also advises against using an event’s created time to order events and suggests tracking event ids for duplicates instead, which the stripe_events insert does. The rest of replay safety, from queues to side effects, belongs to a webhook handler that is safe to repeat. Before any of this runs, the endpoint checks Stripe’s signature, which is verifying the Stripe webhook signature.

Check access on the server, from the row the handler writes

In the 21 third-party apps we audited in June and July 2026, 10 trusted the client: the server accepted whatever the browser asserted. Those apps were picked for audit rather than drawn at random, so the count describes that group and is no rate for AI-built apps in general.

For cancellation, that habit means a plan the browser or a long-lived token reports is still believed after the subscription has ended. Every paid action should read the stored access record on the server, at the moment of the request. If you use Stripe Entitlements, Stripe fires entitlements.active_entitlement_summary.updated when a customer cancels, and the revoked features no longer appear in entitlements.data, so the same rule applies to the entitlement copy you store. Building the check once for every paid route is the job of server-side plan checks for every paid action, not repeated here.

Reconcile what the webhook missed

Webhooks report only the events an endpoint is subscribed to and actually receives. A scheduled job that compares the app’s active rows with each subscription’s current state in Stripe catches the rest: a cancellation nobody’s handler heard, a destination that was disabled for a day (Stripe stops retrying an event when its destination is disabled at retry time), or a sync that failed after the endpoint had already answered 200. Run the same sync function on every mismatch, and have the job report what it found before it changes anything. If Stripe can’t be reached during a run, we’d leave access as stored and try again later, and never grant access on a failed lookup. The query, the drift classes and the schedule are worked through in keep Stripe subscriptions in sync with your database.

Refunds and disputes are not cancellation events

Refunding a payment and canceling a subscription are separate actions in Stripe. When you cancel in the Dashboard, the refund is its own choice: a prorated amount, the last payment in full, or no refund at all, and a custom cancel date allows no refund. A refund raises refund.created, the event Stripe recommends listening for at a minimum, and charge.refunded, which fires for partial refunds too, so a “revoke on every refund” branch in a cancellation handler would cut off a customer who got a small partial refund. For disputes, Stripe’s subscription guide lists restricting account access as one option among several. What access a refunded or disputing customer keeps is a business rule to write down, and who issues refunds and how belongs in the billing operations runbook.

Who can fix a cancellation that never ends access

Four kinds of help fit this problem. The developer who wrote the handler fits when the trace points at one branch and tests already exist. A freelancer suits a single missing branch with a clear test to prove it. An agency already building the product makes sense when the billing code is theirs to change. A service like ours fits when the handler, the server-side check and reconciliation all need work and the result has to be shown with tests.

How to test that a canceled customer loses access

A cancellation path is proven by a test, and a 200 in Stripe’s log proves only delivery. Schedule a cancellation and confirm access stays; end a subscription and confirm every paid action refuses; replay the event and deliver an old one late; then switch the webhook off and let reconciliation catch the gap.

Run every check in a Stripe sandbox against real rows of a test database, and keep the evidence each one names. Use only test cards and sandbox keys; a live card or live keys have no place in this test.

  1. 01 Create a test customer and subscription in the sandbox, linked to a test account in your app the way your checkout links them. Evidence: the customer id, the subscription id, the local account id, the Stripe status and the local access value.
  2. 02 Schedule the cancellation by setting cancel_at_period_end to true. Confirm customer.subscription.updated arrived, the end date is stored and access remains. Evidence: the event id and the row.
  3. 03 Stop the pending cancellation (Don't cancel in the Dashboard, or cancel_at_period_end back to false). Confirm the stored end date is cleared. Evidence: the row before and after.
  4. 04 On a second subscription, cancel immediately. Confirm customer.subscription.deleted changed the row and that every paid action now refuses when called as that user through the API, not only on screen. Evidence: each response.
  5. 05 Resend that same deletion event from the Dashboard, then resend an earlier customer.subscription.updated event for the same subscription. Confirm the deliveries list shows both new attempts, each event id is stored once, the row stays canceled and nothing else changes, with no second email or downgrade job. Evidence: the delivery attempts, the event table and the row.
  6. 06 Create a test clock, create a new customer on it with a test card, link that customer to a fresh test account the way your checkout does, subscribe it, schedule the cancellation, then advance the clock past the period end. Confirm customer.subscription.deleted arrives and access ends. Evidence: the clock time, the event id and the row.
  7. 07 Turn the webhook destination off, cancel a third subscription and, with the destination still off, run reconciliation. Confirm the job reports the mismatch and fixes it through the same sync function. Evidence: the report before the fix and the row after.

Check 6 rests on Stripe test clocks, which Stripe’s simulations use to control time. The clock attaches to a customer you create on it, the subscription follows that customer’s clock, and a monthly subscription can move forward at most two months per advance. If you reach for stripe trigger instead of the steps above, note that Stripe CLI trigger commands create test fixtures before causing webhook deliveries, so a triggered customer.subscription.deleted belongs to a subscription no account in your app owns; map it to the account you are watching or create the subscription yourself. The CLI side in full is testing Stripe webhooks with the CLI.

In the Production Hardening Sprint, deliverable 5.3 is verified this way: test the relevant lifecycle transitions and verify the final account state; deliverable 5.4 by attempting paid operations with free, expired, and valid paid accounts; and deliverable 5.6 by seeding mismatched records and verifying they are identified and reconciled correctly. Hosting, paid tools and API usage are paid through your accounts, and the implementation follows your stack.

Common questions about Stripe cancellations and access

Can I reactivate a canceled Stripe subscription?

No, not once it has ended: Stripe treats canceled as a terminal state, so a customer who wants back in needs a new subscription with new payment details. A cancellation that is only scheduled can still be stopped before the period ends, by setting cancel_at_period_end back to false or choosing Don’t cancel in the Dashboard. After a new subscription, the app grants access against the new subscription id; after a stopped cancellation, access simply carries on.

Can you cancel a subscription through Stripe?

Yes. In the Dashboard, open the subscription’s overflow menu, choose Cancel subscription and pick immediately, the end of the period or a custom day; through the API, a DELETE request on the subscription cancels it immediately. Either way the subscription stops billing once the cancellation takes effect, and the app still has to act on the event before paid access ends.

Can I get a refund for a Stripe subscription?

Yes: a business can refund a subscription payment in full or in part from the Dashboard or the Refunds API, up to the amount of the original charge. Refunding the payment is a separate action from canceling the subscription, so whether a refunded customer keeps access is a rule the business sets.

What does “cancelled subscription” mean?

In Stripe, a canceled subscription is one whose status is canceled: it has stopped billing and the state is terminal, so it can’t be updated back to life. In the app that sells it, canceled should mean the paid access is over, unless the terms promise access to the end of a period the customer already paid for.

When is it time to get help with canceled customers who keep access?

It’s time when you can’t tell whether the cancellation event never arrived, the handler ignored it or an old copy of the plan is still being read, or when the handler, the server-side check and reconciliation are not all in place. AxonBuild offers a free audit: a video call where we go over how your app handles cancellations with you and agree what to fix first.