# I want to query all product sets that contain a particular catalog item

**URL:** <https://developer.squareup.com/forums/t/i-want-to-query-all-product-sets-that-contain-a-particular-catalog-item/25075>\
**Category:** Questions\
**Tags:** catalog-api\
**Created:** [January 13, 2026, 6:58pm UTC](https://developer.squareup.com/forums/t/i-want-to-query-all-product-sets-that-contain-a-particular-catalog-item/25075 "2026-01-13T18:58:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjloeffler.truno.com](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@tjloeffler.truno.com](https://developer.squareup.com/forums/u/tjloeffler.truno.com)\
**Post date:** [January 13, 2026, 6:58pm UTC](https://developer.squareup.com/forums/t/i-want-to-query-all-product-sets-that-contain-a-particular-catalog-item/25075/1 "2026-01-13T18:58:24Z")

</div>

I am trying to query the catalog api for a product set that has product\_ids\_any containing a particular item id:

```auto
{
    "object_types": [
      "PRODUCT_SET"
    ],
    "query":{
        "exact_query":{
            "attribute_name": "product_ids_any",
            "attribute_value": "<my item id>"
        }
    },
    "limit": 2
  }

```

what I get back is:

> {
> 
> ```
> "errors": \[
> 
> {
> 
> "category": "INVALID_REQUEST_ERROR",
> 
> "code": "INVALID_VALUE",
> 
> "detail": "Unknown attribute definition name \\"product_ids_any\\".",
> 
> "field": "exact_query.attribute_name"
> 
> }
> 
> \]
> 
> ```
> 
> }

I should add that what I really want to do is get all discounts for all items, which is very cumbersome and requires several calls.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [January 13, 2026, 6:58pm UTC](https://developer.squareup.com/forums/t/i-want-to-query-all-product-sets-that-contain-a-particular-catalog-item/25075/2 "2026-01-13T18:58:36Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Call the SearchCatalogItems Endpoint](https://developer.squareup.com/docs/catalog-api/search-catalog-items)**
>
> Learn how to search for items or item variations using one or more supported query filters.

> **[Call the SearchCatalogObjects Endpoint](https://developer.squareup.com/docs/catalog-api/search-catalog-objects)**
>
> Learn how to use the SearchCatalogObjects endpoint to search for objects of any type programmatically.

> **Additional Documentation**
>
> [Catalog API](https://developer.squareup.com/docs/catalog-api/what-it-does)  
> [Search for Items and Objects](https://developer.squareup.com/docs/catalog-api/search-catalog)  
> [Retrieve Catalog Objects](https://developer.squareup.com/docs/catalog-api/retrieve-catalog-objects)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [January 13, 2026, 10:26pm UTC](https://developer.squareup.com/forums/t/i-want-to-query-all-product-sets-that-contain-a-particular-catalog-item/25075/3 "2026-01-13T22:26:20Z")

</div>

At this time the Square API returns an `Unknown attribute definition name` error when trying to search by `product_ids_any` . This field exists in product set objects but is not searchable through the API’s query system at this time. The Catalog API’s `exact_query` method cannot search within array fields like `product_ids_any` , and this specific attribute is not recognized as a valid searchable field.

You’ll have to retrieve all product sets from the Catalog API call and filtering client-side. This is the most efficient solution available and cannot be improved further due to Square API limitations. 🙂
