Commerce orders API - how to filter results by orderStatus?
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- I am trying to filter orders fetched from the API /o/headless-commerce-admin-order/v1.0/orders by orderStatus, but that does not seem to be possible.
Steps to reproduce:
1. Create an order and accept it
2. GET /o/headless-commerce-admin-order/v1.0/orders?filter=orderStatus%20eq%2010
(orderStatus eq 10 - so we want to filter for accepted orders)
Expected result: Order which was created and accepted is shown
Actual result: API returns Error: response status is 400 and in logs there are:
2023-01-19 16:21:22 2023-01-19 14:21:22.839 WARN [http-nio-8080-exec-6][BaseExceptionMapper:81] Problem {detail=null, status=Bad Request, title=Collection not allowed., type=null}
2023-01-19 16:21:22 com.liferay.portal.odata.filter.InvalidFilterException: Collection not allowed.
Did this article resolve your issue ?