Using undocumented `product_id` query parameter when getting orders

Hello,
We need to find all orders with a particular product (filter by product_id).
The web UI allows filtering of orders by product, and I can see it’s using the GraphQL API with a query parameter product_id. F.E:

product_id:"8884385415442,8431162982674,8502922019090"

But this parameter is missing from the documentation. I was wondering if it is safe to use it?

Also by trial and error, I found out the Admin API allows filtering by product_id or by variant_id:

GET admin/api/2023-10/orders.json?&product_id=8382009803026

It works correctly. It has validations on the parameter. Returns an error if the format is not correct. Returns an empty list if there are no orders with the given product. However, it’s not in the documentation.
I want to know if I can use these query parameters as well, and why aren’t they in the docs?

Hey @nmaslarski

I was wondering if it is safe to use it?

Nice find! They’re not officially supported / documented and could stop working in future.