In the admin, every store-scoped field carries a Use Default Value checkbox, and ticking it does not write a value — it deletes the row for that store, restoring inheritance from global scope. The REST API has no equivalent. custom_attributes has an attribute code and a value and no third state, so an override created by accident is permanent: omitting the attribute keeps it, sending an empty string writes an empty string, and repeating the global value creates a copy that stops tracking the global one forever.
Typical impact: the "why does one store view still show the old name" ticket, six months after an integration wrote a translation nobody asked for. Sending the sentinel this module understands deletes the scoped row the way the admin does, so the value inherits again instead of being overwritten with a lookalike.
Who it is for
- Integrations that wrote store-scoped values by accident, usually because a scopeless route defaults to the default store rather than to global.
- Anyone cleaning up after a bulk update that unchecked Use Default across attributes it never intended to touch — a long-standing complaint with several open core issues behind it.
- Teams who want inheritance restored through the API rather than by deleting EAV rows in SQL, which bypasses indexers, cache invalidation and every plugin that makes the write correct.
Who should skip it
- Anyone who can simply avoid creating the override: keep an allowlist of genuinely scope-dependent attributes and write everything else through the global route. That is cheaper than any reset by an order of magnitude.
- Customer entities. They are not supported and cannot be — the repository serialises the object it is handed, discards it and repopulates from a freshly loaded one, so nothing set at that layer survives.
- One-off cleanups better served by a reviewable data patch.
What it does
The module maps the CSV importer’s own empty-value constant onto a scope reset, so an integration learns one sentinel whichever way it loads data. Send that value for an attribute through a store-scoped route and the scoped row is deleted rather than overwritten.
Two details make it more than a wrapper, and both were found the hard way:
- The reset value is not uniform in core. The product form substitutes boolean
falseforvarchar,textanddatetimebackends, while the category controller usesnullfor everything. Send the wrong one and nothing fails — it writes aNULLrow, which pins "no value" on that scope and reads back as an empty field. - Categories cannot be hooked on the repository. That repository serialises the incoming object, replaces it with a freshly loaded one and repopulates from an array, so a repository-level plugin mutates something that is thrown away. The module hooks the resource model instead.
It also lifts the save-time required-attribute validation for the duration of the reset, which is what leads a naive implementation to throw instead of deleting.
Installation
composer require brocode/module-scope-reset
bin/magento module:enable BroCode_ScopeReset
bin/magento setup:upgrade
bin/magento cache:flush && bin/magento setup:di:compile
The cache flush before compile is not optional when etc/*/di.xml changed: the web-API config cache pins the old graph and the compiler keeps citing the old class.
Compatibility
Magento 2 Open Source, products and categories, verified on 2.4.8-p5. Customers are out of scope by design. Read the repository’s own notes before relying on it in a multi-source or staging setup.
FAQ
Why a sentinel rather than a dedicated endpoint?
Because the importer already defines one and integrations already carry it. A second convention would mean every client learns two.
Does it work for configuration values?
No. Scoped configuration cannot be reset over the API at all — no core route writes it, and the CLI can set but not unset a scoped value. That is a different gap.
How do I find the damage first?
Group catalog_product_entity_varchar by attribute and store, and look for store rows byte-identical to the global one — those are pure noise and safe to drop — and for empty strings, which are usually a failed "clear the field" attempt.
Related reading
- Magento Integration Skills — the scope rules this module exists to undo, and the rest of the integration surface.
- Generating a Magento Agent Skill From the API Definitions — why no declaration mentions which scope a route writes to.