Delete Stripe Express account by API call

One of my clients created the Stipe account for business by mistake, and she cannot move forward on the Stripe settings. According to the Stripe support, the platformers cannot delete the existing Stripe express accounts associated with the parent account on the Stripe dashboard, and we need to delete it by API call as described in the Stripe support page https://stripe.com/docs/api/accounts/delete.

Could you make the API call on your side to delete the following ID which my client created by mistake?

ID: acct_1N9XJMHHnbwqDq05

Thanks,

Hi,

Our servers don’t make any API calls on your website’s behalf, HivePress is a self-hosted software we provide (installed on your site) so when there are API calls to the Stripe Connect they are made by your site. Making this API call is possible but it would require a custom code snippet that should be added to your site and then removed once the Express account is deleted.

Hi @ihor,

Thanks for your response, and I understood that. Could you make the custom code snippet and provide me a brief instruction for that? I’ll set it up on my website and do that by myself under my responsibility.:slight_smile:

Thanks,

Thank you for waiting. Please try this PHP code snippet. Please put Stripe account ID which you want to delete in the code snippet. Also, please refresh any page on your website one time to activate this code snippet after saving this code snippet, and then please delete this code snippet

add_action(
	'template_redirect',
	function(){
		if ( ! hivepress()->payout->stripe() ) {
			return;
		}
		
		try {
			hivepress()->payout->stripe()->accounts->delete( 'put account ID here' );
		} catch ( \Exception $e ) {
			wp_die( $e->getMessage() );
		}
	},
	1000
);

Hi @yevhen,

Thanks for providing me the code and the instruction! I’ve successfully deleted the account on the Stripe.

Thanks for your great support, and I really appreciated!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.