Hello everyone,
I am new to this group and Shopware, I have to connect to their API to get sales order information. It is a store that I did not build myself, I have been told that it has been built according to the standard with slight adaptations.
I am testing with Postman to access the API and once I am successful I will look into how to do the same with my desktop application written in C#, but that is another battle I will have to look into later.
I’ve read the documentation related to ordering and I’m not quite getting it to work.
The URL I’m using works to get an access token of type Bearer and that token I use for API queries.
When I query the API version https://xxx/api/_info/openapi3.json, it returns, among other things:
{
„openapi“: „3.0.0“,
„info“: {
„title“: „Shopware Admin API“,
„version“: „3“
},
„servers“: [
{
„url“: „https://xxx/api/v3“
}
],
…
}
To access the API I am using GET to the URL https://xxx/api/v3/order, this returns me all the orders in the file.
If in Params I set Key=limit and Value=5 it works fine, it returns 5 orders.
If in Params I set Key=filter[orderDate] and Value=2022-02-15 it works fine, it returns all the orders of the requested date.
With these commands it only returns the order headers, never the line items that belong to the order.
These are simple queries, but I need to make a complex query, I need the orders from the date (x) until today, that have the payment status in PAID and the shipping status to the customer in DONE. In this query I also need it to return the line items of the orders.
The help I need is: how to make a complex query in Params?
I have tried the query https://xxx/api/v3/order?filter[0][property]=orderDate&filter[0][expression]=>=&filter[0][value]=2022-02-15, that the documentation says in REST API - Examples using the order resource, but it doesn’t work for me, it returns the error:
{
„errors“: [
{
„status“: „400“,
„code“: „FRAMEWORK__INVALID_FILTER_QUERY“,
„title“: „Bad Request“,
„detail“: „Value for filter type is required.“,
„source“: {
„pointer“: „“
},
„meta“: {
„parameters“: {
„message“: „Value for filter type is required.“
}
}
}
]
}
I have tried infinite variants without success, can someone help me to learn how to do a complex query like the one I mentioned.
Thanks in advance.