Zend certified PHP/Magento developer

Query SearchCriteria Deals – status_histories

Good morning,

I need to do a query about order with this conditions:

  • Status
  • State
  • Payment > method
  • status_histories > comment

Status, State and Payment_method works.

curl --location -g --request GET 'https://domain/rest/V1/orders/?searchCriteria[filterGroups][0][filters][0][field]=status&searchCriteria[filterGroups][0][filters][0][value]=delivered&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=state&searchCriteria[filterGroups][1][filters][0][value]=complete&searchCriteria[filterGroups][1][filters][0][conditionType]=eq&searchCriteria[filterGroups][2][filters][0][field]=payment_method&searchCriteria[filterGroups][2][filters][0][value]=adyen_cc&searchCriteria[filterGroups][2][filters][0][conditionType]=finset' 
--header 'Authorization: Bearer ' 
--header 'Content-type: application/json'

When we try to add the fourth status_histories > comment

&searchCriteria[filterGroups][1][filters][0][conditionType]=eq&searchCriteria[filterGroups][2][filters][0][field]=status_histories_comment&searchCriteria[filterGroups][2][filters][0][value]=Gsped&searchCriteria[filterGroups][2][filters][0][conditionType]=finset

it gives me an error and we can’t find any documentation to pass status_histories + comment.

For the payment method we followed the instructions and merged the “payment” and “method” fields into payment_method.

https://devdocs.magento.com/guides/v2.4/rest/search-endpoint.html

For “status_histories” + “comment” I tried status_histories_comment but it doesn’t work.

Does anyone have a solution?

Thank a lot.