---
title: "Allocate SKUs to locations"
method: POST
path: "/api/warehouse/location/allocate"
tags: ["Warehouse"]
---

# Allocate SKUs to locations

`POST /api/warehouse/location/allocate`

## Request

- Base URL: `https://api.desty.app`
- URL: `https://api.desty.app/api/warehouse/location/allocate`
- Auth: none declared. Required headers: `Authorization`

Creates zero-stock SKU-location associations without moving Default Storage or changing quantities.

Each location-SKU pair is processed independently. Check data.failureList for failed pairs with locationId, skuNumber and reason. Requests are limited to 200 original input pairs, including duplicate or invalid inputs. Requests above the limit return INVALID_PARAMETER before allocation.

### Request example

``` json
{
  "externalWarehouseId": "WH-DEMO",
  "allocations": [
    {
      "locationId": 10001,
      "skuNumbers": [
        "SKU-DEMO-1",
        "SKU-DEMO-2"
      ]
    }
  ]
}
```

Removing a product allocation from a location is not available via OpenAPI. Use Desty Omni (Inventori > Pengaturan Inventori > Penyesuaian Stok) to remove it.

## Headers

- `Authorization` string, required

## Request body

- object
  - `externalWarehouseId` string, required: External warehouse ID from /api/warehouse/list. Storage must already be activated.
  - `allocations` object[], required: Nonempty allocation groups. Each location-SKU pair is processed independently: an invalid SKU, a duplicate SKU entry or an existing association fails only that pair (see data.failureList); other pairs continue.
    - `locationId` union, required: Normal STORAGE location in the selected warehouse. Organizational and Default Storage are not supported. 64-bit ID; send as a decimal string (recommended) or a number.
      - string
      - integer
    - `skuNumbers` string[], nullable: Existing Master SKU codes; bundle-parent SKUs are not supported. Omitted/null/empty arrays are skipped.

## 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 location-SKU pairs, identified by locationId and skuNumber. Successful pairs are omitted. code="0" can include pair failures. Empty means no reported failures.
      - `locationId` string, nullable: Failed target location ID; may be null if missing in the request. 64-bit ID returned as a decimal string.
      - `reason` string, nullable: Failure reason.
      - `skuNumber` string, nullable, required: SKU number of the failed location-SKU pair, preserving the submitted value. May be null for an invalid or missing SKU input.
  - `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/warehouse/location/allocate/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)
