- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add option sku in order items API
Hi guys, I need to extend the orders API response.
In the item options section, the order API is something like that:
"custom_options": [
{
"option_id": "12276",
"option_value": "20"
}
I would like to add the option_sku:
"custom_options": [
{
"option_id": "12276",
"option_value": "20"
"option_sku":"myoptionsku"
},
I don't understand where I should put my hands. I already spent a couple of hours googling around, but with no luck. Hope you can help me.
Thanks in advance
G
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Add option sku in order items API
You can use extension attributes for that.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Add option sku in order items API
Hi @yashmbhaya4524, thanks for your reply.
May I ask you an advice to what should I do in my case? Magento is so tough, and the API are even tougher!
Thanks in advance
G
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Add option sku in order items API
Firstly you should learn it in basic, try to follow blog you shown me after you got desired output as per blog find which function magento calls at the time of of saving and giving value, you can save your custom extension attribute before magento saves data and add data before magento outputs it.