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

asked Jul 19, 2018 at 3:31
1
  • This will get respond the same json above. Commented 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

answered Jul 19, 2018 at 5:42
9
  • The entity_id product not for item_id. Commented 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. Commented Jul 19, 2018 at 6:43
  • Do you need quote_item ? Commented Jul 19, 2018 at 6:48
  • Do you mean that item_id is the id of quote_item? Commented Jul 19, 2018 at 6:50
  • What is your exact need ? where do you wanna call the API ? Commented Jul 19, 2018 at 6:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.