I have a problem with woocommerce rest api. I want to create a product with photos via rest api, but it works only without photos.
This snippet of code work:
{ "regular_price": "21.99", "name": "Premium Quality", "description": "Pellentesque habitant morbi tristique senectus et netus", "type": "simple" }
but this doesn't work:
{ "regular_price": "21.99", "images": "[{\"src\":\"https://static01.nyt.com/images/2017/03/17/world/europe/oakImage-1489777706390/oakImage-1489777706390-largeHorizontal375.jpg\",\"position\":0,\"id\":0}]", "name": "Premium Quality", "description": "Pellentesque habitant morbi tristique senectus et netus", "type": "simple" }
The JSON is validate. The response from the server is:
{ "code": "woocommerce_product_invalid_image_id", "message": "#0 is an invalid image ID.", "data": { "status": 400 } }