Docs / API Reference / Textile Products Textile Products API Reference for Yarn, Fiber, and Fabric product endpoints — specialized textile product types with industry-specific attributes.
Textile products extend the base product model with industry-specific attributes for yarns, fibers, and fabrics. All textile products inherit the full set of BaseProduct fields (name, code, composition, certifications, origin countries, etc.) plus textile-specific fields.
Yarn Products Endpoints Method Path Description POST/api/v1/textile/yarnsCreate a yarn product PATCH/api/v1/textile/yarns/{id}Update a yarn product POST/api/v1/textile/yarns/bulkBulk upsert yarn products
POST /api/v1/textile/yarns All BaseProduct fields are accepted, plus the following yarn-specific fields:
Field Type Required Description supplier_idinteger ❌ FK to Supplier.id company_idinteger ❌ FK to company textile_categorystring ❌ Auto-set to YARN yarn_countnumber ❌ Yarn count (must be positive) yarn_count_unitstring ❌ NE, NM, TEX, DTEX, DENIERtwiststring ❌ Twist direction (max 10 chars) plyinteger ❌ Number of plies (≥ 0) yarn_typestring ❌ Type of yarn (max 100 chars)
curl JavaScript
1 curl -X POST "http://localhost:8080/api/v1/textile/yarns?userId=1" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "name": "Egyptian Cotton Ne 40/1",
5 "code": "YARN-EC-40",
6 "supplier_id": 3,
7 "composition": "100% Egyptian Cotton",
8 "product_origin_country": "EG",
9 "raw_material_origin_country": "EG",
10 "yarn_count": 40.0,
11 "yarn_count_unit": "NE",
12 "twist": "Z",
13 "ply": 1,
14 "yarn_type": "Ring Spun",
15 "gots_certified": true,
16 "price_per_unit": 8.50,
17 "currency": "EUR",
18 "unit_of_measure": "KG"
19 }'
1 const resp = await fetch ( '/api/v1/textile/yarns?userId=1' , {
2 method : 'POST' ,
3 headers : { 'Content-Type' : 'application/json' } ,
4 body : JSON . stringify ( {
5 name : 'Egyptian Cotton Ne 40/1' ,
6 code : 'YARN-EC-40' ,
7 supplier_id : 3 ,
8 yarn_count : 40.0 ,
9 yarn_count_unit : 'NE' ,
10 twist : 'Z' ,
11 ply : 1 ,
12 yarn_type : 'Ring Spun' ,
13 product_origin_country : 'EG'
14 } )
15 } ) ;
Fiber Products Endpoints Method Path Description POST/api/v1/textile/fibersCreate a fiber product PATCH/api/v1/textile/fibers/{id}Update a fiber product POST/api/v1/textile/fibers/bulkBulk upsert fiber products
POST /api/v1/textile/fibers All BaseProduct fields are accepted, plus the following fiber-specific fields:
Field Type Required Description supplier_idinteger ❌ FK to Supplier.id company_idinteger ❌ FK to company textile_categorystring ❌ Auto-set to FIBER fiber_typestring ❌ Type of fiber (max 100 chars) staple_length_mmnumber ❌ Staple length in mm (must be positive) fineness_micronnumber ❌ Fiber fineness in microns (must be positive) fiber_originstring ❌ Origin of the fiber (max 100 chars)
curl JavaScript
1 curl -X POST "http://localhost:8080/api/v1/textile/fibers?userId=1" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "name": "Merino Wool 19.5μm",
5 "code": "FIB-MW-195",
6 "supplier_id": 7,
7 "composition": "100% Merino Wool",
8 "product_origin_country": "AU",
9 "fiber_type": "Merino Wool",
10 "staple_length_mm": 75.0,
11 "fineness_micron": 19.5,
12 "fiber_origin": "Australia",
13 "unit_of_measure": "KG",
14 "price_per_unit": 22.00,
15 "currency": "EUR"
16 }'
1 const resp = await fetch ( '/api/v1/textile/fibers?userId=1' , {
2 method : 'POST' ,
3 headers : { 'Content-Type' : 'application/json' } ,
4 body : JSON . stringify ( {
5 name : 'Merino Wool 19.5μm' ,
6 code : 'FIB-MW-195' ,
7 supplier_id : 7 ,
8 fiber_type : 'Merino Wool' ,
9 staple_length_mm : 75.0 ,
10 fineness_micron : 19.5 ,
11 fiber_origin : 'Australia'
12 } )
13 } ) ;
Fabric Products Endpoints Method Path Description POST/api/v1/textile/fabricsCreate a fabric product PATCH/api/v1/textile/fabrics/{id}Update a fabric product POST/api/v1/textile/fabrics/bulkBulk upsert fabric products
POST /api/v1/textile/fabrics All BaseProduct fields are accepted, plus the following fabric-specific fields:
Field Type Required Description supplier_idinteger ❌ FK to Supplier.id company_idinteger ❌ FK to company textile_categorystring ❌ Auto-set to FABRIC width_cmnumber ❌ Fabric width in cm (must be positive) areal_mass_gsmnumber ❌ Areal mass in g/m² (must be positive) weave_typestring ❌ Type of weave, e.g. Plain, Twill, Satin (max 100 chars) finishstring ❌ Fabric finish, e.g. Mercerized, Calendered (max 100 chars)
curl JavaScript
1 curl -X POST "http://localhost:8080/api/v1/textile/fabrics?userId=1" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "name": "Organic Cotton Twill 280gsm",
5 "code": "FAB-OCT-280",
6 "supplier_id": 3,
7 "composition": "100% Organic Cotton",
8 "product_origin_country": "TR",
9 "raw_material_origin_country": "IN",
10 "width_cm": 150.0,
11 "areal_mass_gsm": 280.0,
12 "weave_type": "Twill",
13 "finish": "Mercerized",
14 "gots_certified": true,
15 "unit_of_measure": "METERS",
16 "price_per_unit": 5.80,
17 "currency": "EUR",
18 "quantity_available": 3000.0
19 }'
1 const resp = await fetch ( '/api/v1/textile/fabrics?userId=1' , {
2 method : 'POST' ,
3 headers : { 'Content-Type' : 'application/json' } ,
4 body : JSON . stringify ( {
5 name : 'Organic Cotton Twill 280gsm' ,
6 code : 'FAB-OCT-280' ,
7 supplier_id : 3 ,
8 width_cm : 150.0 ,
9 areal_mass_gsm : 280.0 ,
10 weave_type : 'Twill' ,
11 finish : 'Mercerized' ,
12 unit_of_measure : 'METERS' ,
13 quantity_available : 3000.0
14 } )
15 } ) ;
Bulk Upsert (all textile types) All three textile endpoints support bulk upsert at /bulk. The request body uses the standard bulk format:
1 {
2 "mode" : "UPSERT" ,
3 "records" : [
4 {
5 "name" : "Cotton Twill 280gsm" ,
6 "code" : "FAB-CT-280" ,
7 "supplier_id" : 3 ,
8 "width_cm" : 150.0 ,
9 "areal_mass_gsm" : 280.0 ,
10 "weave_type" : "Twill"
11 } ,
12 {
13 "name" : "Silk Satin 120gsm" ,
14 "code" : "FAB-SS-120" ,
15 "supplier_id" : 3 ,
16 "width_cm" : 140.0 ,
17 "areal_mass_gsm" : 120.0 ,
18 "weave_type" : "Satin"
19 }
20 ]
21 }
Response 1 {
2 "created" : 1 ,
3 "updated" : 1 ,
4 "failed" : 0 ,
5 "errors" : [ ]
6 }
Shared Base Product Fields All textile products inherit these fields from BaseProduct:
Field Type Description namestring Product name (required) codestring Product code categorystring Product category subcategorystring Product subcategory descriptionstring Description technical_specsstring Technical specifications compositionstring Material composition product_origin_countrystring ISO 3166-1 alpha-2 raw_material_origin_countrystring ISO 3166-1 alpha-2 unit_of_measurestring METERS, KG, PIECES, ROLLSquantity_availablenumber Current stock lead_time_daysinteger Lead time in days price_per_unitnumber Price per unit currencystring ISO 4217 currency code minimum_ordernumber Minimum order quantity product_weight_kgnumber Weight in kg gots_certifiedboolean GOTS certification grs_certifiedboolean GRS certification oeko_tex_certifiedboolean OEKO-TEX certification recycled_content_percentnumber % recycled content organic_content_percentnumber % organic content availableboolean Available (default: true) metadataobject Custom JSON metadata