/stocks/material-types/{materialTypeId}
This endpoint allows the user to change data from a specific Material Type.
updateMaterialType
| Name | Type | Description |
|---|---|---|
materialTypeId
required
|
string |
The material type ID |
Content-Type: application/json
name
string
Name of the material type.
Example: Material Type 1
code
string
Code of the material type. Needs to be unique.
Example: MT1
data
object
MaterialType model structure details
id
string
read-only
ID of the Material Type
Example: 1
type
string
read-only
Model type
stock-material-type
attributes
object
material_type_id
string
read-only
ID of the material type
Example: 1
parent_id
string
ID of the associated parent folder of the material type
Example: 1
name
string
Name of the material type
Example: Chemical
code
string
Code of the material type
Example: CH-00001
created_at
string (date-time)
Creation date
Example: 2021-01-01 00:00:00
updated_at
string (date-time)
Last update date
Example: 2021-01-01 00:00:00
deleted_at
string (date-time) | null
Deletion date
Example: 2021-01-01 00:00:00
included
array<object>
List of relationships to be included
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
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
curl -X PATCH \
'https://api.sandbox.infraspeak.com/v3/stocks/material-types/{materialTypeId}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"name": "Material Type 1",
"code": "MT1"
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/stocks/material-types/{materialTypeId}', {
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"name": "Material Type 1",
"code": "MT1"
}),
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->patch('https://api.sandbox.infraspeak.com/v3/stocks/material-types/{materialTypeId}',
array (
'name' => 'Material Type 1',
'code' => 'MT1',
)
);
import requests
response = requests.patch(
'https://api.sandbox.infraspeak.com/v3/stocks/material-types/{materialTypeId}',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"name": "Material Type 1",
"code": "MT1"
}
},
)
data = response.json()