A product attribute can carry a default value. When a new product is created without a value for that attribute, minipim fills in the default before validating and saving. Defaults are a starting point for new products only. They never change products that already exist.
In the admin
- Go to Catalog → Attributes and click Edit on a product attribute (or create a new one).
- In Default value, enter the value. For a
select, add options under Validation first, then pick one. - Click Save changes. Use Clear default to remove it.
If the section says the attribute can’t carry a default, its type or flags don’t allow one (see the rules below).
With the API
Set defaultValue on POST /v1/attributes or PATCH /v1/attributes/{id}. Send the bare value, not a { locale, channel, value } record. Send null to clear it.
curl -X PATCH https://api.minipim.com/v1/attributes/c41d… \
-H "Authorization: Bearer pim_…" \
-H "Content-Type: application/json" \
-d '{ "defaultValue": true }'
Full reference: api.minipim.com/docs.
When defaults apply
Defaults are filled in only when a product is created through the API:
POST /v1/products, which the admin’s New product form uses;POST /v1/products/bulk, which CSV import uses.
They are not applied:
- to existing products, ever. Setting or changing a default is never retroactive. Use bulk editing to fill existing products.
- on updates. PATCH never adds defaults.
- to duplicates, which copy the source product’s values.
- to products imported by a connector.
- to variants, categories, brands or content pages.
Rules and limits
- Only product attributes can have a default. Setting one on a content, category or brand attribute returns 422.
- Allowed types:
boolean,text,textarea,number,decimal,select,date,datetime,url,email. Other types return 422. See Attribute types. - The attribute must be neither localizable nor scopable, because a per-locale or per-channel default has no single answer.
- The default is validated against the attribute’s type and validation rules when you set it, just like a typed-in value.
- A
selectdefault must be one of the existing options, even if the list accepts new values. - The default is only used for products in families that include the attribute.
- To create a product without the default, send the code with an empty list (
"code": []). An explicit empty list is kept. - A default counts as a value, so a default on a required attribute can let a product be created as
active. - Changing an attribute’s type or flags re-checks its existing default; an edit that would make it invalid is rejected with 422.
See also
- Attributes — Attributes are the typed fields of a minipim catalog: codes, labels, localizable, scopable and variant-axis flags, requirement levels, validation, deletion.
- Attribute types — All 19 minipim attribute types, the JSON value shape each one accepts, the validation options per type, and which types the admin can create, edit and default.
- Attribute families — Attribute families define which attributes a minipim product carries: attaching attributes, requirement overrides, ordering, moving products, deletion.
- Bulk editing — Change many products at once: set an attribute, status, tags or categories, move family, or delete. Up to 500 ids per API call, with a result for each product.