Custom fields & metaData
Need to attach your own data to a product, order or customer? Don't build an external store for it — Zopping has two built-in mechanisms. This is the single biggest source of accidental duplicate work.
Two ways to extend an entity
metaData (freeform) | Custom attributes (structured) | |
|---|---|---|
| Shape | Arbitrary JSON | Typed fields you define per org |
| Searchable | No | Optionally indexed in search |
| Use for | Pass-through data, your own references, flags | First-class product attributes (material, SPF, voltage…) |
| Gated by | EntityMetaData extension | Catalog custom-attribute config |
1. metaData — freeform JSON on entities
Most core entities (product, variant, order, customer, tag, …) carry a metaData
object. Write any JSON; read it back unchanged.
curl -X POST https://zopping.com/api/catalogue-service/product \
-H "Authorization: Bearer $ZOPPING_TOKEN" -H "Content-Type: application/json" \
-d '{
"organizationId": "<org-id>",
"name": "Tata Salt 1kg",
"clientItemId": "SKU-TATA-SALT-1KG",
"metaData": { "erpId": "ERP-9931", "shelfLife": "24m", "isVegan": true }
}'
Requires the EntityMetaData extension. Great for carrying your system's
references and attributes round-trip without Zopping schema changes.
2. Custom attributes — typed, searchable
When an attribute should behave like a real product field — filterable, searchable, validated — define it as a custom attribute. Each is declared with a type and indexing flags:
{
"type": "string",
"indexed": true,
"stored": true,
"multiValued": false,
"required": false
}
indexed— usable in search/filters.stored— returned in responses.multiValued— allows a list of values.
Once defined, set values on products and use them in catalog filtering, the same way built-in attributes work.
Choosing between them
- Round-tripping your own IDs/flags, or data only your system reads →
metaData. - Something shoppers filter or search by, or that needs validation → custom attribute.
Good practices
- Namespace your
metaDatakeys (e.g.erpId, notid) to avoid collisions. - Keep
metaDatasmall — it's pass-through, not a database. - Check
EntityMetaDatais enabled (extensions) before relying on metaData round-tripping.
Next: Core concepts · Sync your catalog.