stripes

How to delete a Price Object using Stripe API Call


I am trying to delete a product using API call but it throws an error saying "This product cannot be deleted because it has one or more user-created prices." I checked in stripe documentation but there is no API for deleting the Price.


Solution

  • I recommend that you do not delete product and price objects; instead, archive them by marking them as inactive. You can do this by setting active to false on the Price or Product if you don't want to use them again.

    set product.active to false

    Reference: https://pupuweb.com/solved-fix-stripe-payment-dev-error-delete-price/