Materials
The API gives the ability to get all material measurement units.
Tenant id (uuid v4)
GET /api/public/materials/measurement_units HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
[
{
"id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
"name": "kg"
}
]The API gives the ability to create a new material and specify material properties.
Scenarios for processing the received data
📝 All required + optional parameters were passed
The system creates material in the system.
UI
Newly created material is added to the Materials page to the {Category} tab and {Subcategory} section, which were passed in the “CREATE a material” request.
If
category_namewasn't specified in the request, then material is added to the “Without category” tab on the Materials page.If
subcategory_namewasn't specified in the request, then material is added to the {Category} tab which was passed in the “CREATE a material” request, but added to the “Without subcategory” section on the Materials page.
Tenant id (uuid v4)
Name of the material
Premium Steel RodUUID of the measurement unit for this material
550e8400-e29b-41d4-a716-446655440000External identifier for the material from supplier or other system
MAT-2024-001Detailed description of the material
High-grade steel rod with corrosion resistance, suitable for constructionUUID of the material category
550e8400-e29b-41d4-a716-446655440001UUID of the material subcategory
550e8400-e29b-41d4-a716-446655440002UUID of the material supplier
550e8400-e29b-41d4-a716-446655440003Delivery time information for the material
{"value":3,"unit":"h"}Purchase price of the material in base currency
25.99Current actual price of the material in base currency
28.5Array of material characteristic UUIDs (max 10)
["550e8400-e29b-41d4-a716-446655440004","550e8400-e29b-41d4-a716-446655440005"]Array of tag UUIDs for categorization and filtering
["550e8400-e29b-41d4-a716-446655440006","550e8400-e29b-41d4-a716-446655440007"]POST /api/public/materials HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 681
{
"name": "Premium Steel Rod",
"measurement_unit_id": "550e8400-e29b-41d4-a716-446655440000",
"material_external_id": "MAT-2024-001",
"description": "High-grade steel rod with corrosion resistance, suitable for construction",
"material_category_id": "550e8400-e29b-41d4-a716-446655440001",
"material_subcategory_id": "550e8400-e29b-41d4-a716-446655440002",
"material_supplier_id": "550e8400-e29b-41d4-a716-446655440003",
"delivery_time": {
"value": 3,
"unit": "h"
},
"purchase_price": 25.99,
"actual_price": 28.5,
"materialCharacteristics": [
"550e8400-e29b-41d4-a716-446655440004",
"550e8400-e29b-41d4-a716-446655440005"
],
"tags": [
"550e8400-e29b-41d4-a716-446655440006",
"550e8400-e29b-41d4-a716-446655440007"
]
}{
"id": "550e8400-e29b-41d4-a716-446655440000",
"material_category_id": "550e8400-e29b-41d4-a716-446655440001",
"material_subcategory_id": "550e8400-e29b-41d4-a716-446655440002",
"material_supplier_id": "550e8400-e29b-41d4-a716-446655440003",
"image_id": "550e8400-e29b-41d4-a716-446655440004",
"material_external_id": "MAT-001",
"measurement_unit_id": "550e8400-e29b-41d4-a716-446655440005",
"name": "Steel Beam",
"description": "High-strength steel beam for construction",
"status": "ACTIVE",
"purchase_price": 150,
"actual_price": 175.75,
"supply_delivery_time": 5,
"supply_delivery_time_period": "days",
"created_at": "2023-01-01T00:00:00.000Z",
"updated_at": "2023-01-02T00:00:00.000Z",
"created_by": "550e8400-e29b-41d4-a716-446655440006",
"updated_by": "550e8400-e29b-41d4-a716-446655440007"
}Material ID
Tenant id (uuid v4)
Photo url
https://example.com/photos/material-photo.jpgPOST /api/public/materials/{material_id}/photos HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 55
{
"url": "https://example.com/photos/material-photo.jpg"
}{
"photo_id": "550e8400-e29b-41d4-a716-446655440000"
}The API gives the ability to update materials properties. Any parameters not provided will be left unchanged.
Material ID
Tenant id (uuid v4)
Name of the material
Premium Steel RodUUID of the measurement unit for this material
550e8400-e29b-41d4-a716-446655440000External identifier for the material from supplier or other system
MAT-2024-001Detailed description of the material
High-grade steel rod with corrosion resistance, suitable for constructionUUID of the material category
550e8400-e29b-41d4-a716-446655440001UUID of the material subcategory
550e8400-e29b-41d4-a716-446655440002UUID of the material supplier
550e8400-e29b-41d4-a716-446655440003Delivery time information for the material
{"value":3,"unit":"h"}Purchase price of the material in base currency
25.99Current actual price of the material in base currency
28.5Status of the material
ACTIVEPossible values: PATCH /api/public/materials/{material_id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 506
{
"name": "Premium Steel Rod",
"measurement_unit_id": "550e8400-e29b-41d4-a716-446655440000",
"material_external_id": "MAT-2024-001",
"description": "High-grade steel rod with corrosion resistance, suitable for construction",
"material_category_id": "550e8400-e29b-41d4-a716-446655440001",
"material_subcategory_id": "550e8400-e29b-41d4-a716-446655440002",
"material_supplier_id": "550e8400-e29b-41d4-a716-446655440003",
"delivery_time": {
"value": 3,
"unit": "h"
},
"purchase_price": 25.99,
"actual_price": 28.5,
"status": "ACTIVE"
}{
"message": "The operation was done successfully"
}The API gives the ability to add parameter to material.
Material ID
Tenant id (uuid v4)
POST /api/public/materials/{material_id}/parameters HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 13
{
"data": [
[]
]
}{
"message": "The operation was done successfully"
}The API gives the ability to remove parameter from material.
Material ID
Parameter ID
Tenant id (uuid v4)
DELETE /api/public/materials/{material_id}/parameters/{parameter_id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
"message": "The operation was done successfully"
}The API gives the ability to update material parameter value.
Material ID
Parameter ID
Tenant id (uuid v4)
Unique identifier of the parameter value to update
b86fa12a-76fc-46f5-8a3e-bf39e7be4c4ePATCH /api/public/materials/{material_id}/parameters/{parameter_id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 61
{
"parameter_value_id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e"
}{
"message": "The operation was done successfully"
}The API gives the ability to add tag to material.
Material ID
Tenant id (uuid v4)
Array of tag UUIDs for categorization and filtering
["550e8400-e29b-41d4-a716-446655440006","550e8400-e29b-41d4-a716-446655440007"]POST /api/public/materials/{material_id}/tags HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 91
{
"tag_ids": [
"550e8400-e29b-41d4-a716-446655440006",
"550e8400-e29b-41d4-a716-446655440007"
]
}{
"message": "The operation was done successfully"
}The API gives the ability to remove tag from material.
Material ID
Tag ID
Tenant id (uuid v4)
DELETE /api/public/materials/{material_id}/tags/{tag_id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
"message": "The operation was done successfully"
}Last updated