cancel
Showing results for 
Search instead for 
Did you mean: 

Product creation(Rest API) -Internal Error. Details are available in Magento log file

Product creation(Rest API) -Internal Error. Details are available in Magento log file

I'm using Magento 2.2 Rest API but I'm getting a below error when i'm trying to create a simple product through REST API. Do I need to enable any settings?

"{\r\n  \"message\": \"Internal Error. Details are available in Magento log file. Report ID: webapi-5c7de5216b594\"\r\n}"
3 REPLIES 3

Re: Product creation(Rest API) -Internal Error. Details are available in Magento log file

Hello @prakash52 ,

 

I think that is an error on api parameter. You are trying to search result using API. Please check the search parameter, Here I give to you an example of search parameter 

<web>/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=increment_id&searchCriteria[filter_groups][0][filters][0][value]=086160005&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

--
If my answer is useful, please Accept as Solution & give Kudos

 

 

Re: Product creation(Rest API) -Internal Error. Details are available in Magento log file

But i'm trying to create a product through Rest API and its throwing error. 

 

URL: http://127.0.0.1/magento/rest/all/V1/products

Sample Json:

{"product":{"id":0,"sku":"Test2","name":"Test Product","attribute_set_id":4,"price":"100","status":1,"visibility":1,"type_id":"simple","created_at":null,"updated_at":null,"weight":0,"extension_attributes":{"website_ids":null,"category_links":null,"stock_item":{"item_id":0,"product_id":0,"stock_id":0,"qty":0,"is_in_stock":false,"is_qty_decimal":false,"show_default_notification_message":false,"use_config_min_qty":false,"min_qty":0,"use_config_min_sale_qty":0,"min_sale_qty":0,"use_config_max_sale_qty":false,"max_sale_qty":0,"use_config_backorders":false,"backorders":0,"use_config_notify_stock_qty":false,"notify_stock_qty":0,"use_config_qty_increments":false,"qty_increments":0,"use_config_enable_qty_inc":false,"enable_qty_increments":false,"use_config_manage_stock":false,"manage_stock":false,"low_stock_date":null,"is_decimal_divided":false,"stock_status_changed_auto":0,"extension_attributes":null},"bundle_product_options":null,"configurable_product_options":null,"configurable_product_links":null,"downloadable_product_links":null,"downloadable_product_samples":null,"giftcard_amounts":null},"product_links":null,"options":null,"media_gallery_entries":null,"tier_prices":null,"custom_attributes":[{"attribute_code":"description","value":"Test1"},{"attribute_code":"short_description","value":"Test1"},{"attribute_code":"meta_title","value":"Test1"},{"attribute_code":"meta_description","value":"Test1"},{"attribute_code":"meta_keyword","value":"Test1"},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"required_options","value":"0"}]},"saveOptions":true}

Exception log:

[2019-03-05 17:02:52] main.CRITICAL: Report ID: webapi-5c7eabbc53099; Message: Property "GiftcardAmounts" does not have accessor method "getGiftcardAmounts" in class "Magento\Catalog\Api\Data\ProductExtensionInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5c7eabbc53099; Message: Property \"GiftcardAmounts\" does not have accessor method \"getGiftcardAmounts\" in class \"Magento\\Catalog\\Api\\Data\\ProductExtensionInterface\". at C:\\xampp\\htdocs\\magento\\vendor\\magento\\framework\\Webapi\\ErrorProcessor.php:205, LogicException(code: 0): Property \"GiftcardAmounts\" does not have accessor method \"getGiftcardAmounts\" in class \"Magento\\Catalog\\Api\\Data\\ProductExtensionInterface\". at C:\\xampp\\htdocs\\magento\\vendor\\magento\\framework\\Reflection\\NameFinder.php:100)"} []

I'm not sure what is missing in above request.

 

 

 

Re: Product creation(Rest API) -Internal Error. Details are available in Magento log file

I'm seeing this to, using REST API to create product but in Magento 2.3.7

 

Did you find any reason/fix?