iotoms Docs

Create an inventory location

POST
/api/v1/inventory/locations

Creates a new place that holds stock, such as a warehouse, store, van or manufacturing location. The location code must be unique, and the caller needs permission to manage locations. Store and van locations are also created automatically when stores and vehicles are added.

How to use it

  1. Choose a unique locationCode, a name and a locationType; optionally link a store (List stores), a vehicle (List vehicles) or a parent location.
  2. Set isDefault to true only for the warehouse that should act as the fallback stockroom.
  3. The location is created active and starts with no stock; add stock with Adjust stock on hand for an item.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

Request Body

application/json
  1. body
locationCode*string

Short unique code for the location. The call fails if another location already uses it.

locationName*string

Display name shown in stock screens and reports.

locationType*string

Kind of stockroom: WAREHOUSE, STORE, VAN, MANUFACTURING, TRANSIT, or QUARANTINE.

Value in"WAREHOUSE""STORE""VAN""MANUFACTURING""TRANSIT""QUARANTINE"
parentId?|

Optional parent location id, from List inventory locations, when this location sits inside another.

Formatuuid
storeId?|

Optional store this location belongs to, from List stores.

Formatint64
vehicleId?|

Optional vehicle this location belongs to, from List vehicles.

Formatuuid
isDefault*boolean

Whether to flag this as a default location. A default active warehouse is the fallback stockroom for registers with none set.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was handled, ERROR otherwise.

message*string

Short human-readable message describing the outcome, e.g. which record was fetched or saved.

data?

The inventory location.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/inventory/locations' \  -H 'Content-Type: application/json' \  -d '{  "locationCode": "string",  "locationName": "string",  "locationType": "WAREHOUSE",  "isDefault": true}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationCode": "string",    "locationName": "string",    "locationType": "WAREHOUSE",    "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",    "storeId": 0,    "vehicleId": "c406adf4-e700-4483-ad7a-e7447a2941cb",    "isDefault": true,    "isActive": true  }}