2

I've an extension attribute on products, declared in the following way:

<attribute code="stock_item" type="Magento\CatalogInventory\Api\Data\StockItemInterface">
    <resources>
        <resource ref="anonymous"/>
    </resources>
    <join reference_table="cataloginventory_stock_item"
          join_on_field="entity_id"
          reference_field="product_id">
        <field>qty</field>
        <field>item_id</field>
    </join>
</attribute>

And I'd like to filter by the qty attribute greater than zero, and i call :

rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=qty&searchCriteria[filter_groups][0][filters][0][value]=0&searchCriteria[filter_groups][0][filters][0][condition_type]=gt

but I have got an error attribute name invalid

Is there a way to filter this? Am I missing something?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.