Skip to content

Queue a bulk update of inventory policy for multiple variants

API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2

POST/external/preorders/{id}/bulk_toggle_inventory_policy

Costs 2 rate-limit points · Rate limits

Queues a background job to update the inventory policy for multiple variants. The operation is performed asynchronously to handle large numbers of variants efficiently. Updates are processed in batches of up to 1000 variants to stay within message size limits.

Path parameters

  • idstringRequired

    Selling plan ID

Headers

  • X-Auth-TokenstringRequired

    API key for authentication

Request body

  • shopify_variant_idsarray of integersRequired

    Array of Shopify variant IDs to update

  • inventory_policystringRequired

    The inventory policy to set for the variants

    One of CONTINUEDENY

Returns

  • successboolean
    Example: true
  • messagestring
    Example: Inventory policy update queued
  • variants_queuedarray of integers

    List of variant IDs that were queued for processing

Errors

400

Bad request - missing or invalid parameters

401

Unauthorized

404

Selling plan not found

422

Invalid inventory policy

POST/external/preorders/{id}/bulk_toggle_inventory_policy
curl -X POST "https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454/bulk_toggle_inventory_policy" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "shopify_variant_ids": [
      43900910010503,
      43900910010999
    ],
    "inventory_policy": "CONTINUE"
  }'
Response
{
  "success": true,
  "message": "Inventory policy update queued",
  "variants_queued": [
    43900910010503,
    43900910010999
  ]
}