Remove multiple product variants from a selling plan
LegacyAPI v1 is the older API. It still works and is supported, but new integrations should use API v2. Migrating from v1 to v2
const url = 'https://app.stoqapp.com/api/v1/external/preorders/example/remove_variant?shopify_variant_ids=1&inventory_policy=CONTINUE';const options = {method: 'DELETE', headers: {'X-Auth-Token': '<X-Auth-Token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://app.stoqapp.com/api/v1/external/preorders/example/remove_variant?shopify_variant_ids=1&inventory_policy=CONTINUE' \ --header 'X-Auth-Token: <X-Auth-Token>'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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Selling plan ID
Header Parameters
Section titled “Header Parameters”API key for authentication
Query Parameters
Section titled “Query Parameters”Array of Shopify variant IDs to remove
Optional. Inventory policy to set for the removed variants. CONTINUE allows overselling, DENY prevents it.
Responses
Section titled “Responses”Variants removed successfully
object
List of variant IDs that were removed
Whether the inventory policy was successfully updated (only present when inventory_policy is provided)
The inventory policy that was set (only present when inventory_policy_updated is true)
Example
{ "success": true, "message": "1 variant removed", "variants_removed": [ 43900910010503 ], "inventory_policy_updated": true, "inventory_policy": "DENY"}Bad request - missing or invalid parameters
object
Example generated
{ "error": "example"}Unauthorized
Selling plan or variants not found
object
Example generated
{ "error": "example"}Failed to remove variants or invalid inventory policy
object
Example generated
{ "error": "example"}Thanks for letting us know.
Still stuck? Ask Quinn or chat with support