PATCH /stocks/{stock} Deprecated

Update Stock

This endpoint allows you to update a specific Stock.

A stock represents a quantity of material that it is available in a warehouse that can be consumed, moved or added. A stock is always associated with a stock movement.

Operation ID: updateStock
lock This endpoint requires a Bearer token in the Authorization header.

Path Parameters

Name Type Description
stock required
path
string

The stock ID

Request Body

Content-Type: application/json

material_id integer

ID of the material associated with the stock

Example: 1

quantity number

Quantity of the material associated with the stock

Example: 50

warehouse_id integer

The ID of the warehouse associated with the stock

Example: 1

failure_id integer

The ID of the failure associated with the stock

Example: 1

schedule_work_id integer

The ID of the schedule work associated with the stock

Example: 1

mean_price number

The mean price of the material associated with the stock

Example: 10

Responses

data object

Stock model structure details

id string required read-only

ID of the Stock

type string required read-only

Model type

stock
attributes object required
stock_id integer read-only

ID of the Stock

Example: 1

stock_movement_id integer | null read-only

ID of the last Stock Movement of the Stock

Example: 1

action string | null read-only

Action performed for the stock

warehouse_id integer | null read-only

ID of the warehouse associated with the stock

material_id integer read-only

ID of the material associated with the stock

quantity number read-only

Quantity of the material present in the stock

mean_price number | null read-only

Mean price of the material associated with the stock

observation string | null read-only

Description or notes of the stock

date string (date-time) | null read-only

Example: 2020-08-28 17:12:00

failure_id integer | null read-only

ID of the failure associated with the stock

schedule_work_id integer | null read-only

ID of the schedule work associated with this stock

mean_price_manually_updated boolean read-only

Mean price of the stock (if it was manually updated)

date_updated string (date-time) | null read-only

Example: 2020-08-28 17:12:00

destination_id integer read-only

ID of the destination warehouse of the stock. Only present if the stock action is "MOVED_FROM"

source_id integer read-only

ID of the origin warehouse of the stock. Only present if the stock action is "MOVED_TO"

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
404
message string

Example: Resource not found

more_info string | null
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