> 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/set-stock-for-product-in-specified-warehouse.md).

# Set stock for product in specified warehouse

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.

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":{"AdjustStockRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustStockRequestSchema"}}},"description":"Adjust stock Request Body"}},"schemas":{"AdjustStockRequestSchema":{"title":"AdjustStockRequestSchema","type":"object","required":["reason"],"properties":{"averageCost":{"description":"set new average cost","type":"integer"},"quantity":{"description":"set new stock quantity","type":"integer"},"changeQuantity":{"description":"make stock adjustment","type":"integer"},"reason":{"type":"string"},"serialnumbers":{"description":"Array of strings to identify serial numbers for the quantity in stock. Length of array must match the quantity value.\nThis field is required when product has serialNoRequired = \"ON_RECEIVE\"\n","type":"array","items":{"type":"string"}}}},"NullableStockResponseSchema":{"title":"NullableStockResponseSchema","type":"object","nullable":true,"properties":{"averageCost":{"type":"integer"},"locationLabel":{"type":"string"},"maxStockLevel":{"type":"integer"},"minStockLevel":{"type":"integer"},"productUid":{"$ref":"#/components/schemas/UID"},"productSku":{"type":"string"},"quantityReserved":{"type":"integer"},"quantityStock":{"type":"integer"},"warehouseUid":{"$ref":"#/components/schemas/UID"},"warehouseName":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"}},"required":["averageCost","locationLabel","maxStockLevel","minStockLevel","productUid","productSku","quantityReserved","quantityStock","warehouseUid","warehouseName","storeUid","storeName"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}},"responses":{"NullableStockResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NullableStockResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/warehouses/{warehouseUid}/stock/{productUid}":{"put":{"description":"The 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\nRequired permissions: WAREHOUSE","operationId":"put-tenants-stores-warehouses-stock-adjust","requestBody":{"$ref":"#/components/requestBodies/AdjustStockRequest"},"responses":{"200":{"$ref":"#/components/responses/NullableStockResponse"}},"summary":"Set stock for product in specified 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/set-stock-for-product-in-specified-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.
