DEV Community

Zhou Jia
Zhou Jia

Posted on Edited on

Schema.org for fabric: where Product.offers breaks down on a B2B textile site

I run the site for a small fabric mill in Zhejiang, China. We weave burnout velvet, cotton corduroy and a few other wovens, and sell to garment factories in about 30 countries.

Last month I sat down to add structured data to the product catalogue. It took three weekends, and most of that time went into arguing with schema.org rather than writing code.

Here is what actually shipped, and the four places the vocabulary doesn't fit.

The core mismatch

Product markup is built around a mental model that looks like this:

one product → one SKU → one price → one size

That model fits a t-shirt. It does not fit fabric.

A single fabric quality has four dimensions that all affect price independently:

  1. Composition — 80% viscose / 20% nylon, or 100% cotton, or a blend
  2. Weight — measured in gsm (grams per square metre), ranging from 98 to 390 across our range
  3. Width — 145 cm, 150 cm, 280 cm for wide wale
  4. Colour / pattern count — 182 colourways for one velvet quality

Change any one of those and the price moves. Our main velvet quality (M4011) runs $1.40 to $2.20 per metre depending on weight and colour. Corduroy runs $1.98 to $2.08.

So there is no "the price" to put in offers.price. There is a price range that depends on configuration.

What we shipped

Four blocks on the product page, plus two on the homepage. Here is the shape.

1. AggregateOffer instead of Offer

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "MJ128 Fine Wale Cotton Corduroy",
  "category": "Cotton Corduroy Fabric",
  "brand": { "@type": "Brand", "name": "Mujia Textile" },
  "offers": {
    "@type": "AggregateOffer",
    "priceCurrency": "USD",
    "lowPrice": "1.98",
    "highPrice": "2.08",
    "availability": "https://schema.org/InStock",
    "priceValidUntil": "2026-12-31",
    "eligibleQuantity": {
      "@type": "QuantitativeValue",
      "minValue": 300,
      "unitCode": "MTR"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Three things matter here:

  • AggregateOffer not Offer. It accepts lowPrice / highPrice and doesn't demand a single number.
  • priceValidUntil. Textile prices move with cotton futures. Without an expiry date you're publishing a claim you can't honour in six months.
  • eligibleQuantity with unitCode: "MTR". This is the MOQ — 300 metres per colour. It's the single most-asked question from buyers, and it belongs in the markup, not just in a paragraph of body copy.

AggregateOffer also tells Google this is a range product, which is honest. If you put a single price on a fabric listing you are lying to the crawler, and the mismatch between your markup and your actual quote sheet will surface eventually.

2. additionalProperty for gsm and width

Product has a size field. It's meant for clothing sizes — S, M, L, 38, 40.

For fabric, "size" is a two-dimensional measurement: weight in gsm and width in cm. Neither maps to size. size is a Text or SizeSpecification, and cramming "145cm x 180gsm" into it is technically legal and semantically useless.

What works better:

"additionalProperty": [
  {
    "@type": "PropertyValue",
    "name": "Weight",
    "value": 180,
    "unitCode": "GSM"
  },
  {
    "@type": "PropertyValue",
    "name": "Width",
    "value": 145,
    "unitCode": "CMT"
  },
  {
    "@type": "PropertyValue",
    "name": "Composition",
    "value": "100% cotton"
  }
]
Enter fullscreen mode Exit fullscreen mode

unitCode uses UN/CEFACT codes. CMT is centimetre. GSM is grams per square metre — note that this is not a UN/CEFACT code, it's a textile-industry convention that schema.org tolerates as a string. I checked the UNECE Rec 20 list and there is no clean gsm code, so GSM as a plain string is what everyone in the trade actually uses.

This is the part that pays off most. When a buyer searches "180 gsm corduroy 145 cm", the numbers are now machine-readable rather than buried in a spec table.

3. material as an array, not a string

Product.material accepts Text or Product. Most examples show a single string: "material": "cotton".

Fabric composition is a percentage breakdown. Schema.org has no hasPercentage primitive for this. Two workarounds:

Option A — put the full string in material:

"material": "80% viscose / 20% nylon"
Enter fullscreen mode Exit fullscreen mode

Option B — use additionalProperty (as above) and leave material as the dominant fibre:

"material": "viscose"
Enter fullscreen mode Exit fullscreen mode

We went with A on the product blocks and B inside additionalProperty, because the full string is what a buyer actually needs to see, and the dominant-fibre version is what a search engine can group on.

Neither is elegant. Both are honest.

4. Organization with vatID and isicV4

This one is unrelated to products but worth more than the rest combined.

{
  "@type": "Organization",
  "@id": "https://mujiatextile.com/#org",
  "name": "Shaoxing Mujia Textile Co., Ltd.",
  "alternateName": ["Mujia Textile", "绍兴慕佳纺织有限公司"],
  "url": "https://mujiatextile.com/",
  "vatID": "91330681052809696P",
  "isicV4": "1312",
  "foundingDate": "2012-08-22",
  "address": { "@type": "PostalAddress", "..." : "..." }
}
Enter fullscreen mode Exit fullscreen mode
  • vatID — the Chinese unified social credit code. It is verifiable against public registries. It tells a crawler this is a real registered entity, not a content farm.
  • isicV4: "1312" — ISIC Rev.4 code 1312 is "Weaving of textiles". This is a standard industrial classification, and it's far more precise than category: "textile".
  • alternateName with the Chinese legal name — so the entity resolves across both language spaces.

The @id matters too. Every other block references it ("publisher": { "@id": "https://mujiatextile.com/#org" }), which means the whole site describes one entity rather than 800 disconnected pages.

The four things that don't fit

To be direct about the gaps:

  1. No gsm unit. unitCode: "GSM" is a string the validator will not recognise as a code. It works, but it's a convention, not a spec.
  2. No composition percentage. material is a string or a product reference. There's no material: [{ "@type": "Material", "name": "viscose", "percentage": 80 }].
  3. No price-per-unit-of-measure. UnitPriceSpecification exists and is close, but it's designed for reference quantities (per 100g, per litre), not "per metre at this weight and this width". We used AggregateOffer because it was less wrong.
  4. size is clothing-shaped. For a 145 cm × 180 gsm woven, there's no correct field. additionalProperty is the workaround, not the answer.

What I'd tell someone starting this

Three things, in order of payoff:

Do the Organization block first. It's the cheapest and it anchors everything else. Get @id, vatID, isicV4, foundingDate, and the full address in. Then reference @id from every other block on the site.

Then the AggregateOffer. It stops you publishing a fake single price. eligibleQuantity carries your MOQ, which is what buyers ask about first.

Then additionalProperty for weight and width. This is the one that turns spec-table text into machine-readable values. It took the longest and it was worth it.

Don't bother with Product.size. It doesn't fit and pretending it does creates a field that means nothing.

One honest caveat

I can't tell you this improved rankings. I don't have a clean before/after — we shipped the markup alongside a site restructure, and the two are entangled.

What I can tell you is that the spec numbers are now extractable. Whether that translates into traffic depends on a hundred other things.

If you're building for a manufacturer rather than a retailer, the vocabulary is thinner than the documentation suggests. AggregateOffer and additionalProperty do most of the work. Everything else is a compromise you make peace with.


The site is mujiatextile.com if you want to inspect the markup. Full product specs and spec sheets are there too — I'm not going to pretend this post isn't also a backlink.

Top comments (0)