Skip to content

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

DELETE/external/preorders/{id}/remove_variant

Costs 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

  • idstringRequired

    Selling plan ID

Query parameters

  • shopify_variant_idsarrayRequired

    Array of Shopify variant IDs to remove

  • inventory_policystring

    Optional. Inventory policy to set for the removed variants. CONTINUE allows overselling, DENY prevents it.

    One of CONTINUEDENY

Headers

  • X-Auth-TokenstringRequired

    API key for authentication

Returns

  • successboolean
    Example: true
  • messagestring
    Example: 1 variant removed
  • variants_removedarray of integers

    List of variant IDs that were removed

  • inventory_policy_updatedboolean

    Whether the inventory policy was successfully updated (only present when inventory_policy is provided)

  • inventory_policystring

    The inventory policy that was set (only present when inventory_policy_updated is true)

    One of CONTINUEDENY

Errors

400

Bad request - missing or invalid parameters

401

Unauthorized

404

Selling plan or variants not found

422

Failed to remove variants or invalid inventory policy

DELETE/external/preorders/{id}/remove_variant
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"
Response
{
  "success": true,
  "message": "1 variant removed",
  "variants_removed": [
    43900910010503
  ],
  "inventory_policy_updated": true,
  "inventory_policy": "DENY"
}