> For the complete documentation index, see [llms.txt](https://docs.stoqapp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoqapp.com/preorders-api/update-selling-policy.md).

# Update Selling Policy

## Queue a bulk update of inventory policy for multiple variants

> 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.<br>

```json
{"openapi":"3.0.3","info":{"title":"Preorders API","version":"1.0.0"},"servers":[{"url":"https://app.stoqapp.com/api/v1/external","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Auth-Token"}}},"paths":{"/preorders/{id}/bulk_toggle_inventory_policy":{"post":{"summary":"Queue a bulk update of inventory policy for multiple variants","description":"Queues a background job to update the inventory policy for multiple variants.\nThe operation is performed asynchronously to handle large numbers of variants efficiently.\nUpdates are processed in batches of up to 1000 variants to stay within message size limits.\n","tags":["Preorders"],"parameters":[{"in":"header","name":"X-Auth-Token","required":true,"schema":{"type":"string"},"description":"API key for authentication"},{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Selling plan ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopify_variant_ids":{"type":"array","items":{"type":"integer"},"description":"Array of Shopify variant IDs to update"},"inventory_policy":{"type":"string","enum":["CONTINUE","DENY"],"description":"The inventory policy to set for the variants"}},"required":["shopify_variant_ids","inventory_policy"]}}}},"responses":{"200":{"description":"Inventory policy update has been queued successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"variants_queued":{"type":"array","items":{"type":"integer"},"description":"List of variant IDs that were queued for processing"}}}}}},"400":{"description":"Bad request - missing or invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Selling plan not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"Invalid inventory policy","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stoqapp.com/preorders-api/update-selling-policy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
