Devdocs: Custom options in sales order details missing

Created on 20 Dec 2016  Â·  7Comments  Â·  Source: magento/devdocs

I cannot get the custom options in order detail of customer through REST Api. Can you please suggest how can I get the custom options if it is available with the product in the order. I can fetch the whole order detail through REST Api by /rest/V1/orders/:orderid but I cannot see if customer has selected the custom option of the product. Please let me know with a solution asap.

Most helpful comment

Hi @deepikabiswas,
Thank you for your report and interest in Magento.
You can try the following API call to fetch all required information about order items:

/rest/V1/orders/items?searchCriteria[filter_groups][0][filters][0][field]=order_id&searchCriteria[filter_groups][0][filters][0][value]=1&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

(replace _1_ with your order ID).
For more information you can refer to our API documentation http://devdocs.magento.com/swagger/index_20.html#/ (see salesOrderItemRepositoryV1 for this particular service)

Hope this helps,
Regards.

All 7 comments

I've asked development to take a look at this.

Hi @deepikabiswas,
Thank you for your report and interest in Magento.
You can try the following API call to fetch all required information about order items:

/rest/V1/orders/items?searchCriteria[filter_groups][0][filters][0][field]=order_id&searchCriteria[filter_groups][0][filters][0][value]=1&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

(replace _1_ with your order ID).
For more information you can refer to our API documentation http://devdocs.magento.com/swagger/index_20.html#/ (see salesOrderItemRepositoryV1 for this particular service)

Hope this helps,
Regards.

Hello

Thank you for the response. It was similar to what I want in the order but
The custom options are showing in form of ID but I want that the
titles/values of those ID should come in response as the ID will be
difficult to match with the custom options of the products.
Please help me out.

[image: Inline image 1]

On Thu, Dec 22, 2016 at 4:52 PM, Alexander Akimov notifications@github.com
wrote:

Hi @deepikabiswas https://github.com/deepikabiswas,
Thank you for your report and interest in Magento.
You can try the following API call to fetch all required information about
order items:

/rest/V1/orders/items?searchCriteria[filter_groups][
0][filters][0][field]=order_id&searchCriteria[filter_
groups][0][filters][0][value]=1&searchCriteria[filter_
groups][0][filters][0][condition_type]=eq

(replace 1 with your order ID).
For more information you can refer to our API documentation
http://devdocs.magento.com/swagger/index_20.html#/ (see
salesOrderItemRepositoryV1 for this particular service)

Hope this helps,
Regards.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/magento/devdocs/issues/946#issuecomment-268780248,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APlA_gwM96iwFLhj24iVq6K8i6l69eEvks5rKl13gaJpZM4LRerw
.

--
Best Regards
Deepika * ||* Sr.Web Developer
m: +91 9988992898
e: deepika.[email protected]

Webomaze Technologies Pvt Ltd http://www.webomaze.com/

Hi once again,
There is separate service that you have to use in order to get custom option metadata (like title, price etc). Services of the Magento\Sales module should not provide this data because it is not their responsibility.

You can try:
/rest/V1/products/{sku}/options/{optionId}

Regards.

Hi,

I have the same problem and if I might refer to the documentation, the product options should be included also if I hit rest/V1/orders/{id} and take one of the items from the response object.

See here: http://devdocs.magento.com/swagger/#!/salesOrderRepositoryV1/salesOrderRepositoryV1GetGet

We did find the cause of this issue and sent a PR to Magento maintainers.

See https://github.com/magento/magento2/pull/9378

This isn't a devdocs issues.

Was this page helpful?
0 / 5 - 0 ratings