1

I'm looking at the API in magento 2.3 and I'm trying to figure out how they works. I called a GET on /rest/it/V1/products/:sku and I got a JSON (stripped out for clarity)

{
    "extension_attributes": {
        "marketing1_title": "This is the marketing title 1",
    },
    "custom_attributes": [
        {
            "attribute_code": "marketing1_title",
            "value": "This is the marketing title 1"
        }
    ]
}

This product was created in the backend (I'm not familiar at all with it, I only work with the API) so I don't understand if it's a misconfiguration in the backend or if it's supposed to work this way.

Mainly I can't get the difference between "extension_attributes" and "custom_attributes" and I can't find any docs about it.

Can you help me in any way?

2

Magento's documentation regarding Custom Attributes and Extension Attributes can be found here https://devdocs.magento.com/guides/v2.3/extension-dev-guide/attributes.html.

For the sake of a verbose answer and in the case the link breaks in the future, below is a direct quote from their documentation.

Custom attributes are those added on behalf of a merchant. For example, a merchant might need to add attributes to describe products, such as shape or volume. A merchant can add these attributes in the Magento Admin panel.

Extension attributes are new in Magento 2. They are used to extend functionality and often use more complex data types than custom attributes. These attributes do not appear in the Magento Admin.

  • I'm still unable to upvote your answer (reputation too low) but at least I can accept it – Federico Granata Feb 28 '19 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.