> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/warehouse/batch-set-stock-for-a-list-of-products-in-a-warehouse.md).

# BATCH Set stock for a list of products in a warehouse

Change stock for a list of products in a warehouse (max 1000 entries).

The request contains two quantity fields `quantity` and `changeQuantity`. Both may not be set in the same entry.\
Use `quantity` to set a new total stock for the product.\
Use `changeQuantity` to adjust the product's stock by a positive or negative number to increase or decrease stock.\
Use `averageCost` to perform new calculation of stock average cost.\
At least one of these three fields must be set on each entry.

If an error is returned, no changes have been made, all changes are rolled back. The error is a description of the first error met.

Required permissions: WAREHOUSE

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Warehouse","description":"Warehouse"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"BatchAdjustStockRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchAdjustStockRequestSchema"}}},"description":"BATCH Adjust stock Request Body"}},"schemas":{"BatchAdjustStockRequestSchema":{"title":"BatchAdjustStockRequestSchema","type":"object","properties":{"upsert":{"items":{"$ref":"#/components/schemas/BatchAdjustStockSchema"},"maxItems":1000,"type":"array"}},"required":["upsert"]},"BatchAdjustStockSchema":{"title":"BatchAdjustStockSchema","type":"object","required":["productUid","reason"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"averageCost":{"description":"set new average cost","type":"integer"},"quantity":{"description":"set new stock quantity","type":"integer","minimum":0},"changeQuantity":{"type":"integer","description":"make stock adjustment"},"reason":{"type":"string"},"serialnumbers":{"description":"the number of serialnumbers must match the quantity/changeQuantity","type":"array","items":{"type":"string"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"BatchAdjustStockResponseSchema":{"title":"BatchAdjustStockResponseSchema","type":"object","properties":{"upsert":{"items":{"$ref":"#/components/schemas/BatchResponseItemProductSchema"},"maxItems":1000,"type":"array"}},"required":["upsert"]},"BatchResponseItemProductSchema":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/BatchErrorProductSchema"},"type":"array"},"success":{"type":"integer"}},"required":["success","errors"],"title":"BatchResponseItemProductSchema","type":"object"},"BatchErrorProductSchema":{"properties":{"errorCode":{"type":"string"},"message":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"}},"required":["productUid","errorCode","message"],"title":"BatchErrorProductSchema","type":"object"}},"responses":{"AdjustStockBatchResponse":{"description":"The success field indicate how many of the products that where successfully updated. \nThe errors field will contain the products that failed to update.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchAdjustStockResponseSchema"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/warehouses/{warehouseUid}/stock/batch":{"put":{"description":"Change stock for a list of products in a warehouse (max 1000 entries). \n\nThe request contains two quantity fields `quantity` and `changeQuantity`. \nBoth may not be set in the same entry.  \nUse `quantity` to set a new total stock for the product.  \nUse `changeQuantity` to adjust the product's stock by a positive or negative number to \nincrease or decrease stock.  \nUse `averageCost` to perform new calculation of stock average cost.  \nAt least one of these three fields must be set on each entry.\n\nIf an error is returned, no changes have been made, all changes are rolled back.\nThe error is a description of the first error met.\n\nRequired permissions: WAREHOUSE","operationId":"put-tenants-stores-warehouses-stock-adjust-batch","requestBody":{"$ref":"#/components/requestBodies/BatchAdjustStockRequest"},"responses":{"200":{"$ref":"#/components/responses/AdjustStockBatchResponse"},"207":{"$ref":"#/components/responses/AdjustStockBatchResponse"}},"summary":"BATCH Set stock for a list of products in a warehouse","tags":["Warehouse"]}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/warehouse/batch-set-stock-for-a-list-of-products-in-a-warehouse.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
