How to fetch orders from past x hours via Shopware Admin API?

Viewed 78

The POST request to the https://shop-URL/api/search/order endpoint requires a filter in order to return a specific selection.

I can't any examples or proper documentation about what the payload would have to look like in order to be able to fetch orders in between certain dates.

1 Answers

This is possible with a filter. The filter has to look like this:

{
  "type": "range",
  "field": "createdAt",
  "parameters": {
    "lte": "2021-01-17T12: 00: 00.333+00: 00"
  }
}

Of course this is only an example and needs adjustment or multiple range filters to deliver the right result.

Related