/stocks/materials
This endpoint allows you to list all the materials.
getAllStockMaterials
| Name | Type | Description |
|---|---|---|
expanded
|
string |
Comma-separated list of relations to include in the response material_type
warehouse
supplier_custom_price
|
searchText
|
string |
Text string to search for |
sort
|
string |
Name of the attribute to use for sort order material_id
code
name
description
sku
ean_upc
updated_at
|
order
|
string |
Direction of the ordering asc
desc
|
page
|
integer |
The page number (1-based) to retrieve the results, according to the `limit` defined |
limit
|
integer |
Limit to restrict the number of entries per page |
materialTypeId
|
integer |
Filter by material type id. |
s_material_type_id
|
integer |
Filter by material type id. |
materialTypeFolderId
|
integer |
Filter by material type folder id. |
s_material_type_folder_id
|
integer |
Filter by material type folder id. |
include_pending_delivery_quantity
|
boolean |
Include pending_delivery_quantity field. 1
|
include_stock_on_hand
|
boolean |
Include stock_on_hand field. 1
|
include_warehouse_minimum_stock
|
boolean |
Include warehouse_minimum_stocks array. 1
|
date_max_updated_at
|
string |
Filter by maximum updated_at. |
s_updated_at_before
|
string |
Filter by maximum updated_at. |
date_min_updated_at
|
string |
Filter by minimum updated_at. |
s_updated_at_after
|
string |
Filter by minimum updated_at. |
s_code
|
string |
Filter by material code. |
s_material_id_notin
|
string |
Exclude materials by id. It should be separated by comma in case of multiple ids |
data
array<object>
id
string
required
read-only
ID of the Material
Example: 1
type
string
required
read-only
Model type
stock-material
Example: stock-material
attributes
object
required
material_id
string
read-only
ID of the material
Example: 1
material_type_id
string
read-only
ID of the material type
Example: 11
name
string
Name of the material
Example: Chair
code
string
Code of the material
Example: CH-00001
purchase_consumption_type
string
Purchase consumption type of the material
INHERIT
AUTOMATIC
MANUAL
Example: INHERIT
units
string
Indicates which kind of unit should this material be measured with
Example: un
observations
string | null
Material observations
Example: This is a observation
description
string
Description of the material
Example: This is a chair
sku
string | null
SKU of the material
Example: SKU-00001
ean_upc
string | null
EAN/UPC of the material
Example: 1234567890123
sale_price
number
Sale price of the material
Example: 10
sale_vat
number
Sale VAT of the material
Example: 23
created_at
string | null
read-only
Date of creation
Example: 2021-07-21 18:38:00
updated_at
string | null
read-only
Last update date
Example: 2021-07-21 18:38:00
warehouses_minimum_stocks
array<object>
warehouse_id
integer
Example: 1
warehouse_name
string
Example: Warehouse
minimum_quantity
integer
Example: 10
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
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 GET \
'https://api.sandbox.infraspeak.com/v3/stocks/materials' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/stocks/materials', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->get('https://api.sandbox.infraspeak.com/v3/stocks/materials');
import requests
response = requests.get(
'https://api.sandbox.infraspeak.com/v3/stocks/materials',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
)
data = response.json()