Product Materials API

Manage raw materials across fibers, yarns and fabrics, including purchases, activities and documents.

Product materials provide a unified API over the textile material kinds FIBER, YARN and FABRIC. Path parameter {kind} accepts only FIBER, YARN or FABRIC.

Endpoints

Materials

MethodPathDescription
GET/api/v1/product/materialsList product materials with pagination and facets
POST/api/v1/product/materialsCreate a product material
GET/api/v1/product/materials/{kind}/{id}Get a material by kind and id
DELETE/api/v1/product/materials/{kind}/{id}Delete a material
GET/api/v1/product/materials/{kind}/{id}/detailGet detail overview, metrics and latest document
GET/api/v1/product/materials/{kind}/{id}/activitiesList material activity timeline events

Material documents

MethodPathDescription
GET/api/v1/product/materials/{kind}/{id}/documentsList documents attached to a material
POST/api/v1/product/materials/{kind}/{id}/documentsUpload one or more material documents
POST/api/v1/product/materials/{kind}/{id}/documents/presignCreate presigned upload URLs
POST/api/v1/product/materials/{kind}/{id}/documents/{documentId}/completeComplete a presigned upload
DELETE/api/v1/product/materials/{kind}/{id}/documents/{documentId}Soft-delete a material document

Purchases and purchase documents

MethodPathDescription
GET/api/v1/product/materials/{kind}/{id}/purchasesList purchase lines for a material
POST/api/v1/product/materials/{kind}/{id}/purchasesCreate a material purchase
POST/api/v1/product/materials/{kind}/{id}/purchases/estimateEstimate transport emissions
POST/api/v1/product/materials/{kind}/{id}/purchases/with-documentsCreate a purchase with documents
PATCH/api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}Update a material purchase
GET/api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}/documentsList documents for a material purchase
POST/api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}/documentsUpload documents for a material purchase
DELETE/api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}/documents/{documentId}Remove a material purchase document

GET /api/v1/product/materials

Query parameterTypeRequiredNotes
pagenumberno1-based, default 1
limitnumbernoDefault 8, max 100
searchstringnoCase-insensitive search on name, code, supplier and composition
kindenumnoALL, FIBER, YARN, FABRIC
supplierIduuidnoFilter by supplier
certificationstringnoFilter by certification
availablebooleannoFilter availability
unitOfMeasureenumnoSee API conventions
sortByenumnoname, category, supplier, stock, createdAt, updatedAt
sortDirectionenumnoasc or desc

200 OK returns ProductMaterialListResponseDto with data, meta and facets.

POST /api/v1/product/materials

Request body (CreateProductMaterialDto)

FieldTypeRequiredDescription
kindenumyesFIBER, YARN or FABRIC
namestringyesMaterial display name
supplierIduuidyesLinked supplier
codestringnoInternal or supplier code
descriptionstringnoDescription
technicalSpecsstringnoTechnical specifications
compositionstringnoMaterial composition
gotsCertifiedbooleannoDefaults to false
grsCertifiedbooleannoDefaults to false
oekoTexCertifiedbooleannoDefaults to false
cradleToCradlebooleannoDefaults to false
betterCottonbooleannoDefaults to false
otherCertificationsstringnoAdditional certification labels
recycledContentPctnumberno0 to 100
organicContentPctnumberno0 to 100
sustainabilityNotesstringnoSustainability notes
unitOfMeasureenumnoDefaults to KG
metadata.categoryLabelstringnoCustom category label

201 Created returns ProductMaterialDto. 400 indicates validation errors; 404 indicates a linked supplier was not found.

Material detail and activity

GET /api/v1/product/materials/{kind}/{id} returns ProductMaterialDto.

GET /api/v1/product/materials/{kind}/{id}/detail returns MaterialDetailDto, including overview metrics and the latest document.

GET /api/v1/product/materials/{kind}/{id}/activities?page=1&pageSize=20 returns MaterialActivityListResponseDto.

Material documents

