0

I want to get product info including the product qty how can i achieve it.

Currently i am using

rest/default/V1/products?searchCriteria

To get all the product but it is missing qty attribute in it.

Here is the result

   [0] => stdClass Object
      (
        [id] => 346
        [sku] => WATCH
        [name] => WATCH
        [attribute_set_id] => 4
        [price] => 3
        [status] => 1
        [visibility] => 4
        [type_id] => simple
        [created_at] => 2018-06-03 05:36:33
        [updated_at] => 2018-06-03 05:36:33
        [weight] => 1
        [product_links] => Array
            (
            )

        [tier_prices] => Array
            (
            )

        [custom_attributes] => Array
            (
                [0] => stdClass Object
                    (
                        [attribute_code] => meta_title
                        [value] => WATCH
                    )

                [1] => stdClass Object
                    (
                        [attribute_code] => meta_keyword
                        [value] => WATCH
                    )

                [2] => stdClass Object
                    (
                        [attribute_code] => meta_description
                        [value] => WATCH 
                    )

                [3] => stdClass Object
                    (
                        [attribute_code] => image
                        [value] => /p/i/pinking_swatch_sq_dia_beige_1.png
                    )

                [4] => stdClass Object
                    (
                        [attribute_code] => small_image
                        [value] => /p/i/pinking_swatch_sq_dia_beige_1.png
                    )

                [5] => stdClass Object
                    (
                        [attribute_code] => thumbnail
                        [value] => /p/i/pinking_swatch_sq_dia_beige_1.png
                    )

                [6] => stdClass Object
                    (
                        [attribute_code] => category_ids
                        [value] => Array
                            (
                                [0] => 4
                                [1] => 61
                            )

                    )

                [7] => stdClass Object
                    (
                        [attribute_code] => options_container
                        [value] => container2
                    )

                [8] => stdClass Object
                    (
                        [attribute_code] => required_options
                        [value] => 0
                    )

                [9] => stdClass Object
                    (
                        [attribute_code] => has_options
                        [value] => 0
                    )

                [10] => stdClass Object
                    (
                        [attribute_code] => url_key
                        [value] => watch
                    )

                [11] => stdClass Object
                    (
                        [attribute_code] => gift_message_available
                        [value] => 2
                    )

                [12] => stdClass Object
                    (
                        [attribute_code] => swatch_image
                        [value] => /p/i/pinking_swatch_sq_dia_beige_1.png
                    )

                [13] => stdClass Object
                    (
                        [attribute_code] => tax_class_id
                        [value] => 2
                    )

            )

    )

1 Answer 1

0

Try using /V1/stockItems/:productSku

For more details, you can go through https://devdocs.magento.com/guides/v2.0/rest/list.html#cataloginventory

5
  • i am using this one. github.com/WebWeave/magento2-sdk/tree/master/src/WebWeave/… How can i use it. Or should i create a new one
    – Avesh Naik
    Commented Jun 14, 2018 at 9:23
  • @avesh You can modify it according to your requirement. Commented Jun 14, 2018 at 9:28
  • ya i modified it, even i am getting product but when i request the with your url. It fails.
    – Avesh Naik
    Commented Jun 14, 2018 at 9:32
  • @avesh What have you changed? Commented Jun 14, 2018 at 9:55
  • Do you still need help with this issue?
    – Joao71
    Commented Jul 6, 2020 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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