Delete a selling plan (soft delete)
API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2
DELETE
/external/preorders/{id}Costs 2 rate-limit points · Rate limits
Soft-delete a preorder selling plan by ID. The plan is discarded (its discarded_at is set) and detached from the storefront, but historical preorder data is preserved. Returns 404 if the plan does not exist and 422 if it could not be deleted.
Path parameters
idstringRequiredSelling plan ID
Headers
X-Auth-TokenstringRequiredAPI key for authentication
Returns
successbooleanExample:truemessagestringExample:Selling plan deleted
Errors
401
Unauthorized
404
Selling plan not found
422
Failed to delete selling plan
DELETE/external/preorders/{id}
curl -X DELETE "https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454", {
method: "DELETE",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.delete(
"https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454")
req = Net::HTTP::Delete.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)Response
{
"success": true,
"message": "Selling plan deleted"
}No body
No body
No body