I want to get Custom Attribute value which is already saved in database table, i just want to append it to my Sales order REST APi, i have tried adding extension attribute , i am able to get set and get functions in generation file , how do i show my custom attribute in my REST Api
Magento – Magento 2 order REST Api append Custom Attribute
custom-attributesextension-attributesmagento2.2rest api
Best Answer
You will need add an extension_attributes.xml with your custom attr.
Check this example for insert 'custom_attr_name' to order item response, if you want to add a attr for order instead order item just chance order item to just order.
Flush your cache and run di:compile.
You also can look at your generated file: OrderItemRepositoryInterface.php And check if you have some function (set or get) to your new attr.