GET /api/v1/product/materials/{kind}/{id}/documents accepts page, pageSize, includeDeleted and category. It returns ProductMaterialDocumentListResponseDto.

Direct document upload accepts one or more files as multipart form data and returns UploadProductMaterialDocumentsResponseDto.

Presigned material documents

POST /api/v1/product/materials/{kind}/{id}/documents/presign accepts PresignProductMaterialDocumentsRequestDto:

FieldTypeRequiredDescription
categoryenumnoTECHNICAL_SHEET or OTHER, default TECHNICAL_SHEET
filesobject[]yes1 to 10 files
files[].fileNamestringyesOriginal filename
files[].contentTypestringyesMIME type
files[].sizeBytesintegeryesFile size in bytes

The response contains one documentId, presignedUrl, objectKey and expiresAt per file. Upload each file to its URL, then call POST /api/v1/product/materials/{kind}/{id}/documents/{documentId}/complete with checksumSha256.

Purchases

GET /api/v1/product/materials/{kind}/{id}/purchases?page=1&pageSize=20 returns MaterialPurchaseListResponseDto.

POST /api/v1/product/materials/{kind}/{id}/purchases creates a purchase and requires the idempotency-key header.

Request body (CreateMaterialPurchaseDto)

FieldTypeRequiredDescription
lotNumberstringyesLot or batch number
purchaseDatedate-timeyesPurchase date
quantitystring decimalyesQuantity as a decimal string
unitOfMeasureenumyesUnit of measure
valuestring decimalnoPurchase value
currencystringnoDefaults to EUR
originCountrystringnoOrigin country
originProvincestringnoOrigin province
transportModeenumnoTRUCK, SHIP, TRAIN, PLANE
distanceKmnumbernoPositive distance in km
estimatedScope3Tco2estringnoScope 3 estimate
ddtNumberstringyesTransport document number
invoiceNumberstringyesInvoice number
transactionCertificateNumberstringnoTransaction certificate number
testReportNumberstringnoTest report number
notesstringnoNotes
attachmentsobject[]noAttachment metadata for with-documents
Shell
curl -X POST {{BASE_URL}}/api/v1/product/materials/FABRIC/{id}/purchases \
-H "Authorization: Bearer $CONFORMA_PAT" \
-H "Content-Type: application/json" \
-H "idempotency-key: po-2026-0001-line-1" \
-d '{
"lotNumber": "LOT-2026-0001",
"purchaseDate": "2026-06-16T00:00:00.000Z",
"quantity": "120",
"unitOfMeasure": "M",
"ddtNumber": "DDT-2026-0001",
"invoiceNumber": "INV-2026-0001"
}'

PATCH /api/v1/product/materials/{kind}/{id}/purchases/{purchaseId} updates an existing material purchase.

Purchase estimate

POST /api/v1/product/materials/{kind}/{id}/purchases/estimate accepts EstimateMaterialPurchaseTransportDto and returns EstimateMaterialPurchaseTransportResponseDto.

Purchase with documents

POST /api/v1/product/materials/{kind}/{id}/purchases/with-documents creates a material purchase with documents in a single multipart request. It requires the idempotency-key header and returns MaterialPurchaseCreatedResponseDto.

The multipart implementation expects:

FieldTypeRequiredDescription
payloadstringyesJSON string matching CreateMaterialPurchaseDto
attachmentsstringnoJSON array of attachment manifest entries
<clientId>binaryfor each manifest entryFile field named with the manifest clientId

Each attachment manifest entry contains clientId, fileName, contentType, sizeBytes and category. Supported categories are DDT, INVOICE, TRANSACTION_CERTIFICATE, TEST_REPORT and OTHER.

Purchase documents

GET /api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}/documents lists documents for an existing material purchase.

POST /api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}/documents uploads documents for that purchase and returns 201 Created.

DELETE /api/v1/product/materials/{kind}/{id}/purchases/{purchaseId}/documents/{documentId} removes a document and returns 204 No Content.