POST
/
api
/
inventories
/
{id}
/
move
Move inventory to another location
curl --request POST \
  --url http://localhost:3000/api/inventories/{id}/move \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "quantity": 2,
  "toLocation": "<string>",
  "toStorageColor": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "source": {
      "_id": "<string>",
      "material": "<string>",
      "quantity": 123,
      "location": "<string>",
      "storageColor": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "target": {
      "_id": "<string>",
      "material": "<string>",
      "quantity": 123,
      "location": "<string>",
      "storageColor": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "movedQuantity": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Resource ID

Body

application/json
quantity
number
required

Amount to move

Required range: x >= 1
toLocation
string
required

Destination location name

Minimum string length: 1
toStorageColor
string

Storage color at destination (optional)

Response

Inventory moved successfully

success
boolean
Example:

true

message
string
data
object