Skip to Content

Solved: Stripe Payment Development Error “this product cannot be deleted because it has one or more user-created prices” when Delete Product or Price Object using API Call

Problem Symptom

When Stripe Payment developer try to delete a product or price object using API call, an error stating “Error: This product cannot be deleted because it has one or more user-created prices.” display. I have checked in Stripe API Reference documentation but can’t related API information to delete the Product or Price object.

The detailed error message is as below: Error: this product cannot be deleted because it has one or more user-created prices

May I know how to resolve this error? Do I need to delete Price before delete Product object?

Follow the below solution steps to resolve “Error: This product cannot be deleted because it has one or more user-created prices.” error.

Content Summary

Potential Causes
Solution 1: Set Product.active to false
Solution 2: Delete mirrored plan via API
Reference

Potential Causes

Why you can’t delete the Product or Price object?

You try delete a Price object, which has been added to a product, you get an error deleting the Product object. Due to deletion Product object will makes harder for business to do analytics later when look into historical data. In fact, you can’t really delete Price or Product object because the Price API and Product API does not support deletion method.

Solution 1: Set Product.active to false

Recommended not to delete product and price object, archive them by marking it as inactive by setting active to false on the Price or Product if you don’t want to use it again, this is easier for you to reconciliation/reporting in future when the referenced products/prices still exist.

Refer to below steps for how to archive a product from Stripe API Call.

Set "product.active" to false

product.active=false

"active": false,

Set Product.active to false to resolve error "this product cannot be deleted because it has one or more user-created prices" when Delete Price Object using API Call

Solution 2: Delete mirrored plan via API Call

The only case where a Price object can be deleted is when it’s mirroring a Plan and this plan is deleted via the API, which we only support for legacy integrations but actively discourage using.

Reference

Alex Lim is a certified IT Technical Support Architect with over 15 years of experience in designing, implementing, and troubleshooting complex IT systems and networks. He has worked for leading IT companies, such as Microsoft, IBM, and Cisco, providing technical support and solutions to clients across various industries and sectors. Alex has a bachelor’s degree in computer science from the National University of Singapore and a master’s degree in information security from the Massachusetts Institute of Technology. He is also the author of several best-selling books on IT technical support, such as The IT Technical Support Handbook and Troubleshooting IT Systems and Networks. Alex lives in Bandar, Johore, Malaysia with his wife and two chilrdren. You can reach him at [email protected] or follow him on Website | Twitter | Facebook

    Ads Blocker Image Powered by Code Help Pro

    Your Support Matters...

    We run an independent site that is committed to delivering valuable content, but it comes with its challenges. Many of our readers use ad blockers, causing our advertising revenue to decline. Unlike some websites, we have not implemented paywalls to restrict access. Your support can make a significant difference. If you find this website useful and choose to support us, it would greatly secure our future. We appreciate your help. If you are currently using an ad blocker, please consider disabling it for our site. Thank you for your understanding and support.