/stock-movements
Deprecated
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 warehousesADDED: stock addition in a warehouseCONSUMED: material consumption in a work order or planned job ordercreateStockMovement
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)
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
curl -X POST \
'https://api.sandbox.infraspeak.com/v3/stock-movements' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"_type": "",
"action": "",
"warehouse_id": 0,
"destination_warehouse_id": 0,
"element_registry_id": 0,
"failure_id": 0,
"order_id": 0,
"request_id": 0,
"schedule_work_id": 0,
"observation": "",
"stocks": []
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/stock-movements', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"_type": "",
"action": "",
"warehouse_id": 0,
"destination_warehouse_id": 0,
"element_registry_id": 0,
"failure_id": 0,
"order_id": 0,
"request_id": 0,
"schedule_work_id": 0,
"observation": "",
"stocks": []
}),
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->post('https://api.sandbox.infraspeak.com/v3/stock-movements',
array (
'_type' => '',
'action' => '',
'warehouse_id' => 0,
'destination_warehouse_id' => 0,
'element_registry_id' => 0,
'failure_id' => 0,
'order_id' => 0,
'request_id' => 0,
'schedule_work_id' => 0,
'observation' => '',
'stocks' =>
array (
),
)
);
import requests
response = requests.post(
'https://api.sandbox.infraspeak.com/v3/stock-movements',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"_type": "",
"action": "",
"warehouse_id": 0,
"destination_warehouse_id": 0,
"element_registry_id": 0,
"failure_id": 0,
"order_id": 0,
"request_id": 0,
"schedule_work_id": 0,
"observation": "",
"stocks": []
}
},
)
data = response.json()