---
title: "Set total stock on storage locations"
method: PATCH
path: "/api/v1/storageLocations/setTotalStock"
tags: ["Storage Location"]
---

# Set total stock on storage locations

`PATCH /api/v1/storageLocations/setTotalStock`

This endpoint sets the total stock for one or more storage locations.<br>The stock data provided in the payload, including quality control attributes (batch, best-before date, and serial number), will be taken over as the new stock for the specified storage location(s).<br><br><strong>CAUTION: Any stock that was previously present in the storage location and is not specified in the payload will be removed from the storage location. This also includes the quality control attributes.</strong>

## Request body

- object
  - `data` object[]
    - `storageLocation` object
      - `id` string — Resource identifier.
    - `totalStock` object[]
      - `product` object
        - `id` string — Resource identifier.
      - `quantity` number
      - `qualityControlAttributes` object
        - `batch` string
        - `bestBeforeDate` string
        - `serialNumbers` object[]
          - `number` string, required

## Response `204`

Operation completed successfully, no response body

## Other responses

- `400` — IETF RFC 9457 Problem API compliant response
- `401` — Unable to authenticate the client
- `403` — Unable to authorize the client
- `404` — Resource was not found or not enough access privileges
- `415` — Resource representation send in the request is not supported.
- `429` — Too many API calls made.

---

[API](https://skmtc.net/xentral/apis/xentral-api.md) · [All operations](https://skmtc.net/xentral/apis/xentral-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xentral/xentral-api/versions/8a27ba392442/schema)
