---
title: "Adjust stock by location"
method: POST
path: "/api/inventory/stock/location/adjust"
tags: ["Inventory"]
---

# Adjust stock by location

`POST /api/inventory/stock/location/adjust`

## Request

- Base URL: `https://api.desty.app`
- URL: `https://api.desty.app/api/inventory/stock/location/adjust`
- Auth: none declared. Required headers: `Authorization`

* With FIFO/Average costing enabled, `SYNC` is unsupported and positive `ADD` requires `unitCost` per base unit.
* SKU-location pairs are processed separately. A failed pair does not roll back successful pairs; SKU-level errors can fail all pairs for that SKU. Check `failureList` for details.

### Request example

``` json
{
  "externalWarehouseId": "WH-DEMO",
  "adjustType": "ADD",
  "skus": [
    {
      "skuNumber": "SKU-DEMO-1",
      "locations": [
        {
          "locationId": 10001,
          "quantity": 5,
          "unitCost": 1000
        }
      ]
    }
  ]
}
```

## Headers

- `Authorization` string, required

## Request body

- object
  - `externalWarehouseId` string, required: External warehouse ID returned by POST /api/warehouse/list. Storage must be activated for this warehouse.
  - `adjustType` 'SYNC' | 'ADD' | 'MINUS', required: SYNC sets on-hand; ADD increases it; MINUS decreases it. Values are case-sensitive.
  - `skus` object[], required: At most 200 SKU-location pairs across the entire request.
    - `skuNumber` string, required: Existing Master SKU code. Do not repeat the same SKU in skus[].
    - `uom` string, nullable: Optional default SKU unit name, matched case-insensitively. locations[].uom takes precedence; omit/empty both to use the base unit.
    - `locations` object[], required: Location adjustments for this SKU. Do not repeat locationId within the same SKU.
      - `locationId` union, required: Storable location in the selected warehouse, including Default Storage. Organizational locations are not supported. The SKU must already be associated. 64-bit ID; send as a decimal string (recommended) or a number.
        - string
        - integer
      - `quantity` number, required: Nonnegative quantity: SYNC sets final on-hand; ADD/MINUS use an increment/decrement. After UOM conversion: 0–999999, up to 6 decimal places. Stock, reservation and in-progress stock-taking checks apply.
      - `uom` string, nullable: Optional configured SKU unit name, matched case-insensitively. Takes precedence over skus[].uom; if both are omitted/empty, use the base unit.
      - `unitCost` number, nullable: Optional cost per BASE unit in IDR; 0–150000000, up to 6 decimal places. Required for a positive ADD when FIFO/Average costing is enabled. Not converted when uom is supplied.

## Response `200`

successful operation

- object
  - `code` string, required: Business result code: "0" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR. SERVER_ERROR with msg "Previous setting is still in progress" means another request for the same tenant is still running; it is retryable after a few seconds.
  - `msg` string, nullable: Result message; normally null on success.
  - `data` object, nullable
    - `failureList` object[], required: Failed SKU-location pairs; successful pairs are not listed. code="0" does not mean every pair succeeded. Empty means no reported failures.
      - `locationId` string, nullable: Failed location ID; null when the failure cannot be assigned to a location. 64-bit ID returned as a decimal string.
      - `skuNumber` string, nullable: Failed Master SKU code.
      - `reason` string, nullable: Failure reason.
  - `success` boolean, required: True when code equals "0".

## Changes

- **2026-11-06** `4946760fb77d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/desty/apis/desty-omni-openapi-2026-6-26/changes/api/inventory/stock/location/adjust/post.md)

---

[API](https://skmtc.dev/desty/apis/desty-omni-openapi-2026-6-26.md) - [All operations](https://skmtc.dev/desty/apis/desty-omni-openapi-2026-6-26/llms.txt) - [OpenAPI document](https://skmtc.dev/desty/apis/desty-omni-openapi-2026-6-26/revisions/4946760fb77d?raw)
