Queue a bulk update of inventory policy for multiple variants
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/bulk_toggle_inventory_policy';const options = { method: 'POST', headers: {'X-Auth-Token': '<X-Auth-Token>', 'Content-Type': 'application/json'}, body: '{"shopify_variant_ids":[43900910010503,43900910010999],"inventory_policy":"CONTINUE"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.stoqapp.com/api/v1/external/preorders/example/bulk_toggle_inventory_policy \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: <X-Auth-Token>' \ --data '{ "shopify_variant_ids": [ 43900910010503, 43900910010999 ], "inventory_policy": "CONTINUE" }'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.
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
Request Bodyrequired
Section titled “Request Bodyrequired”object
Array of Shopify variant IDs to update
The inventory policy to set for the variants
Example
{ "shopify_variant_ids": [ 43900910010503, 43900910010999 ], "inventory_policy": "CONTINUE"}Responses
Section titled “Responses”Inventory policy update has been queued successfully
object
List of variant IDs that were queued for processing
Example
{ "success": true, "message": "Inventory policy update queued", "variants_queued": [ 43900910010503, 43900910010999 ]}Bad request - missing or invalid parameters
object
Example generated
{ "error": "example"}Unauthorized
Selling plan not found
object
Example generated
{ "error": "example"}Invalid inventory policy
object
Example generated
{ "error": "example"}Thanks for letting us know.
Still stuck? Ask Quinn or chat with support