/stocks/warehouses/{warehouseId}/stock-transactions
This endpoint allows you to record transactions affecting the stock levels of a specific warehouse.
postStockWarehousesStockTransactions
| Name | Type | Description |
|---|---|---|
warehouseId
required
|
string |
The unique identifier of the warehouse within the system. This ID is immutable and assigned upon creation. Example: |
Content-Type: application/json
· Required fields: action, transactions
action
string
required
Specifies the type of stock transaction being performed as a batch.
WAREHOUSE_SUBTRACT
WAREHOUSE_ADD
observations
string
General notes or details applicable to the entire batch of stock transactions.
transactions
array<object>
required
An array containing details for one or more individual stock transactions to be recorded.
material_id
integer
required
The unique identifier of the specific material involved in this transaction.
quantity
integer
required
The quantity of the material being transacted.
observations
string
Specific notes or details related to this individual material's transaction within the batch.
cost_price
integer
required
The cost price associated with this material at the time of the transaction. This is typically the purchase price or standard cost.
data
array<object>
id
string
read-only
UUID of the transaction batch
type
string
read-only
Model type
stock-transaction-batch
attributes
object
stock_transaction_batch_id
string
UUID of the transaction batch
Example: 019169e9-1210-7eef-882f-39c6332a156e
operator_id
integer
ID of the operator
Example: 1
action
string
Transaction's action
TRANSFER_STOCK
WAREHOUSE_SUBTRACT
WAREHOUSE_ADD
MATERIAL_SUBTRACT
MATERIAL_ADD
CONSUME
PURCHASE
Example: TRANSFER_STOCK
observations
string | null
Transaction batch observations
source_id
integer
Transaction batch source model id
Example: 25
source_type
string
Transaction batch source model type
FAILURE
SCHEDULED_WORK_ORDER
ORDER
ELEMENT
MANUAL
Example: FAILURE
date_created
string (date-time) | null
read-only
Transaction batch creation timestamp (ISO 8601)
Example: 2026-05-22T10:15:30+00:00
date_updated
string (date-time) | null
read-only
Transaction batch last update timestamp (ISO 8601)
Example: 2026-05-22T10:15:30+00:00
included
array<object>
List of relationships to be included
id
string
read-only
ID of the transaction
type
string
read-only
Model type
stock-transaction
attributes
object
warehouse_id
integer
ID of the warehouse
Example: 1
material_id
integer
ID of the material
Example: 1
quantity
integer
Transaction's quantity
Example: 25
action
string
Transaction's action
ADD
SUBTRACT
Example: SUBTRACT
observations
string | null
Transaction's observations
cost_price
integer
Transaction's associated price
Example: 25
created_at
string
Transaction's created date
Example: 2024-08-16T13:33:39.000000Z
operator_id
integer
ID of the operator
Example: 1
stock_transaction_batch_id
integer
read-only
ID of the parent transaction batch
Example: 1
meta
object
Meta model structure details
pagination
object
total
integer
required
Total items.
Example: 1
count
integer
required
Total items returned for the current page.
Example: 1
per_page
integer
required
Maximum number of records per page.
Example: 1
current_page
integer
required
Number of the current page.
total_pages
integer
required
Number of the total pages.
links
object
Requests that return multiple items include a `links` attribute, with links related to request's context.
self
string
required
read-only
Current response link.
Example: /path?page=1
first
string
required
read-only
Link to the first page result.
Example: /path?page=1
last
string
required
read-only
Link to the previous page result.
Example: /path?page=1
next
string
read-only
Link to the next page result.
Example: /path?page=1
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/stocks/warehouses/1/stock-transactions' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"action": "",
"observations": "",
"transactions": []
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/stocks/warehouses/1/stock-transactions', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"action": "",
"observations": "",
"transactions": []
}),
});
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/stocks/warehouses/1/stock-transactions',
array (
'action' => '',
'observations' => '',
'transactions' =>
array (
),
)
);
import requests
response = requests.post(
'https://api.sandbox.infraspeak.com/v3/stocks/warehouses/1/stock-transactions',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"action": "",
"observations": "",
"transactions": []
}
},
)
data = response.json()