---
title: "Create locations in batch"
method: POST
path: "/api/warehouse/location/add"
tags: ["Warehouse"]
---

# Create locations in batch

`POST /api/warehouse/location/add`

## Request

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

* The selected level determines STORAGE or ORGANIZATIONAL; individual locations cannot override it.
* Limits include existing locations: 150 direct children per parent, 149 normal warehouse-root locations, and 5,000 locations per warehouse including Default Storage.
* The first successful creation activates storage\. The entire creation request is atomic\. Name validation failures return INVALID\_PARAMETER with all errors in data\.errors\[\]\, each containing index\, locationName and reason\. The index is zero\-based and locationName preserves the original input\. Capacity failures return INVALID\_PARAMETER with current\, limit and requested counts in msg and data=null\. If both limits are exceeded\, both reasons are returned\.

### Request example

``` json
{
  "externalWarehouseId": "WH-DEMO",
  "parentLocationId": 10000,
  "level": 7,
  "locationNames": [
    "Bin A",
    "Bin B"
  ]
}
```

Deleting a location is not available via OpenAPI. Use Desty Omni (WMS > Manajemen Penyimpanan) to delete it.

## Headers

- `Authorization` string, required

## Request body

- object
  - `externalWarehouseId` string, required: External warehouse ID returned by POST /api/warehouse/list. The warehouse must belong to the authenticated tenant.
  - `parentLocationId` union: Optional parent in the same warehouse. Omitted/null creates warehouse-root locations. Default Storage cannot be the parent. 64-bit ID; send as a decimal string (recommended) or a number.
    - string
    - integer
  - `level` integer, required: Target level NUMBER from /api/warehouse/location/level/list, not levelId. Must be deeper than the parent's level.
  - `locationNames` string[], required: Final names under the same warehouse, parent and level. Trimmed names must be nonblank, at most 20 characters, and unique within the batch and warehouse.

## 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` union
    - object
      - `activatedByThisCall` boolean, required: True when storage was inactive before this successful create request.
      - `results` object[], required: Created locations.
        - `locationId` string, required: Created location ID. 64-bit ID returned as a decimal string.
        - `locationName` string, required: Created location name.
        - `level` integer, required: Actual level number of the created location. Skipped levels are supported.
        - `parentLocationId` string, nullable, required: 64-bit parent location ID encoded as a decimal string. Null for locations created directly under the warehouse.
        - `path` string, required: Full location path prefixed by the warehouse name. Hierarchy segments are separated by " / ". Uses the final name saved by SCM.
      - `errors` object[]: All name validation errors. Returned with code INVALID_PARAMETER and no locations created. Each duplicate input occurrence is reported.
        - `index` integer, required: Zero-based index in the original locationNames array.
        - `locationName` string, nullable, required: Original input name, including whitespace or null.
        - `reason` string, required: Validation failure reason for this input name.
    - object
      - `activatedByThisCall` boolean: True when storage was inactive before this successful create request.
      - `results` object[]: Created locations.
        - `locationId` string, required: Created location ID. 64-bit ID returned as a decimal string.
        - `locationName` string, required: Created location name.
        - `level` integer, required: Actual level number of the created location. Skipped levels are supported.
        - `parentLocationId` string, nullable, required: 64-bit parent location ID encoded as a decimal string. Null for locations created directly under the warehouse.
        - `path` string, required: Full location path prefixed by the warehouse name. Hierarchy segments are separated by " / ". Uses the final name saved by SCM.
      - `errors` object[], required: All name validation errors. Returned with code INVALID_PARAMETER and no locations created. Each duplicate input occurrence is reported.
        - `index` integer, required: Zero-based index in the original locationNames array.
        - `locationName` string, nullable, required: Original input name, including whitespace or null.
        - `reason` string, required: Validation failure reason for this input name.
  - `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/add/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)
