No Active field in product objects

Hi, I am working with GrapQL API and can not find the field ‘active’ in product objects.

When I try to get all products from inventory, I also got ‘inactive’ products, which I don’t need. Because there is no active field, I can not filter them. How can I manage it ?

Thanks

Hi @khanhnc46
I wasn’t able to find a workaround to it but already submitted a request for one of our engineers to work on this so we are able to filter if it is active or not.
I will let you know as soon as I have an update on this.
Thanks for catching this!,
Tom

1 Like

Hi @khanhnc46
I apologize for the delay while working on this.
You should be able to query only for active products now. You will have to include a filter active: true
Something like this:

query {
  warehouse_products(warehouse_id: "V2FyZWhvdXNlOjExNzkw", active: true) {
    request_id
    complexity
    data(first: 1) {
      edges {
        node {
          on_hand
          product{
            sku
            legacy_id
          }
          inventory_bin
          inventory_overstock_bin
          reserve_inventory
          replenishment_level
          reorder_amount
          reorder_level
          backorder
          allocated
          available
          non_sellable_quantity
          custom
          customs_value
          created_at
          updated_at
          sell_ahead
          active
          inbounds(first: 10) {
            edges {
              node {
                sell_ahead
              }
            }
          }
        }
      }
    }
  }
} 

The way it works is

  • active: true it returns ONLY Active products
  • active: false it returns both Active and Inactive products

Let me know if there is anything else I could help you with.
Thanks!
Tom

1 Like

Hi @tomasw
Will this filter be implemented also for Products query? I need to get only Active Products by customer_account_id

Hi @varun
The problem with that is that you might have a product Active in a warehouse and Inactive in the other, so that filter won’t work for that case.
That is why the filter is set at a warehouse_product level

Let me know if that doesn’t help
Thanks un advance!
Tom

Hi @tomasw
Unfortunately I can’t use warehouse_product query, because I need to filter products by customer_account_id
request_id: 5f2bbc965130a97fad66166f

Hi @varun
I just logged a Feature Request for this, I will let you know as soon as I get a response about this from our engineers.

The request os to be able to query the warehouse_products and filter by active + customer_account_id that would work for you, right?
Because the products query might not be able to be filtered by active right away, so we could add the customer_account_id to the other query (warehouse_products)

Thanks again!
Tom

Hi @tomasw
I’m still not sure if it will help me, because sometimes I also need to filter product by SKU, is it possible to filter by SKU in warehouse_products query?

Hi @varun
Added that to the request as well. The good news is that this has been approved. However, we are currently working on other tasks regarding the Public API, so it might not be available in the short term.
I will try to expedite and see if this can be added soon.
I will let you know as soon as I have an update about it.
Thanks again!
Tom

1 Like

Hello @tomasw
Being able to filter by SKU on warehouse_products is also a requirement for my team. Do you have a visibility about this feature ? Thank you

Hi @PierreM
Welcome to the community!
I checked the progress of this feature and it seems to be almost ready to implement.
I contacted the Engineer for a better ETA and will let you know as soon as I get a response back.
Thanks for the patience while we work on this!
Tom

Thank you @tomasw. Can’t wait to hear from you about this.

Hello @tomasw, do you have any visibility regarding this possibility ? Thank you