Metadata
Metadata is information you attach to articles and pricelists, stored as key → list of values, with no fixed schema:
POST /article
{ "sku": "SKU-CHAIR-001", "name": "Office chair", "metadata": { "brand": ["ergo"], "category": ["chairs", "office"] } }
POST /pricelist
{ "code": "wholesale-se", "currency_code": "SEK", "vat_mode": "NET", "metadata": { "segment": ["wholesale"], "region": ["nordics"] } }
Metadata is optional. When you write an article or pricelist again, its metadata is replaced as a whole from the new version's start; see Scheduled updates.
What metadata is used for
| Where | What it does | See |
|---|---|---|
| Price rule filters | A rule applies only to articles whose metadata matches its filter, such as brand = 'ergo' | Price rules |
A price rule's parent variable | A rule can read the parent pricelist's metadata, such as parent['segment'][0] == 'vip' | Price rules |
| Price queries | pricelist_filter.metadata selects the pricelists whose metadata matches | Querying prices |
| Search | Article and pricelist search match metadata values as text, and can filter on a key exactly | Finding articles and pricelists |
| Metadata listings | GET /article/metadata and GET /pricelist/metadata list the keys in use, and each key's values | Finding articles and pricelists |
When the metadata of an article or of a parent pricelist changes, the prices it affects are recalculated from that moment; see Historical pricing.
Inheritance
Pricelist metadata is not inherited: each pricelist has its own. A child pricelist's rules can read its parent's metadata through the parent variable.
Bundles
A bundle article has its own metadata, which price rule filters match in the same way as any other article's; see Bundles.
Not a storefront search
Search is for finding your data, for your team and your tools: in the console, during maintenance or in an integration. Product search for shoppers on a storefront belongs in your commerce platform or product information system.
See also
- Price rules — filters on article metadata.
- Querying prices — selecting pricelists by metadata.
- Finding articles and pricelists — search and the metadata listings.