0

Hi in magento2 default API order item interface i need to add custom fields those are not attributes just i need to add custom flags in soap API based on order id flags will come how to add that it is soap API in Magento 1 we can override API file and we can add in item for-each loop but magento 2 i tried Item file but i did not find item loop and where they are preparing

I have tried with extension

<extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
    <attribute code="fee" type="integer"/>
</extension_attributes>
<extension_attributes for="Magento\Sales\Api\Data\OrderItemInterface">
    <attribute code="handling_charges" type="integer"/>
</extension_attributes>

and added function in order interface file but no luck

getting error

Message: Class "this" does not exist. Please note that namespace must be specified.

Your Answer

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

Browse other questions tagged or ask your own question.