Remove multiple product variants from a selling plan
API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2
/external/preorders/{id}/remove_variantCosts 2 rate-limit points · Rate limits
Remove multiple product variants from a selling plan. Optionally, you can also update the inventory policy of the removed variants in the same request to avoid making separate API calls.
When inventory_policy is provided, the inventory policy update is performed synchronously (inline)
for better performance and to avoid race conditions.
Path parameters
idstringRequiredSelling plan ID
Query parameters
shopify_variant_idsarrayRequiredArray of Shopify variant IDs to remove
inventory_policystringOptional. Inventory policy to set for the removed variants. CONTINUE allows overselling, DENY prevents it.
One ofCONTINUEDENY
Headers
X-Auth-TokenstringRequiredAPI key for authentication
Returns
successbooleanExample:truemessagestringExample:1 variant removedvariants_removedarray of integersList of variant IDs that were removed
inventory_policy_updatedbooleanWhether the inventory policy was successfully updated (only present when inventory_policy is provided)
inventory_policystringThe inventory policy that was set (only present when inventory_policy_updated is true)
One ofCONTINUEDENY
Errors
Bad request - missing or invalid parameters
Unauthorized
Selling plan or variants not found
Failed to remove variants or invalid inventory policy
curl -X DELETE "https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454/remove_variant?shopify_variant_ids=SHOPIFY_VARIANT_IDS" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454/remove_variant?shopify_variant_ids=SHOPIFY_VARIANT_IDS", {
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/remove_variant?shopify_variant_ids=SHOPIFY_VARIANT_IDS",
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/remove_variant?shopify_variant_ids=SHOPIFY_VARIANT_IDS")
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){
"success": true,
"message": "1 variant removed",
"variants_removed": [
43900910010503
],
"inventory_policy_updated": true,
"inventory_policy": "DENY"
}