APIs usually support searching so that a subset of the collection is returned. For example, the following is a request to get only completed orders:
https://api.examplebucks.org/v1/orders?status=completed
As you can see, we put the status field as a query parameter to the URI. This is the preferred way of doing the search for a collection. You don't need to add /search to the URI, like in the following code:
https://api.examplebucks.org/v1/orders/search?status=completed // Avoid
And the following request will return all the completed orders, with the latest completed at the top of the list:
https://api.examplebucks.org/v1/orders?status=completed&sort=-completedDate
As you can see, we use the sort parameter to trigger the sorting. Prepending - is used for specifying a descending sort.