cancel
Showing results for 
Search instead for 
Did you mean: 

Details of the product is not shown when fetch all the product from REST API

Details of the product is not shown when fetch all the product from REST API

Hi sir,

When i tried to fetch all the products from REST API details of the field is not shown.
I had used this API  to get all product 
"http://localhost/magento2.1/rest/all/V1/products?searchCriteria[pageSize]=100&searchCriteria[currentPage]=1";
 
The Output of these URL is
"item" : {
        "id" : 13,
        "sku" : "play game",
        "name" : "play game",
        "attribute_set_id" : 4,
        "price" : 59,
        "status" : 1,
        "visibility" : 4,
        "type_id" : "simple",
        "created_at" : "2018-05-10 11:59:37",
        "updated_at" : "2018-05-10 11:59:37",
        "weight" : 3,
        "extension_attributes" : [ ],
        "product_links" : [ ],
        "tier_prices" : [ ],
        "custom_attributes" : [
            {
                "attribute_code" : "description",
                "value" : "<p>high quality chip ,rom:4gb.</p>"
            },
            {
                "attribute_code" : "meta_title",
                "value" : "play game"
            },
            {
                "attribute_code" : "meta_keyword",
                "value" : "play game"
            },
            {
                "attribute_code" : "meta_description",
                "value" : "play game high quality chip ,rom:4gb."
            },
            {
                "attribute_code" : "news_from_date",
                "value" : "2018-05-01 00:00:00"
            },
            {
                "attribute_code" : "news_to_date",
                "value" : "2018-05-31 00:00:00"
            },
            {
                "attribute_code" : "options_container",
                "value" : "container2"
            },
            {
                "attribute_code" : "required_options",
                "value" : "0"
            },
            {
                "attribute_code" : "has_options",
                "value" : "0"
            },
            {
                "attribute_code" : "country_of_manufacture",
                "value" : "JP"
            },
            {
                "attribute_code" : "url_key",
                "value" : "play-game"
            },
            {
                "attribute_code" : "tax_class_id",
                "value" : "2"
            },
            {
                "attribute_code" : "gift_message_available",
                "value" : "2"
            }
        ]
    },
Sir,i did not got the detail of this fields which is showing null as given below
"extension_attributes" : [ ],
"product_links" : [ ],
"tier_prices" : [ ],
How can i get all this field detail of bulk products fetch with single API call.
In this stock_item detail is not shown.
Please provide us how to get detail of this fields -
extension_attributes,product_links,tier_prices

Thanks
Ashish Kumar
7 REPLIES

Re: Details of the product is not shown when fetch all the product from REST API

Hello @ashish_kumar6

 

I don't know why you need all attribute on list page.

 

please check below issue:- https://github.com/magento/magento2/issues/2606

 

Hope it will help you.

 

 

Re: Details of the product is not shown when fetch all the product from REST API

Hi Sunil Patel,

 I need to save all the product detail in Data base, so i need the detail of all fields and also update the stock_item of all the product.

"extension_attribute":[ ]

"product_links":[ ]

"tier_prices":[ ]

this fields is showing null

how can i update the stock_item which is inside extension_attributes. 

Re: Details of the product is not shown when fetch all the product from REST API

Hi @ashish_kumar6

 

okay i understand your problem !

 

As you said you are getting blank in the below outputs :

 

 

extension_attribute:[ ]

product_links:[ ]

tier_prices:[ ]

 

 

Because in the backend your product doesn't have values for this !

 

so when create one product at backend and filled up all the details in it - then try to get that product using REST API - you will get all the details in it.

 

like you need to add Tier Pricing for that products , you need to set cross-sell/up-sells products for that - so create a product which covers all the values.

 

then get that product with rest api !!

 

you will get all the details ~!

 

hope it helps !

 

if issue solved,Click Kudos & Accept as Solution

Re: Details of the product is not shown when fetch all the product from REST API

Hello sir,

       I don't want to fetch single product detail in single API CALL or SKU.

I want to save all product fields detail with single API CALL.

Please provide us the procedure to save all product fields details with bulk product fetch using REST API.

I had used this URL in REST API-

"http://localhost/magento2.1/rest/V1/products?searchCriteria[pageSize]=100&searchCriteria[currentPage]=1"; 

 

Thanks 

Ashish Kumar

Re: Details of the product is not shown when fetch all the product from REST API

Hi @ashish_kumar6

 

As i mention !! by default it is not available in magento 2 !

 

you need to customize this api or you need to create your own api for the same

 

as of now its not available in Default Magento 2 so !!

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Details of the product is not shown when fetch all the product from REST API

Hello sir,

         You said that it's not available in magento2. 

Can i get in any other Magento series such as magento 2.1, 2.2, 2.

Also give the procedure to make custom api to get detail of the product.

Thanks

Ashish Kumar

Re: Details of the product is not shown when fetch all the product from REST API

Hi @ashish_kumar6

 

RE : Can i get in any other Magento series such as magento 2.1, 2.2, 2.

 

- Well API is common for all the versions - meaning it is not available in any version as of now , you can add it in feature request on the forums.

 

RE : Also give the procedure to make custom api to get detail of the product.

 

- i have already shared links how to create a custom api - you need to get product details in that programatically. Its broad topic so in your custom api - programatically you need to get product details !

 

Hope it helps 

if issue solved,Click Kudos & Accept as Solution