0

I am stuck here, i want to get product's quantity by using API filter like this

https://talonton.test/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=entity_id&searchCriteria[filter_groups][0][filters][0][value]=2047&searchCriteria[filter_groups][0][filters][0][condition_type]=gt

is there any way to return the quantity of each product filtered?

{ "items": [ { "id": 2048, "sku": "lj", "name": "Long Jean", "attribute_set_id": 4, "price": 65, "status": 1, "visibility": 4, "type_id": "simple", "created_at": "2018-05-10 09:06:33", "updated_at": "2018-05-11 02:30:28", "product_links": [], "tier_prices": [], "custom_attributes": [ { "attribute_code": "meta_title", "value": "Long Jean" }, { "attribute_code": "meta_keyword", "value": "Long Jean" }, { "attribute_code": "meta_description", "value": "Long Jean " }, { "attribute_code": "image", "value": "/m/p/mp11-brown_main_1.jpg" }, { "attribute_code": "small_image", "value": "/m/p/mp11-brown_main_1.jpg" }, { "attribute_code": "thumbnail", "value": "/m/p/mp11-brown_main_1.jpg" }, { "attribute_code": "category_ids", "value": [ "11", "13", "18" ] }, { "attribute_code": "options_container", "value": "container2" }, { "attribute_code": "required_options", "value": "0" }, { "attribute_code": "has_options", "value": "0" }, { "attribute_code": "msrp_display_actual_price_type", "value": "0" }, { "attribute_code": "url_key", "value": "long-jean" }, { "attribute_code": "tax_class_id", "value": "2" }, { "attribute_code": "gift_message_available", "value": "2" }, { "attribute_code": "swatch_image", "value": "/m/p/mp11-brown_main_1.jpg" }, { "attribute_code": "promotion_start_date", "value": "2018-05-09 00:00:00" }, { "attribute_code": "promotion_end_date", "value": "2018-05-25 00:00:00" }, { "attribute_code": "whole_price", "value": "60.0000" }, { "attribute_code": "whole_supplier_price", "value": "55.0000" } ] } ] }

Thank in advanced.

0

You can use catalogInventoryStockRegistryV1 on API. So the URL becomes:

https://talonton.test/rest/V1/stockItems/{productSku}

From the response, you can get the qty to retrieve the quantity of individual product.

Ref: devdocs.magento.com/swagger/

  • 1
    Yes, that's right in another question. But i want to get all products including qty by filtering from which id i have defined. ex: i want to get all product which has id is greater than 105 – FANBOYS May 11 '18 at 9:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.