Discussing APIs and development related to customers, discounts, and order management.
Hi
Is it possible to search for a collection of Orders by a value in a customAttribute (i.e. their key/value pairs)? I've tried a number of approaches across all the API that I could experiment with, but to no avail.
I'm hoping that I've missed something and that one of the API support it (maybe I just couldn't find the correct docco), otherwise I'd be keen to hear of there's a workaround (like leveraging a Saved Search, or some other means).
The GraphQL API looked to be the most promising, but I notice that the QueryRoot.OrderConnection supports filtering on the following properties (not including custom attributes):
On top of that, the individual Order object's customAttributes collection is not searchable (at that level) in graphql.
I'll greatly appreciate suggestions to help me work this out.
Cheers,
Sam
Hello!
Unfortunately the greeting above will be the only good news - filtering by order_notes (as they're called in REST API) or customAttributes (as they're called in GraphQL API) isn't possible no matter how you slice and dice the APIs.
@KarlOffenberger do you know if this has changed since your reply here in 2019? I'm trying to query GraphQL to get the first: 5 orders that have a specific customAttribute
I am also looking for a way to do this without pulling every order in the store every time i want to run a report.
Really need the ability to query orders by attribute or metafield value.