-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide Delete Price API #1224
Comments
@arvindkgs That feature is only available in the Dashboard as a way to quickly undo a mistake you made in the UI. We do not plan to support this in the API as we discourage deleting Prices otherwise. This leads to real issues down the road when trying to do reconciliation or analytics once you have a lot of historical data. It's something we used to support on the Plans API and it caused a lot of pain for developers over the years that don't look obvious at first. What you describe about Price deletion for Test mode makes sense, but it'd be quite tricky to support it only for unit tests and not normal deletion. If it worked in Test mode, you'd expect it to work in production too or your code would break if you made the wrong assumption. We're instead working on improving Test mode environments to support ephemeral test sandboxes for example which should alleviate the pain you're describing. No firm timeline on shipping support for this yet but it is definitely top of mind for us. |
I'm desperately trying to remove a price and after more than an hour spent on this, I'm still completely unable to do so. As @arvindkgs pointed out, we can remove a price from the dashboard. So I thought I'd mimic the request manually and I'd be done with it. Turns out, even this doesn't work. Well... There's a trick but it's not applicable for CI. Basically, if I use the value of my Stripe API key as bearer token, I can query anything else, but for this endpoint specifically the return I get is: {
"error": {
"message": "Unrecognized request URL (DELETE: /v1/prices/price_XXXXXXXXXXX). Please see https://stripe.com/docs or we can help at https://support.stripe.com/.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_XXXXXXXXX?t=XXXXXXXXX",
"type": "invalid_request_error"
}
} And if instead I use the token I find in the devtool while looking at any request made on Stripe's web page, then it works. |
@maxime1992 See stripe/stripe-python#658 for many more reports and my explanations as to why we don't support this. For now we have no plans to add this. |
I am using stripe's java client version:(20.45.0) to interact with stripe. I want to delete a price, but I don't see delete() or remove() method exposed on com.stripe.model.Price. I don't see delete API on Price API documentation as well - https://stripe.com/docs/api/prices/object?lang=curl ,
however I see from the Stripe dashboard I can delete a Price. I also see that it calls API -
"method": "DELETE","url": "https://dashboard.stripe.com/v1/prices/price_1J68Y8BuQq6cUmE7UYLyucpI"
I know that once a subscription is associated to a price it can't be deleted and price should be archived, instead. However for testing E2E, when I set up a testbed on a test Stripe account I am creating a dummy Price. I should be allowed to delete it.
Would help to expose Delete Price API
The text was updated successfully, but these errors were encountered: