How do I automatically cancel an active subscription in Stripe if a user deletes his account. Preferered version account deletion by the user should be disabled as long as a paid plan is active.
How do I achieve this b ecause I had several cases that the user deleted his account but then still got charged. Obviously they thought deleting the account would also cancel the subscrption. BUt if they can delete teh account and there is no trace left for me and no way to trigger a webhook or api call it leaves a lot of frustraed customers, refund fees and obviously a total lack of controll and accountability on my end…
So can you please line out to me how I can prevent them from deleting their account with paid plans or at least trigger a webhook to Stripe when they delete their account!?
1 Like
Great just had anotehr 2 cases of the same problem! The easiest way is just to get rid of this button. Who needs this in the first place? If they really want their account data and everything to be deleted, they can email that request. The only thing that’s legally required is that they can cancel their paid subscription, and everything else is not really required, according to my knowledge.
Account deletion button without deleting the subscription is just making things entirely complicated and frustrating for all sides.
Hi, @easydeutsch
This issue should have been resolved. Now if the user’s trying to delete their account with an ongoing subscription they would see this modal and get redirected to the “Manage plan” page first.
Please let me know and ping me directly here if this issue occurs and please attach affected user ids/emails if that’s the case.
2 Likes
@artsiom the user
test2@easy-deutsch.de is on the monthly paid plan but I still get the regular account deletion message…
That might be because I assign teh access group via API.
I have a few more ideas on how to fix this.
Option A: change the message to something like this: this is not canceling any active paid subscription. Please cancel paid subscriptions before you delete your account.
Option B: Remove that button entirely and only allow manual account deletion.
Option C: make it work with an API-connected paid plan, maybe in the way that we can select access groups. If they’re active in those access groups, they cannot delete the account.
To be honest, my preferred version would be option B. Second choice C and third choice A.
Thanks for your help.
can we find a solution here I am waiting for a response her for over 3 weeks and the problem is still there! And every month I have the same problem… that button with account deletion shouldn´t be there in the first place in my opinion… there is no legal obligation to have it and it serves no purpose for the studio owner which is your customer - it only creates problems!
The user can delete every track record without me being able to check afterwards in case there is a complaint or refund request. This button is therefor activly harming the intrests of your customers. So please get rid of it or give me a way to get rid of it or show me hoe to disable it or add a clear wrning that this DOES NOT CANCEL ANY ACTIVE SUBCRIPTION but the by far best way would be getting rid of it entirely.
@nathaniel
Hi @easydeutsch ,
Thank you for your patience!
At the moment, the Manage Plan popup during account deletion only appears for end users with an active subscription that was created through the portal checkout flow and is still active in the connected Stripe account.
It does not currently appear for end users who were gifted an Access Group, including cases where the Access Group was assigned through the API. In those cases, Pickaxe does not detect an active Pickaxe-managed subscription created through the portal checkout flow, so there is no subscription for the cancellation flow to manage.
Because of that, the Manage Plan step is not triggered during account deletion for gifted Access Groups or API-assigned access. If billing is handled separately outside of Pickaxe, deleting the end user account in Pickaxe will not cancel that external billing arrangement.
I am raising this with our engineering team so they can revisit that behavior. I will update you here as soon as I have more information from them.
Since you mentioned that your preferred solution would be to remove the Delete Account button altogether, you can do that with custom code. Please add the following code to the Workspace-level custom code section and it will remove that button from the portal UI:
<script>
(() => {
const TRASH_ICON_PATH =
'M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6';
function hideDeleteAccountBlocks() {
document.querySelectorAll('button').forEach((button) => {
const path = button.querySelector('svg path');
if (!path) return;
if (path.getAttribute('d') !== TRASH_ICON_PATH) return;
const block = button.closest('.glass');
if (!block) return;
block.style.display = 'none';
});
}
function start() {
hideDeleteAccountBlocks();
const observer = new MutationObserver(() => {
hideDeleteAccountBlocks();
});
observer.observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
});
setInterval(hideDeleteAccountBlocks, 1000);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start, { once: true });
} else {
start();
}
})();
</script>
If you would like this to be considered as a broader product change, please also submit it as a feature request so we can track overall user interest and demand.
Thank you! @danny_support I just saw that there is lso a cancel plan button now… I have the same problem there - it doesn´t cancel it through to Stripe despite me using the product that was created through the pickaxe integration with Stripe - just not the portal workflow. Is there a way to
A: Change the link in this button to the stripe Portal Link where they can cancel.
B: It cancels that subscription even if not made through the portal workflow or
C: Remove it and add some text + custom Link to the Stripe portal just as text.
I guess A or C are the practical ones for now. Can you give me an adjusted custom code?
Because there is no webhook event that I could trigger when somebody cancels, right? WIth a webhook event corresponding to this I could also take care of this on my end.
Thank you for your help!
Hello Pickaxe team .. I would appreciate an answer here before the weekend hits, because atm I have to go through all active subscriptions every day manually to check if they have cancelled… which is onbiously not really a sustainable way of doing it! 
@danny_support @lindsay_support @nathaniel
Hi @easydeutsch ,
If I understand correctly, you want the Cancel Plan button
in the portal to send users to your own external cancellation page instead of using Pickaxe’s built-in cancellation flow.
If that is what you mean, the code below will redirect users when they click that button:
<script>
(() => {
// Replace this with your own full external URL. It must start with https://
const EXTERNAL_URL = "https://your-full-external-link-goes-here";
const BACK_ARROW_PATH = "M7.825 11H20v2H7.825l5.6 5.6L12 20l-8-8 8-8 1.425 1.4z";
const CLOSE_X_PATH = "M18 6 6 18M6 6l12 12";
function hasPath(button, expected) {
const path = button?.querySelector("svg path");
return path?.getAttribute("d") === expected;
}
function findManagePlanDialog() {
const dialogs = document.querySelectorAll('[role="dialog"]');
for (const dialog of dialogs) {
const header = dialog.querySelector(".bg-white\\/50");
if (!header) continue;
const buttons = header.querySelectorAll("button");
if (buttons.length < 2) continue;
const hasBackButton = Array.from(buttons).some((button) =>
hasPath(button, BACK_ARROW_PATH)
);
const hasCloseButton = Array.from(buttons).some((button) =>
hasPath(button, CLOSE_X_PATH)
);
if (hasBackButton && hasCloseButton) {
return dialog;
}
}
return null;
}
function getCurrentPlanActionButton(dialog) {
if (!dialog) return null;
const cards = dialog.querySelectorAll(
'.relative.flex.h-\\[358px\\].w-\\[267px\\].flex-col.rounded-\\[var\\(--portal-roundness\\)\\].border.p-6'
);
if (!cards.length) return null;
const currentPlanCard = cards[0];
const buttons = currentPlanCard.querySelectorAll("button");
if (!buttons.length) return null;
return buttons[buttons.length - 1];
}
document.addEventListener(
"click",
(event) => {
const clickedButton = event.target.closest("button");
if (!clickedButton) return;
const dialog = findManagePlanDialog();
if (!dialog || !dialog.contains(clickedButton)) return;
const targetButton = getCurrentPlanActionButton(dialog);
if (!targetButton || clickedButton !== targetButton) return;
event.preventDefault();
event.stopPropagation();
window.location.href = EXTERNAL_URL;
},
true
);
})();
</script>
One important note: this only changes where the user is sent when they click the button. It does not automatically sync the external cancellation back into Pickaxe on its own. If the subscription is being managed externally, you would still need an automation or update flow on your side to make sure Pickaxe reflects that cancellation correctly.
Hello Danny! Yes that´s perfect I can handle the update via API! Thank you very much!
@danny_support @nathaniel @carsondev
Hi Danny,
I just wanted to let you know that I noticed today that if somebody is in the free plan the one that´s assigned upon registration and is in the account administration, it also shows them a cancel button. Obviously, that should be an upgrade button, not a cancel button (as point number 1).
But point number 2: If somebody in a free plan clicks on cancel despite being in a free plan, it deletes the account without warning, without even telling the user that this means account deletion. You probably want to look into this because that is obviously not how it should be