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
asked Jul 19, 2018 at 3:31
Bong Channarith
78011 silver badges31 bronze badges
1 Answer 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
answered Jul 19, 2018 at 5:42
Aditya Shah
7,6813 gold badges41 silver badges79 bronze badges
-
The
entity_idproduct not foritem_id.Bong Channarith– Bong Channarith2018年07月19日 06:36:51 +00:00Commented Jul 19, 2018 at 6:36 -
item_idin this case use forproductthat selected its option for use in cart. i thinkitem_idnot stand for rawproduct.Bong Channarith– Bong Channarith2018年07月19日 06:43:15 +00:00Commented Jul 19, 2018 at 6:43 -
Do you need
quote_item?Aditya Shah– Aditya Shah2018年07月19日 06:48:23 +00:00Commented Jul 19, 2018 at 6:48 -
Do you mean that
item_idis the id ofquote_item?Bong Channarith– Bong Channarith2018年07月19日 06:50:45 +00:00Commented Jul 19, 2018 at 6:50 -
What is your exact need ? where do you wanna call the API ?Aditya Shah– Aditya Shah2018年07月19日 06:53:00 +00:00Commented Jul 19, 2018 at 6:53
default
jsonabove.