legacy-knowledge-base
公開されました Jun. 30, 2025

コマース注文 API - orderStatus で結果をフィルタリングする方法は?

written-by

Sorin Pop

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

learn-legacy-article-disclaimer-text

問題

  • API /o/headless-commerce-admin-order/v1.0/orders から取得した注文を orderStatus でフィルタリングしようとしていますが、それは不可能のようです。

再現する手順:

1. 注文を作成して受け入れる

2. GET /o/headless-commerce-admin-order/v1.0/orders?filter=orderStatus%20eq%2010

(orderStatus eq 10 - 受け入れられた注文をフィルタリングしたい)

期待される結果: 作成され、承認された注文が表示されます

実際の結果: API はエラーを返します: 応答ステータスは 400 で、ログには次のように表示されます。

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.

Environment

  • 7.4

解決策

  • フィルタでは次の種類の構文を使用する必要があります:

    (orderStatus/any(x:(x eq 10)))
did-this-article-resolve-your-issue

legacy-knowledge-base