Closed neran closed 8 years ago
Try to set the price in the request as int, not as string (without quote).
Still the same without quotes: {"product":{"sku":"13744-SG-H-CP23","name":"Handmade Safed Hanukah Candles - Bright Fire","price":13,"status":1,"attributeSetId":4,"options":[]}}
Try to add the product type in your request
Is it this parameter? typeId (string, optional): Type id Which value for simple product? "Simple Product"?
Try something like this:
{
"product": {
"sku": "AN_SKU_FOR_YOU",
"name": "For You",
"attributeSetId": 9,
"price": 12.5,
"status": 1,
"visibility": 4,
"typeId": "simple",
"weight": 0,
"extensionAttributes": {
"stockItem": {
"stockId": 1,
"qty": "1",
"isInStock": true,
"isQtyDecimal": false,
"useConfigMinQty": true,
"minQty": 0,
"useConfigMinSaleQty": 0,
"minSaleQty": 0,
"useConfigMaxSaleQty": true,
"maxSaleQty": 0,
"useConfigBackorders": false,
"backorders": 0,
"useConfigNotifyStockQty": true,
"notifyStockQty": 20,
"useConfigQtyIncrements": false,
"qtyIncrements": 0,
"useConfigEnableQtyInc": false,
"enableQtyIncrements": false,
"useConfigManageStock": true,
"manageStock": true,
"isDecimalDivided": true,
"stockStatusChangedAuto": 0,
"extensionAttributes": {}
}
},
"options": [],
"tierPrices": [],
"customAttributes": []
},
"saveOptions": true
}
Obviously use your own preferences specially your attribute set. This one works for me.
Perfect! Works! typeId did it. Thank you!!
Works! Adding typeId did it. In my case there where missing also some custom attributes, not only the price. Thank you!!
When I POST /V1/products with these example parameters: {"product":{"sku":"13744-SG-H-CP23","name":"Handmade Safed Hanukah Candles - Bright Fire","price":"13.00","status":1,"attributeSetId":4,"options":[]}}
The product is created but the price is empty: http://prntscr.com/accys0
Using PUT - same result.
If I POST again with the same parameters - the price is updated! Going crazy, what am I missing?
Thanks in advance.