Magento2: Get all orders using REST API?
Ideally next request must be valid to get all orders
$this->get('rest/V1/orders');
But you get error instead
{"message":"%fieldName is a required field.","parameters":{"fieldName":"searchCriteria"}}
Error occurred because request is processed by
\Magento\Sales\Api\OrderRepositoryInterface::getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
and $searchCriteria
argument is required.
You can skip value for this parameter. Next request must be valid too.
$this->get('rest/V1/orders?searchCriteria');
I got the solution for this. I passed my request like:
$this->get('rest/V1/orders?searchCriteria=entity_id');
and for getting all orders without any filter. Use below code:
$this->get('rest/V1/orders?searchCriteria');