POST /stock-movements Deprecated

Create a Stock Movement

This endpoint allows you to create a Stock Movement. A stock movevement correspondes to an action executed in a warehouse for a material. A stock movement can have the following actions:

  • MOVED: stock movement between two warehouses
  • ADDED: stock addition in a warehouse
  • CONSUMED: material consumption in a work order or planned job order
Operation ID: createStockMovement
lock This endpoint requires a Bearer token in the Authorization header.

Request Body

Content-Type: application/json · Required fields: _type, action, warehouse_id, stocks

_type string required

Type of the stock movement

stock-movement
action string required

Action performed in this stock movement

ABATE ADD CONSUME MOVE
warehouse_id integer required

ID of the Origin warehouse of the stock movement

destination_warehouse_id integer

ID of the destination warehouse of the stock movement (Required if action is MOVE)

element_registry_id integer

ID of the associated element registry

failure_id integer

ID of the associated failure

order_id integer

ID of the associated order

request_id integer

ID of the associated request

schedule_work_id integer

ID of the associated schedule work

observation string

Description or notes about the stock movement

stocks array<object> required

The stocks altered in the stock movement. This field is an array of stock objects.

material_id integer

ID of the associated Material. (required)

quantity number

Quantity of the associated Material. (required and greater than 0)

Responses

data object

Stock Movement model structure details

id string required read-only

ID of the Stock Movement

type string required read-only

Model type

stock-movement
attributes object required
stock_movement_id integer read-only

ID of the Stock Movement

Example: 1

warehouse_id integer read-only

ID of the warehouse associated to the Stock Movement

observation string | null read-only

Description or notes about the Stock Movement

date string (date-time) read-only

Example: 2020-08-28 08:48:00

action string read-only

The action performed in this Stock Movement

ADDED CONSUMED MOVED
failure_id integer | null read-only

Id of the associated Failure

schedule_work_id integer | null read-only

Id of the associated Schedule Work

order_id integer | null read-only

Id of the associated Order

request_id integer | null read-only

Id of the associated Request

element_registry_id integer | null read-only

Id of the associated Element Registry

status string
error
error object
properties object

Only present when related to property validation error

dev_message string

Example: Property validation error. Check the "properties" section in the response.

http_code integer
400
message string

Example: Property validation error.

more_info string
status string
error
error object
http_code integer
401
message string

Example: Authentication token invalid.

more_info string
status string
error
error object
http_code integer
429
message string

Example: Too Many Requests.

more_info string
status string
error
error object
http_code integer
500
message string

Example: An error has occurred during the request.

more_info string