1

Using Magento 2.2, REST API. What URI of api for get list of product by item_id?

This below get all item without defined item_id

GET /index.php/rest/V1/carts/mine/items HTTP/1.1
Content-Type: application/json

[
    {
        "item_id": 2094,
        "sku": "Food with option 6-AS-----",
        "qty": 2,
        "name": "Food with option 6",
        "price": 0,
        "product_type": "configurable",
        "quote_id": "1173",
        "product_option": {
            "extension_attributes": {
                "custom_options": [
                    {
                        "option_id": "2",
                        "option_value": "4"
                    },
                    {
                        "option_id": "3",
                        "option_value": "7,9"
                    },
                    {
                        "option_id": "4",
                        "option_value": "10,11,12"
                    }
                ],
                "configurable_item_options": [
                    {
                        "option_id": "155",
                        "option_value": 57
                    }
                ]
            }
        }
    }
]

--- ANSWER ---

I use quote_id instead of item_id then use URI

GET {{url}}/index.php/rest/V1/carts/{{quote_id}}/items

1
  • This will get respond the same json above. Jul 19, 2018 at 7:58

1 Answer 1

1

catalogProductRepositoryV1

Implementation Notes : Get product list

Method : GET

<magento.host>/rest/V1/products/?searchCriteria[filterGroups][0][filters][0][field]=entity_id&searchCriteria[filterGroups][0][filters][0][value]=2905

Parameters for Item id

searchCriteria[filterGroups][][filters][][field] => entity_id

searchCriteria[filterGroups][][filters][][value] => Value 

Note : Please pass authentication Bearer of Admin token or Change the resource to SELF

9
  • The entity_id product not for item_id. Jul 19, 2018 at 6:36
  • item_id in this case use for product that selected its option for use in cart. i think item_id not stand for raw product. Jul 19, 2018 at 6:43
  • Do you need quote_item ? Jul 19, 2018 at 6:48
  • Do you mean that item_id is the id of quote_item? Jul 19, 2018 at 6:50
  • What is your exact need ? where do you wanna call the API ? Jul 19, 2018 at 6:53

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.