Is it possible to add ‘custom_attributes’ to orders RestAPI?

Hi /r/magento,

I was wondering if it’s possible to add ‘custom_attributes’ to an API response, especially to the orders api. All I can find are tutorials on how to add a custom attribute to ‘extension_attributes’ but unfortunately I need it as ‘custom_attributes’. Reference:

{ "sku": "tshirt1", "price": "20.00", "description": "New JSmith design", "extension_attributes": { "logo size": "small" }, "custom_attributes": { "artist": "James Smith" } } 

What I’m trying to achivie is, to expose a field from the table ‘sales_order’ as a custom attribute in ‘custom_attributes’ in the orders API.

Is there any way to do this? Thanks a lot.

submitted by /u/hardy123480
[link] [comments]