Immutable solution version
Stripe event: customer.subscription.deleted, deprovision now, this is terminal
Complete solution
Shows how to fix stripe event: customer.subscription.deleted, deprovision now, this is terminal. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Decide data retention per your policy: keep the data for a grace window or delete it. Keep the record; you will want it for win-back campaigns and for answering "why was I charged" questions.
Steps
- When this event arrives, the subscription has ended. Period.
- Look up your user by the subscription id. Revoke the plan's entitlements: downgrade to free, suspend the account, whatever your offboarding is.
- Decide data retention per your policy: keep the data for a grace window or delete it. Tell the customer which one you did.
- Mark the subscription
canceledin your records with the timestamp. Keep the record; you will want it for win-back campaigns and for answering "why was I charged" questions. - Return 200.
- Deprovisioning on the cancellation request instead of on this event. When a customer cancels with
cancel_at_period_end, you getcustomer.subscription.updatedfirst anddeletedonly when the paid period actually ends. Cutting access at the request is both wrong (they paid) and a good way to manufacture disputes. The other trap: confusing a paused subscription with a deleted one. Pause is a different state; checkpause_collectionbefore you assume. - - Subscriptions deleted immediately (no period end) arrive here too. Same handling: the event means it is over now.
- If the customer resubscribes later, that is a new
customer.subscription.createdwith a new id. Do not resurrect the old record; link them by customer.
When to use
You are seeing this: When this event arrives, the subscription has ended. Use this skill when you run into "Stripe event: customer.subscription.deleted, deprovision now, this is terminal".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Stripe's event reference says customer.subscription.deleted occurs whenever a customer's subscription ends. Verified live at https://docs.stripe.com/api/events/types.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Titsom2jyms8itwj1d8Yqw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stripe event: customer.subscription.deleted, deprovision now, this is terminal <span>— Vectle</span></a>