Woocommerce and Google script apps rest_invalid_param","message":"Invalid parameter(s): categories",
Budget: $15 – $25 USD
I´m trying to create simply products on Woocommerce using GAS, very few params are working. However, once adding categories, attributes or aka arrays, I get the error:
This code work and add a single product without any category, image or attributes aka simple.
var data =
{
"name" : " TESTING HERE TOO",
"type" : "simple",
"regular_price" : "21.99",
"weight" : 60,
"manage_stock" : true,
"stock_quantity" : 10,
};
this one however, doesn´t work:
var data =
{
"name" : " TESTING HERE TOO",
"type" : "simple",
"regular_price" : "21.99",
"weight" : 60,
"manage_stock" : true,
"stock_quantity" : 10,
"categories": [ { "id": 16 ,"name":"Uncategorized","slug" : "uncategorized " } ],
};
ERROR: {"code":"rest_invalid_param","message":"Invalid parameter(s): categories","data":{"status":400,"params":{"categories":"categories[0] is not of type object."},"details":{"categories":{"code":"rest_invalid_type","message":"categories[0] is not of type object.","data":{"param":"categories[0]"}}}}}
Anybody will shed some light?
This code work and add a single product without any category, image or attributes aka simple.
var data =
{
"name" : " TESTING HERE TOO",
"type" : "simple",
"regular_price" : "21.99",
"weight" : 60,
"manage_stock" : true,
"stock_quantity" : 10,
};
this one however, doesn´t work:
var data =
{
"name" : " TESTING HERE TOO",
"type" : "simple",
"regular_price" : "21.99",
"weight" : 60,
"manage_stock" : true,
"stock_quantity" : 10,
"categories": [ { "id": 16 ,"name":"Uncategorized","slug" : "uncategorized " } ],
};
ERROR: {"code":"rest_invalid_param","message":"Invalid parameter(s): categories","data":{"status":400,"params":{"categories":"categories[0] is not of type object."},"details":{"categories":{"code":"rest_invalid_type","message":"categories[0] is not of type object.","data":{"param":"categories[0]"}}}}}
Anybody will shed some light?