Custom attribute mutations
This functionality is automatically available on Adobe Commerce as a Cloud Service (SaaS) projects. Adobe Commerce on-premises and Cloud infrastructure (PaaS) projects can install separate modules to provide this functionality.
Custom attributes can extend the core data model in Adobe Commerce, allowing you to add additional attributes to entities without requiring code or database schema changes. Consider a situation where you want to specify a duns_number or industry_type information for a company. Custom attributes make this possible.
These custom attributes operate independently of the EAV (Entity-Attribute-Value) attributes, which are defined in the Admin. They do not apply to products, categories, or customers.
The following mutations allow you to set custom attributes:
setCustomAttributesOnCartsetCustomAttributesOnCartItem- SaaS only
setCustomAttributesOnCompany setCustomAttributesOnCreditMemosetCustomAttributesOnCreditMemoItemsetCustomAttributesOnInvoicesetCustomAttributesOnInvoiceItem- SaaS only
setCustomAttributesOnNegotiableQuote
The following entities now support custom attributes:
CartCartItemInterface- SaaS only
Company CreditMemoCreditMemoItemCreditMemoItemInterfaceCustomerOrderInvoiceInvoiceItemInvoiceItemInterface- SaaS only
NegotiableQuote OrderOrderItemOrderItemInterfaceQuoteQuoteItem
Install custom attribute support
PaaS only
Prerequisites
- Adobe Commerce on cloud infrastructure or on-premises: 2.4.5+
- PHP 8.1+
- Magento Open Source is not supported.
Installation
To install custom attributes in Adobe Commerce:
Run the following command to install the modules:
Copied to your clipboardcomposer require magento/out-of-process-custom-attributes=^0.2.0 --with-dependenciesEnable the new module:
Copied to your clipboardbin/magento module:enable Magento_OutOfProcessCustomAttributesFor on-premises installations, run the following command to upgrade Adobe Commerce and clear the cache.
Copied to your clipboardbin/magento setup:upgrade && bin/magento cache:clean
