cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved] REST API issue : creating a product with stock_data

SOLVED

[Solved] REST API issue : creating a product with stock_data

Hello everybody,

 

I'm currently trying to create a software which use the REST API. All is ok but, when I want to add a product and in the same time the stock infos, magento answer that the product is created but nothing is done in the inventory tab... (qty : 0 and out of stock)

 

Here is an example in Json : 

 

{
"type_id":"simple",
"attribute_set_id":4,
"sku":"test_dress",
"name":"Test_dress",
"price":"2000.000",
"weight":"0.5000",
"status":1,
"visibility":4,
"tax_class_id":0,
"description":"dress",
"short_description":"Wedding dress",
"country_of_manufacture":"AD",
"special_price":"1500.0000",
"stock_data":{
     "qty":"53",
     "is_qty_decimal":0,
     "is_in_stock":1,
     "is_decimal_divided":0
     }
}

The resource access is set to "all" (REST - Roles and REST - Attributes).

 

If somebody can help me... Thank you !

1 ACCEPTED SOLUTION

Accepted Solutions

Re: REST API issue : creating a product with stock_data

Problem solved : manage_stock need to be setted to 1 in the request.

View solution in original post

2 REPLIES 2

Re: REST API issue : creating a product with stock_data

Problem solved : manage_stock need to be setted to 1 in the request.

Re: REST API issue : creating a product with stock_data

Glad to hear you got it sorted @thom540, thanks for sharing your solution!

--

Developer Relations, Adobe Experience Cloud
Problem solved? Click Accept as Solution!
Still stuck? Check out our documentation: https://magento.com/resources/technical