Learn how to safely close your Stripe account with this step-by-step guide: back up data, cancel subscriptions, process payouts, disable integrations, and verify closure.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
How to Close a Stripe Account: A Comprehensive Guide
Step 1: Understand the Implications of Closing Your Stripe Account
Before proceeding with closing your Stripe account, it's important to understand what happens when you do so:
Step 2: Back Up Your Data
Before closing your account, download all essential data:
You can download data through the Stripe Dashboard or programmatically via the API:
// Example of retrieving data via API before closing account
const stripe = require('stripe')('your_secret_key');
// Get customers
const customers = await stripe.customers.list({
limit: 100,
});
// Get transactions
const charges = await stripe.charges.list({
limit: 100,
});
// Get invoices
const invoices = await stripe.invoices.list({
limit: 100,
});
Step 3: Cancel Active Subscriptions
Cancel all active subscriptions to avoid customer billing issues:
Using the API to cancel subscriptions:
// Cancel all active subscriptions
const stripe = require('stripe')('your_secret_key');
const subscriptions = await stripe.subscriptions.list({
status: 'active',
limit: 100,
});
for (const subscription of subscriptions.data) {
await stripe.subscriptions.del(subscription.id);
console.log(`Subscription ${subscription.id} canceled`);
}
Step 4: Process Pending Payouts
Ensure all pending payouts are processed:
To initiate a manual payout via API:
// Create a manual payout for remaining balance
const stripe = require('stripe')('your_secret_key');
const payout = await stripe.payouts.create({
amount: 1000, // amount in cents
currency: 'usd',
});
console.log(`Payout ${payout.id} created`);
Step 5: Disable Webhooks and API Integrations
Remove all integrations that depend on your Stripe account:
To list and delete webhooks via API:
// List and delete webhooks
const stripe = require('stripe')('your_secret_key');
const webhooks = await stripe.webhookEndpoints.list();
for (const webhook of webhooks.data) {
await stripe.webhookEndpoints.del(webhook.id);
console.log(`Webhook ${webhook.id} deleted`);
}
Step 6: Close Your Account Through the Dashboard
The simplest way to close your account is through the Stripe Dashboard:
Step 7: Close Your Account Using the API
You can also close your account programmatically using the Stripe API:
// Close Stripe account via API
const stripe = require('stripe')('your_secret_key');
// You'll need to use the Accounts API
const accountDeletion = await stripe.accounts.del('acct\_xxxxxxxxxxxx');
if (accountDeletion.deleted) {
console.log('Account successfully closed');
} else {
console.log('Account closure failed');
}
Note: This method only works for connected accounts or platforms. Standard accounts must be closed through the Dashboard.
Step 8: Verify Account Closure
After submitting your closure request:
Step 9: Update Your Website and Documentation
Update your business systems to reflect the change:
Step 10: Handle Tax and Financial Records
Address any financial loose ends:
Troubleshooting Common Issues
If you encounter problems closing your account:
To check for outstanding disputes via API:
// Check for disputes before closing
const stripe = require('stripe')('your_secret_key');
const disputes = await stripe.disputes.list({
limit: 100,
});
if (disputes.data.length > 0) {
console.log('Warning: You have unresolved disputes');
disputes.data.forEach(dispute => {
console.log(`Dispute ID: ${dispute.id}, Status: ${dispute.status}`);
});
}
Special Considerations for Platform Accounts
If you're running a platform with connected accounts:
Code to list connected accounts before closure:
// List connected accounts
const stripe = require('stripe')('your_secret_key');
const connectedAccounts = await stripe.accounts.list({
limit: 100,
});
console.log(`You have ${connectedAccounts.data.length} connected accounts`);
connectedAccounts.data.forEach(account => {
console.log(`Account ID: ${account.id}, Email: ${account.email}`);
});
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.