Hi
I was trying to develop a module where I need to take some extra information about from the about reason for that item purchase. I have developed separate table and want this table to linked to order he placed. This table contains information about the itemid and which line on order it is linked to. I want this information to be exported to API. I was wondering if this information I can expose using extension attributes. if Yes, is there any document how to use this extension attributes to export this information in standard Order REST APIs? or only by developing the custom rest api only option ?
thanks in advance.
I have the same problem and, just to say, the documentation on Magento is all but clear on the topic.
Let's resume what I tried:
<?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Sales\Api\Data\OrderInterface"> <attribute code="oad_additional_data" type="\FiloBlu\OrderAdditionalData\Model\OrderData"> <join reference_table="sales_oad_order" reference_field="order_id" join_on_field="entity_id"> <field column="additional_data">oad_additional_data</field> </join> </attribute> </extension_attributes> </config>
What am I doing wrong? Srinithin did you manage to get extension attributes working in these 6 months?
Thanks in advance!
A small advance on the topic.
According to this answer on Magento StackExchange, it seems that set and get need to be implemented extensively for orders.