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_policyCosts 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
idstringRequiredSelling plan ID
Headers
X-Auth-TokenstringRequiredAPI key for authentication
Request body
shopify_variant_idsarray of integersRequiredArray of Shopify variant IDs to update
inventory_policystringRequiredThe inventory policy to set for the variants
One ofCONTINUEDENY
Returns
successbooleanExample:truemessagestringExample:Inventory policy update queuedvariants_queuedarray of integersList 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"
}'const res = await fetch("https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454/bulk_toggle_inventory_policy", {
method: "POST",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"shopify_variant_ids": [
43900910010503,
43900910010999
],
"inventory_policy": "CONTINUE"
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454/bulk_toggle_inventory_policy",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
json={
"shopify_variant_ids": [
43900910010503,
43900910010999
],
"inventory_policy": "CONTINUE"
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v1/external/preorders/79b44c6c-ebc7-41d4-8a1b-573d7c693454/bulk_toggle_inventory_policy")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"], "Content-Type" => "application/json")
req.body = {
shopify_variant_ids: [
43900910010503,
43900910010999
],
inventory_policy: "CONTINUE"
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)Response
{
"success": true,
"message": "Inventory policy update queued",
"variants_queued": [
43900910010503,
43900910010999
]
}No body
No body
No body
No body