API Orders Search not accepting value

Doing an order search via API as follows:

{{magentoEndpoint}}/rest/default/V1/orders?searchCriteria[filterGroups][0][filters][0][field]=status&searchCriteria[filterGroups][0][filters][0][value]=pending&searchCriteria[filterGroups][0][filters][0][condition_type]=eq

However, the following results come back:

{
    "items": [],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "status",
                        "value": "",
                        "condition_type": "eq"
                    }
                ]
            }
        ]
    },
    "total_count": 0
}

As you can see, the value parameter didn't come through. Can anyone tell why? Is there some trick to searching orders by status?

Solutions

Turns out the key was the order of the parameters. When I changed it to field, then condition_type, then value in the querystring, it worked.

Tags: Magento 2.x / API

Similar questions

How to create complex search filters while doing a GET on sales orders through Magento 2 REST API?
I have 12 sales orders which have "store_id" = 1. Out of which 3 orders have "status" = "pending" I get all the 12 orders when I make a GET request to http://mystore/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][1][field]=store_id&searchCriteria[filter_groups][0][filters][1][value]=1 I want to make a OR search, I want all t...
remove values from search result in catalog search top search box
i have tried core/Mage/catalogSearch/Helper/Data.php and ResultController.php in Controller and Query.php in model but couldn't find code so i can fix it here is snapshot attached which i have to remove ..
get the value of sales_order_address table custom column value in rest/V1/orders/
I'm unable to get the value of sales_order_address table custom column value in rest/V1/orders/?searchCriteria[filter_groups][0][filters][0][field]=status&searchCriteria[filter_groups][0][filters][0][value]=processing");
How to change the status value in orders api?
In the orders api of Magento 2, I'm sending status parameter as completed. But I have custom status as "ProdCompleted. So everytime I get status="completed" That's why I want that if api get parameter status="completed" then it should send the response for status="ProdCompleted" http://magentosite/rest/V1/orders How can I do this? can I override th...
Magento 2 Get Value of Custom Attribute on Magento 2 Rest API V1/orders/items
I am trying to get the Custom Attribute I have in the sales_order_item to display on the rest/V1/orders/items API call. I was able to get the Attribute to display on the rest/V1/orders API call. Using a Magento\Sales\Api\OrderRepositoryInterface plugin. But the Attribute don't display on the rest/V1/orders/items API call. I was trying to use the Or...
Magento2.3.3 :Get Value of Custom Product Attribute on Magento2 Rest API V1/orders/
I am trying to get the Custom Product Attribute (uom). I want to get the Attribute value to display on the rest/V1/orders API call. m using this https://magento.stackexchange.com/a/303780/68018 app/code/{Vendorname}/{ModuleName}/etc namespace {VendorName}{ModuleName}\Plugin\ProductOption.php app/code/{Vendorname}/{ModuleName}/etc/di.xml

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.