Attribute interfaces and implementations
Adobe Commerce provides the following interfaces to access system attributes and custom attributes defined by the merchant.
| Interface | Implementations |
|---|---|
Adobe Commerce as a Cloud Service (SaaS) provides two additional implementations of the AttributeValueInterface interface (AttributeFile and AttributeImage) to handle files and images uploaded to Amazon S3. If you are migrating from Adobe Commerce on Cloud Infrastructure or on-premise, these changes represent a backward incompatible change. If your project uses custom attributes for files or images, you must update your code to use the new implementations.
Example usage
Retrieve custom attributes metadata from a customer
The following call returns custom attributes for the logged-in customer. Provide the customer's token in the header section of the query.
Request:
Copied to your clipboard{customer {firstnamelastnamesuffixcustom_attributes {code... on AttributeValue {value}... on AttributeSelectedOptions {selected_options {labelvalue}}}}}
Response:
Copied to your clipboard{"data": {"customer": {"firstname": "John","lastname": "Doe","suffix": null,"email": "jdoe@example.com","custom_attributes": [{"code": "reward_update_notification","value": "0"},{"code": "studies","selected_options": [{"label": "BSc","value": "501"},{"label": "MBA","value": "502"}]}]}}}
Filter custom_attributesV2 of a product
The following query returns custom_attributes of a product that have is_comparable enabled.
Request:
Copied to your clipboard{products(filter: {sku: {eq: "24-MB02"}}){items{skunamecustom_attributesV2(filters: {is_comparable: true}){items{code... on AttributeValue {value}... on AttributeSelectedOptions {selected_options {labelvalue}}},errors {typemessage}}}}}
Response:
Copied to your clipboard{"data": {"products": {"items": [{"sku": "24-MB02","name": "Fusion Backpack","custom_attributesV2": {"items": [{"code": "description","value": "<p>With the Fusion Backpack strapped on, every trek is an adventure - even a bus ride to work. That's partly because two large zippered compartments store everything you need, while a front zippered pocket and side mesh pouches are perfect for stashing those little extras, in case you change your mind and take the day off.</p>\n<ul>\n<li>Durable nylon construction.</li>\n<li>2 main zippered compartments.</li>\n<li>1 exterior zippered pocket.</li>\n<li>Mesh side pouches.</li>\n<li>Padded, adjustable straps.</li>\n<li>Top carry handle.</li>\n<li>Dimensions: 18\" x 10\" x 6\".</li>\n</ul>"},{"code": "activity","selected_options": [{"label": "Yoga","value": "17"},{"label": "Hiking","value": "27"},{"label": "School","value": "29"}]}],"errors": []}}]}}}
Retrieve a file uploaded to Amazon S3
SaaS onlyThe following query returns the presigned URL of any file or image that a customer uploaded to Amazon S3.
Request:
Copied to your clipboard{customer {custom_attributes {code... on AttributeFile {urlvalue}... on AttributeImage {urlvalue}}}}
Response:
Copied to your clipboard{"data": {"customer": {"firstname": "John","lastname": "Doe","custom_attributes": [{"code": "profile_picture","url": "https://your-bucket.s3.amazonaws.com/path/to/file.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=..."}]}}}


