Skip to content

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

POST
/external/preorders/{id}/bulk_toggle_inventory_policy
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.

id
required
string

Selling plan ID

X-Auth-Token
required
string

API key for authentication

Media typeapplication/json
object
shopify_variant_ids
required

Array of Shopify variant IDs to update

Array<integer>
inventory_policy
required

The inventory policy to set for the variants

string
Allowed values: CONTINUE DENY

Example

{
"shopify_variant_ids": [
43900910010503,
43900910010999
],
"inventory_policy": "CONTINUE"
}

Inventory policy update has been queued successfully

Media typeapplication/json
object
success
boolean
message
string
variants_queued

List of variant IDs that were queued for processing

Array<integer>

Example

{
"success": true,
"message": "Inventory policy update queued",
"variants_queued": [
43900910010503,
43900910010999
]
}

Bad request - missing or invalid parameters

Media typeapplication/json
object
error
string

Example generated

{
"error": "example"
}

Unauthorized

Selling plan not found

Media typeapplication/json
object
error
string

Example generated

{
"error": "example"
}

Invalid inventory policy

Media typeapplication/json
object
error
string

Example generated

{
"error": "example"
}
Was this page helpful?

Still stuck? Ask Quinn or chat with support